Skip to content

Commit 46e8878

Browse files
authored
Merge branch 'dev' into find_all_of_class
2 parents a441a6d + 7c6868b commit 46e8878

File tree

69 files changed

+1573
-971
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+1573
-971
lines changed

.codespellrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
[codespell]
22
# in principle .ipynb can be corrected -- a good number of typos there
33
# nwb-schema -- excluding since submodule, should have its own fixes/checks
4-
skip = .git,*.pdf,*.svg,venvs,env,*.ipynb,nwb-schema
4+
skip = .git,*.pdf,*.svg,venvs,env,nwb-schema
5+
ignore-regex = ^\s*"image/\S+": ".*
56
# it is optin in a url
67
# potatos - demanded to be left alone, autogenerated
78
ignore-words-list = optin,potatos

.github/workflows/codespell.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ jobs:
1616
- name: Checkout
1717
uses: actions/checkout@v3
1818
- name: Codespell
19-
uses: codespell-project/actions-codespell@v1
19+
uses: codespell-project/actions-codespell@v2

.github/workflows/run_all_tests.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ jobs:
108108
- uses: actions/checkout@v3
109109
with:
110110
submodules: 'recursive'
111+
fetch-depth: 0 # tags are required for versioneer to determine the version
111112

112113
- name: Set up Python
113114
uses: actions/setup-python@v4
@@ -151,6 +152,7 @@ jobs:
151152
- uses: actions/checkout@v3
152153
with:
153154
submodules: 'recursive'
155+
fetch-depth: 0 # tags are required for versioneer to determine the version
154156

155157
- name: Set up Conda
156158
uses: conda-incubator/setup-miniconda@v2
@@ -194,9 +196,9 @@ jobs:
194196
fail-fast: false
195197
matrix:
196198
include:
197-
- { name: linux-python3.11-ros3 , python-ver: "3.11", os: ubuntu-latest }
198-
- { name: windows-python3.11-ros3, python-ver: "3.11", os: windows-latest }
199-
- { name: macos-python3.11-ros3 , python-ver: "3.11", os: macos-latest }
199+
- { name: conda-linux-python3.11-ros3 , python-ver: "3.11", os: ubuntu-latest }
200+
- { name: conda-windows-python3.11-ros3, python-ver: "3.11", os: windows-latest }
201+
- { name: conda-macos-python3.11-ros3 , python-ver: "3.11", os: macos-latest }
200202
steps:
201203
- name: Cancel non-latest runs
202204
uses: styfle/[email protected]
@@ -207,6 +209,7 @@ jobs:
207209
- uses: actions/checkout@v3
208210
with:
209211
submodules: 'recursive'
212+
fetch-depth: 0 # tags are required for versioneer to determine the version
210213

211214
- name: Set up Conda
212215
uses: conda-incubator/setup-miniconda@v2
@@ -240,9 +243,9 @@ jobs:
240243
fail-fast: false
241244
matrix:
242245
include:
243-
- { name: linux-gallery-python3.11-ros3 , python-ver: "3.11", os: ubuntu-latest }
244-
- { name: windows-gallery-python3.11-ros3, python-ver: "3.11", os: windows-latest }
245-
- { name: macos-gallery-python3.11-ros3 , python-ver: "3.11", os: macos-latest }
246+
- { name: conda-linux-gallery-python3.11-ros3 , python-ver: "3.11", os: ubuntu-latest }
247+
- { name: conda-windows-gallery-python3.11-ros3, python-ver: "3.11", os: windows-latest }
248+
- { name: conda-macos-gallery-python3.11-ros3 , python-ver: "3.11", os: macos-latest }
246249
steps:
247250
- name: Cancel non-latest runs
248251
uses: styfle/[email protected]
@@ -253,6 +256,7 @@ jobs:
253256
- uses: actions/checkout@v3
254257
with:
255258
submodules: 'recursive'
259+
fetch-depth: 0 # tags are required for versioneer to determine the version
256260

257261
- name: Set up Conda
258262
uses: conda-incubator/setup-miniconda@v2
@@ -278,4 +282,4 @@ jobs:
278282
279283
- name: Run gallery ros3 tests
280284
run: |
281-
python test.py --example-ros3
285+
python test.py --example-ros3

.github/workflows/run_coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171

