-
In a terminal, change directory into the new ndx-hierarchical-behavioral-data directory.
-
Add any packages required by your extension to
requirements.txt
andsetup.py
. -
Run
python -m pip install -r requirements.txt
to install thepynwb
package and any other packages required by your extension. -
Modify
src/spec/create_extension_spec.py
to define your extension. -
Run
python src/spec/create_extension_spec.py
to generate thespec/ndx-hierarchical-behavioral-data.namespace.yaml
andspec/ndx-hierarchical-behavioral-data.extensions.yaml
files. -
Define API classes for your new extension data types.
- As a starting point,
src/pynwb/__init__.py
includes an example for how to use thepynwb.get_class
to get a basic Python class for your new extension data type. This class contains a constructor and properties for the new data type. - Instead of using
pynwb.get_class
, you can define your own custom class for the new type, which will allow you to customize the class methods, customize the object mapping, and create convenience functions. See https://pynwb.readthedocs.io/en/stable/tutorials/general/extensions.html for more details.
- As a starting point,
-
Define tests for your new extension data types in
src/pynwb/tests
orsrc/matnwb/tests
. A test for the exampleTetrodeSeries
data type is provided as a reference and should be replaced or removed.- Python tests should be runnable by executing
pytest
from the root of the extension directory. Use of PyNWB testing infrastructure frompynwb.testing
is encouraged (see documentation). - Creating both unit tests (e.g., testing initialization of new data type classes and new functions) and integration tests (e.g., write the new data types to file, read the file, and confirm the read data types are equal to the written data types) is highly encouraged.
- Python tests should be runnable by executing
-
You may need to modify
setup.py
and re-runpython setup.py install
if you use any dependencies.
-
Install the latest release of hdmf_docutils:
python -m pip install hdmf-docutils
-
Start a git repository for your extension directory ndx-hierarchical-behavioral-data and push it to GitHub. You will need a GitHub account.
- Follow these directions: https://help.github.com/en/articles/adding-an-existing-project-to-github-using-the-command-line
-
Change directory into
docs
. -
Run
make html
to generate documentation for your extension based on the YAML files. -
Read
docs/README.md
for instructions on how to customize documentation for your extension. -
Modify
README.md
to describe this extension for interested developers. -
Add a license file. Permissive licenses should be used if possible. A BSD license is recommended.
-
Make a release for the extension on GitHub with the version number specified. e.g. if version is 0.1.0, then this page should exist: https://github.com/bendichter/ndx-hierarchical-behavioral-data/releases/tag/0.1.0 . For instructions on how to make a release on GitHub see here.
-
Publish your updated extension on PyPI.
- Follow these directions: https://packaging.python.org/tutorials/packaging-projects/
- You may need to modify
setup.py
- If your extension version is 0.1.0, then this page should exist: https://pypi.org/project/ndx-hierarchical-behavioral-data/0.1.0
Once your GitHub release and
setup.py
are ready, publishing on PyPI:python setup.py sdist bdist_wheel twine upload dist/*
-
Go to https://github.com/nwb-extensions/staged-extensions and fork the repository.
-
Clone the fork onto your local filesystem.
-
Copy the directory
staged-extensions/example
to a new directorystaged-extensions/ndx-hierarchical-behavioral-data
:cp -r staged-extensions/example staged-extensions/ndx-hierarchical-behavioral-data
-
Edit
staged-extensions/ndx-hierarchical-behavioral-data/ndx-meta.yaml
with information on where to find your NWB extension.- The YAML file MUST contain a dict with the following keys:
- name: extension namespace name
- version: extension version
- src: URL for the main page of the public repository (e.g. on GitHub, BitBucket, GitLab) that contains the sources of the extension
- pip: URL for the main page of the extension on PyPI
- license: name of the license of the extension
- maintainers: list of GitHub usernames of those who will reliably maintain the extension
- The YAML file MUST contain a dict with the following keys:
You may copy and modify the following YAML that was auto-generated:
name: ndx-hierarchical-behavioral-data
version: 0.1.0
src: https://github.com/bendichter/ndx-hierarchical-behavioral-data
pip: https://pypi.org/project/ndx-hierarchical-behavioral-data/
license: BSD 3-Clause
maintainers:
- bendichter
- Edit
staged-extensions/ndx-hierarchical-behavioral-data/README.md
to add information about your extension. You may copy it fromndx-hierarchical-behavioral-data/README.md
.
cp ndx-hierarchical-behavioral-data/README.md staged-extensions/ndx-hierarchical-behavioral-data/README.md
- Add and commit your changes to Git and push your changes to GitHub.
cd staged-extensions
git add ndx-hierarchical-behavioral-data
git commit -m "Add new catalog entry for ndx-hierarchical-behavioral-data" .
git push
-
Open a pull request. Building of your extension will be tested on Windows, Mac, and Linux. The technical team will review your extension shortly after and provide feedback and request changes, if any.
-
When your pull request is merged, a new repository, called ndx-hierarchical-behavioral-data-feedstock will be created in the nwb-extensions GitHub organization and you will be added as a maintainer for that repository.
-
Update your ndx-hierarchical-behavioral-data GitHub repository.
-
Publish your updated extension on PyPI.
-
Fork the ndx-hierarchical-behavioral-data-feedstock repository on GitHub.
-
Open a pull request to test the changes automatically. The technical team will review your changes shortly after and provide feedback and request changes, if any.
-
Your updated extension is approved.