Skip to content

Commit e332fb6

Browse files
authored
Merge branch 'dev' into target_tables
2 parents d2581de + b0973cc commit e332fb6

Some content is hidden

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

50 files changed

+1473
-360
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ body:
6666
- "3.11"
6767
- "3.12"
6868
- "3.13"
69+
- "higher version (not yet supported)"
6970
validations:
7071
required: true
7172
- type: textarea

CHANGELOG.md

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,57 @@
11
# PyNWB Changelog
22

3-
## Upcoming
3+
## PyNWB 3.1.3 (Unreleased)
44

5-
### Breaking changes
5+
### Fixed
6+
- Fixed incorrect warning for path not ending in `.nwb` when no path argument was provided. @t-b [#2130](https://github.com/NeurodataWithoutBorders/pynwb/pull/2130)
7+
- Fixed issue with setting `neurodata_type_inc` when reading NWB files with cached schema versions less than 2.2.0. @rly [#2135](https://github.com/NeurodataWithoutBorders/pynwb/pull/2135)
8+
- Fixed import structure test. @rly [#2136](https://github.com/NeurodataWithoutBorders/pynwb/pull/2136)
9+
10+
### Documentation and tutorial enhancements
11+
- Change UI of assistant to be an accordion that is always visible. [#2124](https://github.com/NeurodataWithoutBorders/pynwb/pull/2124)
12+
13+
14+
## PyNWB 3.1.2 (August 13, 2025)
15+
16+
### Fixed
17+
- Fixed parsing of the nwb_version attribute which followed the previous suggestion to have a `NWB-` prefix.
18+
@t-b [#2118](https://github.com/NeurodataWithoutBorders/pynwb/pull/2118)
19+
- Fixed a performance regression introduced in pynwb 2.8.0 that affected reading NWB files with a large
20+
number of objects or fields of objects. @rly [#2121](https://github.com/NeurodataWithoutBorders/pynwb/pull/2121)
21+
- Fixed `load_type_config`, `unload_type_config`, and `get_loaded_type_config` acting on a copy of the global type map
22+
instead of the global type map itself. @rly [#2121](https://github.com/NeurodataWithoutBorders/pynwb/pull/2121)
23+
24+
### Changed
25+
- Added an argument `copy` to `get_type_map` to control whether a copy of the type map is returned or not.
26+
If `copy=False`, the returned type map will be a direct reference to the global type map. @rly
27+
[#2121](https://github.com/NeurodataWithoutBorders/pynwb/pull/2121)
28+
- Deprecated calling `get_type_map` with the `extensions` argument. Call `load_namespaces` on the returned `TypeMap`
29+
instead. @rly [#2121](https://github.com/NeurodataWithoutBorders/pynwb/pull/2121)
630

31+
## PyNWB 3.1.1 (July 22, 2025)
32+
33+
### Bug fixes
34+
- Fixed reading and exporting of files written with NWB Schema < 2.9.0 that contained a reference to the electrodes table. @rly [#2112](https://github.com/NeurodataWithoutBorders/pynwb/pull/2112)
35+
- Updated tests to skip streaming tests gracefully if offline. @rly [#2113](https://github.com/NeurodataWithoutBorders/pynwb/pull/2113)
36+
- Added check in `PlaneSegmentation` constructor for required columns. @rly [#2102](https://github.com/NeurodataWithoutBorders/pynwb/pull/2102)
37+
38+
39+
## PyNWB 3.1.0 (July 8, 2025)
40+
41+
### Breaking changes
742
- Removed unused functions `prepend_string` and `_not_parent` in `core.py`, `_not_parent` in `file.py`, and `NWBBaseTypeMapper.get_nwb_file` in `io/core.py` @oruebel [#2036](https://github.com/NeurodataWithoutBorders/pynwb/pull/2036)
843

944
### Enhancements and minor changes
45+
- Added support for NWB Schema 2.9.0.
46+
- Added `BaseImage` and `ExternalImage` as new neurodata types. The first so both `Image` and `ExternalImage` can inherit from it. The second to store external images. @rly [#2079](https://github.com/NeurodataWithoutBorders/pynwb/pull/2079)
47+
- Added new `ElectrodesTable` neurodata type. @mavaylon1 [#1890](https://github.com/NeurodataWithoutBorders/pynwb/pull/1890)
48+
- Formally defined and renamed `ElectrodeTable` as the `ElectrodesTable` neurodata type. @mavaylon1 [#1890](https://github.com/NeurodataWithoutBorders/pynwb/pull/1890)
49+
- Formally defined bands within `DecompositionSeries` as the neurodatatype `FrequencyBandsTable`. @mavaylon1 @rly [#2063](https://github.com/NeurodataWithoutBorders/pynwb/pull/2063)
50+
- Added new `DeviceModel` neurodata type to store device model information. @rly [#2088](https://github.com/NeurodataWithoutBorders/pynwb/pull/2088)
51+
- Deprecated `Device.model_name`, `Device.model_number`, and `Device.manufacturer` fields in favor of `DeviceModel`. @rly [#2088](https://github.com/NeurodataWithoutBorders/pynwb/pull/2088)
52+
- Added support for 2D `EventDetection.source_index` to indicate [time_index, channel_index]. @stephprince [#2091](https://github.com/NeurodataWithoutBorders/pynwb/pull/2091)
53+
- Made `EventDetection.times` optional. @stephprince [#2091](https://github.com/NeurodataWithoutBorders/pynwb/pull/2091)
54+
- Deprecated `EventDetection.times`. @stephprince [#2101](https://github.com/NeurodataWithoutBorders/pynwb/pull/2101)
1055
- Automatically add timezone information to timestamps reference time if no timezone information is specified. @stephprince [#2056](https://github.com/NeurodataWithoutBorders/pynwb/pull/2056)
1156
- Added option to disable typemap caching and updated type map cache location. @stephprince [#2057](https://github.com/NeurodataWithoutBorders/pynwb/pull/2057)
1257
- Added dictionary-like operations directly on `ProcessingModule` objects (e.g., `len(processing_module)`). @bendichter [#2020](https://github.com/NeurodataWithoutBorders/pynwb/pull/2020)
@@ -24,7 +69,8 @@
2469
- Fixed missing `IndexSeries.indexed_images`. @rly [#2074](https://github.com/NeurodataWithoutBorders/pynwb/pull/2074)
2570
- Fixed missing `__nwbfields__` and `_fieldsname` for `NWBData` and its subclasses. @rly [#2082](https://github.com/NeurodataWithoutBorders/pynwb/pull/2082)
2671
- Fixed caching of the type map when using HDMF 4.1.0. @rly [#2087](https://github.com/NeurodataWithoutBorders/pynwb/pull/2087)
27-
- Removed use of complex numbers in scratch tutorial because of incompatibilities with HDMF 4.1.0. @stephprince [#2090](https://github.com/NeurodataWithoutBorders/pynwb/pull/2090/)
72+
- Removed use of complex numbers in scratch tutorial because of incompatibilities with HDMF 4.1.0. @stephprince [#2090](https://github.com/NeurodataWithoutBorders/pynwb/pull/2090/)
73+
- Made `ImagingPlane.description` optional to conform with the NWB Schema. @rly [#2051](https://github.com/NeurodataWithoutBorders/pynwb/pull/2051)
2874

2975
### Documentation and tutorial enhancements
3076
- Added NWB AI assistant to the home page of the documentation. @magland [#2076](https://github.com/NeurodataWithoutBorders/pynwb/pull/2076)

README.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ Latest Release
1313
.. image:: https://anaconda.org/conda-forge/pynwb/badges/version.svg
1414
:target: https://anaconda.org/conda-forge/pynwb
1515

16+
.. image:: https://zenodo.org/badge/99273369.svg
17+
:target: https://doi.org/10.5281/zenodo.10582180
1618

1719
Overall Health
1820
==============
@@ -41,6 +43,9 @@ Overall Health
4143
.. image:: https://github.com/NeurodataWithoutBorders/pynwb/actions/workflows/deploy_release.yml/badge.svg
4244
:target: https://github.com/NeurodataWithoutBorders/pynwb/actions/workflows/deploy_release.yml
4345

46+
.. image:: https://codecov.io/gh/NeurodataWithoutBorders/pynwb/branch/dev/graph/badge.svg
47+
:target: https://codecov.io/gh/NeurodataWithoutBorders/pynwb
48+
4449
.. image:: https://readthedocs.org/projects/pynwb/badge/?version=latest
4550
:target: https://pynwb.readthedocs.io/en/latest/?badge=latest
4651
:alt: Documentation Status

docs/gallery/domain/ecephys.py

Lines changed: 21 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -80,15 +80,21 @@
8080
# The electrodes table references a required :py:class:`~pynwb.ecephys.ElectrodeGroup`, which is used to represent a
8181
# group of electrodes. Before creating an :py:class:`~pynwb.ecephys.ElectrodeGroup`, you must define a
8282
# :py:class:`~pynwb.device.Device` object using the method :py:meth:`.NWBFile.create_device`. The fields
83-
# ``description``, ``manufacturer``, ``model_number``, ``model_name``, and ``serial_number`` are optional, but
84-
# recommended.
83+
# ``description``, ``serial_number``, and ``model`` are optional, but recommended. The
84+
# :py:class:`~pynwb.device.DeviceModel` object stores information about the device model, which can be useful
85+
# when searching a set of NWB files or a data archive for all files that use a specific device model
86+
# (e.g., Neuropixels probe).
87+
device_model = nwbfile.create_device_model(
88+
name="Neurovoxels 0.99",
89+
manufacturer="Array Technologies",
90+
model_number="PRB_1_4_0480_123",
91+
description="A 12-channel array with 4 shanks and 3 channels per shank",
92+
)
8593
device = nwbfile.create_device(
8694
name="array",
8795
description="A 12-channel array with 4 shanks and 3 channels per shank",
88-
manufacturer="Array Technologies",
89-
model_number="PRB_1_4_0480_123",
90-
model_name="Neurovoxels 0.99",
9196
serial_number="1234567890",
97+
model=device_model,
9298
)
9399

94100
#######################
@@ -238,7 +244,7 @@
238244
lfp = LFP(electrical_series=lfp_electrical_series)
239245

240246
####################
241-
# LFP refers to data that has been low-pass filtered, typically below 300 Hz. This data may also be downsampled.
247+
# LFP refers to data that has been low-pass filtered, typically below 300 Hz. This data may also be downsampled.
242248
# Because it is filtered and potentially resampled, it is categorized as processed data.
243249
#
244250
# Create a processing module named ``"ecephys"`` and add the :py:class:`~pynwb.ecephys.LFP` object to it.
@@ -252,7 +258,7 @@
252258

253259
#######################
254260
# If your data is filtered for frequency ranges other than LFP — such as Gamma or Theta — you should store it in an
255-
# :py:class:`~pynwb.ecephys.ElectricalSeries` and encapsulate it within a
261+
# :py:class:`~pynwb.ecephys.ElectricalSeries` and encapsulate it within a
256262
# :py:class:`~pynwb.ecephys.FilteredEphys` object.
257263

258264
from pynwb.ecephys import FilteredEphys
@@ -272,21 +278,21 @@
272278
ecephys_module.add(filtered_ephys)
273279

274280
################################
275-
# In some cases, you may want to further process the LFP data and decompose the signal into different frequency bands
281+
# In some cases, you may want to further process the LFP data and decompose the signal into different frequency bands
276282
# to use for other downstream analyses. You can store the processed data from these spectral analyses using a
277283
# :py:class:`~pynwb.misc.DecompositionSeries` object. This object allows you to include metadata about the frequency
278-
# bands and metric used (e.g., power, phase, amplitude), as well as link the decomposed data to the original
284+
# bands and metric used (e.g., power, phase, amplitude), as well as link the decomposed data to the original
279285
# :py:class:`~pynwb.base.TimeSeries` signal the data was derived from.
280286

281287
#######################
282-
# .. note:: When adding data to :py:class:`~pynwb.misc.DecompositionSeries`, the ``data`` argument is assumed to be
288+
# .. note:: When adding data to :py:class:`~pynwb.misc.DecompositionSeries`, the ``data`` argument is assumed to be
283289
# 3D where the first dimension is time, the second dimension is channels, and the third dimension is bands.
284290

285291

286-
bands = dict(theta=(4.0, 12.0),
287-
beta=(12.0, 30.0),
292+
bands = dict(theta=(4.0, 12.0),
293+
beta=(12.0, 30.0),
288294
gamma=(30.0, 80.0)) # in Hz
289-
phase_data = np.random.randn(50, 12, len(bands)) # 50 samples, 12 channels, 3 frequency bands
295+
phase_data = np.random.randn(50, 12, len(bands)) # 50 samples, 12 channels, 3 frequency bands
290296

291297
decomp_series = DecompositionSeries(
292298
name="theta",
@@ -353,7 +359,7 @@
353359
# While the :py:class:`~pynwb.misc.Units` table is used to store spike times and waveform data for
354360
# spike-sorted, single-unit activity, you may also want to store spike times and waveform snippets of
355361
# unsorted spiking activity (e.g., multi-unit activity detected via threshold crossings during data acquisition).
356-
# This information can be stored using :py:class:`~pynwb.ecephys.SpikeEventSeries` objects.
362+
# This information can be stored using :py:class:`~pynwb.ecephys.SpikeEventSeries` objects.
357363

358364
spike_snippets = np.random.rand(40, 3, 30) # 40 events, 3 channels, 30 samples per event
359365
shank0 = nwbfile.create_electrode_table_region(
@@ -381,7 +387,7 @@
381387
name="threshold_events",
382388
detection_method="thresholding, 1.5 * std",
383389
source_electricalseries=raw_electrical_series,
384-
source_idx=[1000, 2000, 3000],
390+
source_idx=[[1000, 0], [2000, 4], [3000, 8]], # indicates the time and channel indices
385391
times=[.033, .066, .099],
386392
)
387393

0 commit comments

Comments
 (0)