7272
- name: Run integration tests and generate coverage report
7373
run: |
74-
python -m coverage run -p test.py --integration --backwards
74+
python -m coverage run -p test.py --integration --validation-module --backwards
7575
# validation CLI tests generate separate .coverage files that need to be merged
7676
python -m coverage combine
7777
python -m coverage xml # codecov uploader requires xml format
Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
name: Run DANDI read tests
22
on:
3-
schedule:
4-
- cron: '0 6 * * *' # once per day at 1am ET
3+
# NOTE this is disabled until we can run this systematically instead of randomly
4+
# so we don't get constant error notifications and waste compute cycles
5+
# See https://github.com/NeurodataWithoutBorders/pynwb/issues/1804
6+
# schedule:
7+
# - cron: '0 6 * * *' # once per day at 1am ET
58
workflow_dispatch:
69

710
jobs:
811
run-tests:
912
runs-on: ubuntu-latest
10-
defaults:
11-
run:
12-
shell: bash -l {0} # necessary for conda
1313
steps:
1414
- name: Cancel non-latest runs
1515
uses: styfle/[email protected]
@@ -22,19 +22,14 @@ jobs:
2222
submodules: 'recursive'
2323
fetch-depth: 0 # tags are required for versioneer to determine the version
2424

25-
- name: Set up Conda
26-
uses: conda-incubator/setup-miniconda@v2
25+
- name: Set up Python
26+
uses: actions/setup-python@v4
2727
with:
28-
auto-update-conda: true
29-
activate-environment: ros3
30-
environment-file: environment-ros3.yml
31-
python-version: "3.11"
32-
channels: conda-forge
33-
auto-activate-base: false
28+
python-version: '3.11'
3429

3530
- name: Install run dependencies
3631
run: |
37-
python -m pip install dandi pytest
32+
python -m pip install dandi fsspec requests aiohttp pytest
3833
python -m pip uninstall -y pynwb # uninstall pynwb
3934
python -m pip install -e .
4035
python -m pip list
@@ -47,4 +42,4 @@ jobs:
4742
4843
- name: Run DANDI read tests
4944
run: |
50-
pytest -rP tests/read_dandi/
45+
python tests/read_dandi/read_dandi.py

.github/workflows/run_tests.yml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ jobs:
9292
- uses: actions/checkout@v3
9393
with:
9494
submodules: 'recursive'
95+
fetch-depth: 0 # tags are required for versioneer to determine the version
9596

9697
- name: Set up Python
9798
uses: actions/setup-python@v4
@@ -173,7 +174,7 @@ jobs:
173174
fail-fast: false
174175
matrix:
175176
include:
176-
- { name: linux-python3.11-ros3 , python-ver: "3.11", os: ubuntu-latest }
177+
- { name: conda-linux-python3.11-ros3 , python-ver: "3.11", os: ubuntu-latest }
177178
steps:
178179
- name: Cancel non-latest runs
179180
uses: styfle/[email protected]
@@ -184,6 +185,7 @@ jobs:
184185
- uses: actions/checkout@v3
185186
with:
186187
submodules: 'recursive'
188+
fetch-depth: 0 # tags are required for versioneer to determine the version
187189

188190
- name: Set up Conda
189191
uses: conda-incubator/setup-miniconda@v2
@@ -217,7 +219,7 @@ jobs:
217219
fail-fast: false
218220
matrix:
219221
include:
220-
- { name: linux-gallery-python3.11-ros3 , python-ver: "3.11", os: ubuntu-latest }
222+
- { name: conda-linux-gallery-python3.11-ros3 , python-ver: "3.11", os: ubuntu-latest }
221223
steps:
222224
- name: Cancel non-latest runs
223225
uses: styfle/[email protected]
@@ -228,6 +230,7 @@ jobs:
228230
- uses: actions/checkout@v3
229231
with:
230232
submodules: 'recursive'
233+
fetch-depth: 0 # tags are required for versioneer to determine the version
231234

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

275279
- name: Set up Python
276280
uses: actions/setup-python@v4

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,39 @@
11
# PyNWB Changelog
22

