Skip to content

Commit

Permalink
Initial commit from ndx-template
Browse files Browse the repository at this point in the history
  • Loading branch information
rly committed Oct 21, 2023
1 parent 148c398 commit 6763780
Show file tree
Hide file tree
Showing 26 changed files with 1,190 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# output NWB files
*.nwb

# generated docs
docs/source/_format_auto_docs

# copied spec files
src/pynwb/ndx_hed/spec/*.yaml

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -50,6 +59,7 @@ coverage.xml
.hypothesis/
.pytest_cache/
cover/
.ruff_cache/

# Translations
*.mo
Expand Down Expand Up @@ -158,3 +168,6 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Mac finder
.DS_Store
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Changelog for ndx-hed
29 changes: 29 additions & 0 deletions LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2023, Ryan Ly, Oliver Ruebel, Kay Robbins
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
158 changes: 158 additions & 0 deletions NEXTSTEPS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,158 @@


# Next Steps for ndx-hed Extension for NWB

## Creating Your Extension

1. In a terminal, change directory into the new ndx-hed directory: `cd ndx-hed`

2. Add any packages required by your extension to the `dependencies` key in `pyproject.toml`.

3. Run `python -m pip install -e .` to install your new extension Python package
and any other packages required to develop, document, and run your extension.

4. Modify `src/spec/create_extension_spec.py` to define your extension.

5. Run `python src/spec/create_extension_spec.py` to generate the
`spec/ndx-hed.namespace.yaml` and
`spec/ndx-hed.extensions.yaml` files.

6. Define API classes for your new extension data types.

- As a starting point, `src/pynwb/__init__.py` includes an example for how to use
the `pynwb.get_class` to generate 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 the
[Extending NWB tutorial](https://pynwb.readthedocs.io/en/stable/tutorials/general/extensions.html)
for more details.

7. Define tests for your new extension data types in `src/pynwb/tests` or `src/matnwb/tests`.
A test for the example `TetrodeSeries` data type is provided as a reference and should be
replaced or removed.

- Python tests should be runnable by executing [`pytest`](https://docs.pytest.org/en/latest/)
from the root of the extension directory. Use of PyNWB testing infrastructure from
`pynwb.testing` is encouraged (see
[documentation](https://pynwb.readthedocs.io/en/stable/pynwb.testing.html)).
- 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.

8. You may need to modify `pyproject.toml` and re-run `python -m pip install -e .` if you
use any dependencies.

9. Update the `CHANGELOG.md` regularly to document changes to your extension.


## Documenting and Publishing Your Extension to the Community

1. Install the latest release of hdmf_docutils: `python -m pip install hdmf-docutils`

2. Start a git repository for your extension directory ndx-hed
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

3. Change directory into `docs`.

4. Run `make html` to generate documentation for your extension based on the YAML files.

5. Read `docs/README.md` for instructions on how to customize documentation for
your extension.

6. Modify `README.md` to describe this extension for interested developers.

7. Add a license file. Permissive licenses should be used if possible. **A [BSD license](https://opensource.org/licenses/BSD-3-Clause) is recommended.**

8. Update the `CHANGELOG.md` to document changes to your extension.

8. 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/rly/ndx-hed/releases/tag/0.1.0 . For instructions on how to make a release on GitHub see [here](https://help.github.com/en/github/administering-a-repository/creating-releases).

9. Publish your updated extension on [PyPI](https://pypi.org/).
- Follow these directions: https://packaging.python.org/en/latest/tutorials/packaging-projects/
- You may need to modify `pyproject.toml`
- If your extension version is 0.1.0, then this page should exist: https://pypi.org/project/ndx-hed/0.1.0

Once your GitHub release and `pyproject.toml` are ready, publishing on PyPI:
```bash
python -m pip install --upgrade build twine
python -m build
twine upload dist/*
```

10. Go to https://github.com/nwb-extensions/staged-extensions and fork the
repository.

11. Clone the fork onto your local filesystem.

12. Copy the directory `staged-extensions/example` to a new directory
`staged-extensions/ndx-hed`:

```bash
cp -r staged-extensions/example staged-extensions/ndx-hed
```

13. Edit `staged-extensions/ndx-hed/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
- You may copy and modify the following YAML that was auto-generated:

```yaml
name: ndx-hed
version: 0.1.0
src: https://github.com/rly/ndx-hed
pip: https://pypi.org/project/ndx-hed/
license: BSD-3
maintainers:
- rly
- oruebel
- VisLab
```

14. Edit `staged-extensions/ndx-hed/README.md`
to add information about your extension. You may copy it from
`ndx-hed/README.md`.

```bash
cp ndx-hed/README.md staged-extensions/ndx-hed/README.md
```

15. Add and commit your changes to Git and push your changes to GitHub.
```
cd staged-extensions
git add ndx-hed
git commit -m "Add new catalog entry for ndx-hed" .
git push
```
16. 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.
17. When your pull request is merged, a new repository, called
ndx-hed-record will be created in the nwb-extensions
GitHub organization and you will be added as a maintainer for that repository.
## Updating Your Published Extension
1. Update your ndx-hed GitHub repository.
2. Publish your updated extension on PyPI.
3. Fork the ndx-hed-record repository on GitHub.
4. 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.
5. Your updated extension is approved.
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,15 @@
# ndx-hed
HED extensions for Neurodata Without Borders (nwb)
# ndx-hed Extension for NWB

Description of the extension

## Installation


## Usage

```python

```

---
This extension was created using [ndx-template](https://github.com/nwb-extensions/ndx-template).
Loading

0 comments on commit 6763780

Please sign in to comment.