Skip to content

Commit

Permalink
Release 2.5.0/ Update ExternalResources to HERD (#1754)
Browse files Browse the repository at this point in the history
* Update ExternalResources to HERD

* Update setup.py

* Update requirements.txt

* Update requirements-min.txt

* Update environment-ros3.yml

* Update CHANGELOG.md

* Update environment-ros3.yml

* Update run_tests.yml

* Update run_all_tests.yml

* Update run_tests.yml

* Update run_all_tests.yml

* Update run_all_tests.yml

* Update run_tests.yml
  • Loading branch information
mavaylon1 authored Aug 18, 2023
1 parent 8eb9a36 commit 68c4f56
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 18 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/run_all_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0 # tags are required for versioneer to determine the version

- name: Set up Python
uses: actions/setup-python@v4
Expand Down Expand Up @@ -151,6 +152,7 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0 # tags are required for versioneer to determine the version

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v2
Expand Down Expand Up @@ -207,6 +209,7 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0 # tags are required for versioneer to determine the version

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v2
Expand Down Expand Up @@ -253,6 +256,7 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0 # tags are required for versioneer to determine the version

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v2
Expand All @@ -278,4 +282,4 @@ jobs:
- name: Run gallery ros3 tests
run: |
python test.py --example-ros3
python test.py --example-ros3
4 changes: 4 additions & 0 deletions .github/workflows/run_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0 # tags are required for versioneer to determine the version

- name: Set up Python
uses: actions/setup-python@v4
Expand Down Expand Up @@ -184,6 +185,7 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0 # tags are required for versioneer to determine the version

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v2
Expand Down Expand Up @@ -228,6 +230,7 @@ jobs:
- uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0 # tags are required for versioneer to determine the version

- name: Set up Conda
uses: conda-incubator/setup-miniconda@v2
Expand Down Expand Up @@ -271,6 +274,7 @@ jobs:
uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0 # tags are required for versioneer to determine the version

- name: Set up Python
uses: actions/setup-python@v4
Expand Down
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# PyNWB Changelog

## PyNWB 2.5.0 (Upcoming)
## PyNWB 2.5.0 (August 18, 2023)

### Enhancements and minor changes
- Add `TimeSeries.get_timestamps()`. @bendichter [#1741](https://github.com/NeurodataWithoutBorders/pynwb/pull/1741)
- Add `TimeSeries.get_data_in_units()`. @bendichter [#1745](https://github.com/NeurodataWithoutBorders/pynwb/pull/1745)
- Updated `ExternalResources` name change to `HERD`, along with HDMF 3.9.0 being the new minimum. @mavaylon1 [#1754](https://github.com/NeurodataWithoutBorders/pynwb/pull/1754)

### Documentation and tutorial enhancements
- Updated streaming tutorial to ensure code is run on tests and clarify text. @bendichter [#1760](https://github.com/NeurodataWithoutBorders/pynwb/pull/1760) @oruebel [#1762](https://github.com/NeurodataWithoutBorders/pynwb/pull/1762)
Expand Down
2 changes: 1 addition & 1 deletion environment-ros3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ dependencies:
- dandi==0.55.1 # NOTE: dandi does not support osx-arm64
- fsspec==2023.6.0
- requests==2.28.1
- aiohttp==3.8.3
- aiohttp==3.8.3
2 changes: 1 addition & 1 deletion requirements-min.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# minimum versions of package dependencies for installing PyNWB
h5py==2.10 # support for selection of datasets with list of indices added in 2.10
hdmf==3.8.0
hdmf==3.9.0
numpy==1.18
pandas==1.1.5
python-dateutil==2.7.3
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# pinned dependencies to reproduce an entire development environment to use PyNWB
h5py==3.8.0
hdmf==3.8.0
hdmf==3.9.0
numpy==1.24.2
pandas==2.0.0
python-dateutil==2.8.2
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

reqs = [
'h5py>=2.10',
'hdmf>=3.8.0',
'hdmf>=3.9.0',
'numpy>=1.16',
'pandas>=1.1.5',
'python-dateutil>=2.7.3',
Expand Down
8 changes: 4 additions & 4 deletions src/pynwb/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,12 @@ class NWBHDF5IO(_HDF5IO):
{'name': 'comm', 'type': "Intracomm", 'doc': 'the MPI communicator to use for parallel I/O',
'default': None},
{'name': 'driver', 'type': str, 'doc': 'driver for h5py to use when opening HDF5 file', 'default': None},
{'name': 'external_resources_path', 'type': str, 'doc': 'The path to the ExternalResources',
{'name': 'herd_path', 'type': str, 'doc': 'The path to the HERD',
'default': None},)
def __init__(self, **kwargs):
path, mode, manager, extensions, load_namespaces, file_obj, comm, driver, external_resources_path =\
path, mode, manager, extensions, load_namespaces, file_obj, comm, driver, herd_path =\
popargs('path', 'mode', 'manager', 'extensions', 'load_namespaces',
'file', 'comm', 'driver', 'external_resources_path', kwargs)
'file', 'comm', 'driver', 'herd_path', kwargs)
# Define the BuildManager to use
if load_namespaces:
if manager is not None:
Expand Down Expand Up @@ -251,7 +251,7 @@ def __init__(self, **kwargs):
manager = get_manager()
# Open the file
super().__init__(path, manager=manager, mode=mode, file=file_obj, comm=comm,
driver=driver, external_resources_path=external_resources_path)
driver=driver, herd_path=herd_path)

@property
def nwb_version(self):
Expand Down
4 changes: 2 additions & 2 deletions src/pynwb/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import pandas as pd

from hdmf.common import DynamicTableRegion, DynamicTable
from hdmf.container import ExternalResourcesManager
from hdmf.container import HERDManager
from hdmf.utils import docval, getargs, get_docval, popargs, popargs_to_dict, AllowPositional

from . import register_class, CORE_NAMESPACE
Expand Down Expand Up @@ -150,7 +150,7 @@ def __init__(self, **kwargs):


@register_class('NWBFile', CORE_NAMESPACE)
class NWBFile(MultiContainerInterface, ExternalResourcesManager):
class NWBFile(MultiContainerInterface, HERDManager):
"""
A representation of an NWB file.
"""
Expand Down
10 changes: 7 additions & 3 deletions src/pynwb/resources.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
from hdmf.common import ExternalResources as hdmf_ExternalResources
from hdmf.common import HERD as hdmf_HERD
from . import get_type_map as tm
from hdmf.utils import docval, get_docval


class ExternalResources(hdmf_ExternalResources):
@docval(*get_docval(hdmf_ExternalResources.__init__))
class HERD(hdmf_HERD):
"""
HDMF External Resources Data Structure.
A table for mapping user terms (i.e. keys) to resource entities.
"""
@docval(*get_docval(hdmf_HERD.__init__))
def __init__(self, **kwargs):
kwargs['type_map'] = tm()
super().__init__(**kwargs)
6 changes: 3 additions & 3 deletions tests/unit/test_resources.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from pynwb.resources import ExternalResources
from pynwb.resources import HERD
from pynwb.testing import TestCase


Expand All @@ -7,5 +7,5 @@ def test_constructor(self):
"""
Test constructor
"""
er = ExternalResources()
self.assertIsInstance(er, ExternalResources)
er = HERD()
self.assertIsInstance(er, HERD)

0 comments on commit 68c4f56

Please sign in to comment.