3+
## PyNWB 2.6.0 (Upcoming)
4+
5+
### Enhancements and minor changes
6+
- For `NWBHDF5IO()`, change the default of arg `load_namespaces` from `False` to `True`. @bendichter [#1748](https://github.com/NeurodataWithoutBorders/pynwb/pull/1748)
7+
- Add `NWBHDF5IO.can_read()`. @bendichter [#1703](https://github.com/NeurodataWithoutBorders/pynwb/pull/1703)
8+
- Add `pynwb.get_nwbfile_version()`. @bendichter [#1703](https://github.com/NeurodataWithoutBorders/pynwb/pull/1703)
9+
- Updated timeseries data checks to warn instead of error when reading invalid files. @stephprince [#1793](https://github.com/NeurodataWithoutBorders/pynwb/pull/1793) and [#1809](https://github.com/NeurodataWithoutBorders/pynwb/pull/1809)
10+
- Expose the offset, conversion and channel conversion parameters in `mock_ElectricalSeries`. @h-mayorquin [#1796](https://github.com/NeurodataWithoutBorders/pynwb/pull/1796)
11+
- Expose `starting_time` in `mock_ElectricalSeries`. @h-mayorquin [#1805](https://github.com/NeurodataWithoutBorders/pynwb/pull/1805)
12+
- Enhance `get_data_in_units()` to work with objects that have a `channel_conversion` attribute like the `ElectricalSeries`. @h-mayorquin [#1806](https://github.com/NeurodataWithoutBorders/pynwb/pull/1806)
13+
- Refactor validation CLI tests to use `{sys.executable} -m coverage` to use the same Python version and run correctly on Debian systems. @yarikoptic [#1811](https://github.com/NeurodataWithoutBorders/pynwb/pull/1811)
14+
15+
### Bug fixes
16+
- Fix bug where namespaces were loaded in "w-" mode. @h-mayorquin [#1795](https://github.com/NeurodataWithoutBorders/pynwb/pull/1795)
17+
- Fix bug where pynwb version was reported as "unknown" to readthedocs @stephprince [#1810](https://github.com/NeurodataWithoutBorders/pynwb/pull/1810)
18+
19+
### Documentation and tutorial enhancements
20+
- Add RemFile to streaming tutorial. @bendichter [#1761](https://github.com/NeurodataWithoutBorders/pynwb/pull/1761)
21+
- Fix typos and improve clarify throughout tutorials. @zm711 [#1825](https://github.com/NeurodataWithoutBorders/pynwb/pull/1825)
22+
23+
## PyNWB 2.5.0 (August 18, 2023)
24+
25+
### Enhancements and minor changes
26+
- Add `TimeSeries.get_timestamps()`. @bendichter [#1741](https://github.com/NeurodataWithoutBorders/pynwb/pull/1741)
27+
- Add `TimeSeries.get_data_in_units()`. @bendichter [#1745](https://github.com/NeurodataWithoutBorders/pynwb/pull/1745)
28+
- 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)
29+
30+
### Documentation and tutorial enhancements
31+
- 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)
32+
- Fixed minor documentation build warnings and broken links to `basic_trials` tutorial @oruebel [#1762](https://github.com/NeurodataWithoutBorders/pynwb/pull/1762)
33+
34+
## PyNWB 2.4.1 (July 26, 2023)
35+
- Stop running validation tests as part of integration tests. They cause issues in CI and can be run separately. @rly [#1740](https://github.com/NeurodataWithoutBorders/pynwb/pull/1740)
36+
337
## PyNWB 2.4.0 (July 23, 2023)
438

539
### Enhancements and minor changes

docs/gallery/advanced_io/linking_data.py

Lines changed: 38 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -6,57 +6,50 @@
66
77
PyNWB supports linking between files using external links.
88
9-
"""
9+
Example Use Case: Integrating data from multiple files
10+
---------------------------------------------------------
1011
11-
####################
12-
# Example Use Case: Integrating data from multiple files
13-
# ---------------------------------------------------------
14-
#
15-
# NBWContainer classes (e.g., :py:class:`~pynwb.base.TimeSeries`) support the integration of data stored in external
16-
# HDF5 files with NWB data files via external links. To make things more concrete, let's look at the following use
17-
# case. We want to simultaneously record multiple data streams during data acquisition. Using the concept of external
18-
# links allows us to save each data stream to an external HDF5 files during data acquisition and to
19-
# afterwards link the data into a single NWB:N file. In this case, each recording becomes represented by a
20-
# separate file-system object that can be set as read-only once the experiment is done. In the following
21-
# we are using :py:meth:`~pynwb.base.TimeSeries` as an example, but the same approach works for other
22-
# NWBContainers as well.
23-
#
12+
NBWContainer classes (e.g., :py:class:`~pynwb.base.TimeSeries`) support the integration of data stored in external
13+
HDF5 files with NWB data files via external links. To make things more concrete, let's look at the following use
14+
case. We want to simultaneously record multiple data streams during data acquisition. Using the concept of external
15+
links allows us to save each data stream to an external HDF5 files during data acquisition and to
16+
afterwards link the data into a single NWB file. In this case, each recording becomes represented by a
17+
separate file-system object that can be set as read-only once the experiment is done. In the following
18+
we are using :py:meth:`~pynwb.base.TimeSeries` as an example, but the same approach works for other
19+
NWBContainers as well.
2420
25-
####################
26-
# .. tip::
27-
#
28-
# The same strategies we use here for creating External Links also apply to Soft Links.
29-
# The main difference between soft and external links is that soft links point to other
30-
# objects within the same file while external links point to objects in external files.
31-
#
21+
.. tip::
3222
33-
####################
34-
# .. tip::
35-
#
36-
# In the case of :py:meth:`~pynwb.base.TimeSeries`, the uncorrected timestamps generated by the acquisition
37-
# system can be stored (or linked) in the *sync* group. In the NWB:N format, hardware-recorded time data
38-
# must then be corrected to a common time base (e.g., timestamps from all hardware sources aligned) before
39-
# it can be included in the *timestamps* of the *TimeSeries*. This means, in the case
40-
# of :py:meth:`~pynwb.base.TimeSeries` we need to be careful that we are not including data with incompatible
41-
# timestamps in the same file when using external links.
42-
#
23+
The same strategies we use here for creating External Links also apply to Soft Links.
24+
The main difference between soft and external links is that soft links point to other
25+
objects within the same file while external links point to objects in external files.
4326
44-
####################
45-
# .. warning::
46-
#
47-
# External links can become stale/break. Since external links are pointing to data in other files
48-
# external links may become invalid any time files are modified on the file system, e.g., renamed,
49-
# moved or access permissions are changed.
50-
#
27+
.. tip::
5128
52-
####################
53-
# Creating test data
54-
# ---------------------------
55-
#
56-
# In the following we are creating two :py:meth:`~pynwb.base.TimeSeries` each written to a separate file.
57-
# We then show how we can integrate these files into a single NWBFile.
29+
In the case of :py:meth:`~pynwb.base.TimeSeries`, the uncorrected timestamps generated by the acquisition
30+
system can be stored (or linked) in the *sync* group. In the NWB format, hardware-recorded time data
31+
must then be corrected to a common time base (e.g., timestamps from all hardware sources aligned) before
32+
it can be included in the *timestamps* of the *TimeSeries*. This means, in the case
33+
of :py:meth:`~pynwb.base.TimeSeries` we need to be careful that we are not including data with incompatible
34+
timestamps in the same file when using external links.
35+
36+
37+
.. warning::
38+
39+
External links can become stale/break. Since external links are pointing to data in other files
40+
external links may become invalid any time files are modified on the file system, e.g., renamed,
41+
moved or access permissions are changed.
42+
43+
44+
Creating test data
45+
---------------------------
46+
47+
In the following we are creating two :py:meth:`~pynwb.base.TimeSeries` each written to a separate file.
48+
We then show how we can integrate these files into a single NWBFile.
49+
"""
5850

5951
# sphinx_gallery_thumbnail_path = 'figures/gallery_thumbnails_linking_data.png'
52+
6053
from datetime import datetime
6154
from uuid import uuid4
6255

@@ -228,7 +221,7 @@
228221
# Step 2: Add the container to another NWBFile
229222
# ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
230223
# To integrate both :py:meth:`~pynwb.base.TimeSeries` into a single file we simply create a new
231-
# :py:meth:`~pynwb.file.NWBFile` and our existing :py:meth:`~pynwb.base.TimeSeries` to it. PyNWB's
224+
# :py:meth:`~pynwb.file.NWBFile` and add our existing :py:meth:`~pynwb.base.TimeSeries` to it. PyNWB's
232225
# :py:class:`~pynwb.NWBHDF5IO` backend then automatically detects that the TimeSeries have already
233226
# been written to another file and will create external links for us.
234227
#

0 commit comments

Comments
 (0)