Skip to content

4.0.0

Latest

Choose a tag to compare

@nwb-bot nwb-bot released this 30 Jun 00:02
497132b

Removed

  • Removed functionality that was deprecated with a "will be removed in PyNWB 4.0" notice. @rly #2210
    • ProcessingModule.add_container, get_container, add_data_interface, and get_data_interface. Use add and get instead.
    • The extensions argument of get_type_map, get_manager, and NWBHDF5IO. Load cached namespaces from the file or pass a prebuilt manager instead.
    • The notes argument and notes property of ScratchData. Use description instead.
    • The notes and table_description arguments of NWBFile.add_scratch. Use description instead.
    • The ic_electrodes argument of NWBFile. Use icephys_electrodes instead.
    • The paths argument of pynwb.validate. Use path and call validate once per file instead.
  • Made NWBFile.icephys_filtering read-only. Use IntracellularElectrode.filtering instead. The legacy /general/intracellular_ephys/filtering value is still read from older files. @rly #2210

Changed

  • Consolidated dependency declarations into pyproject.toml and removed the requirements.txt, requirements-dev.txt, requirements-opt.txt, requirements-doc.txt, and requirements-min.txt files. Added user-installable zarr and termset optional-dependency extras (e.g. pip install pynwb[zarr]), and declared development dependencies as PEP 735 [dependency-groups] (test, stream, docs). tox now installs dependencies via extras and dependency groups, with minimum-version testing using uv pip install --resolution lowest-direct. Install development dependencies with pip install --group test --group docs -e ".[zarr,termset]". @rly #2205
  • Deprecated NWBGroupSpec.add_group and NWBGroupSpec.add_dataset. Use NWBGroupSpec.set_group, NWBGroupSpec.set_dataset, or pass the group or dataset to the NWBGroupSpec constructor. @rly #2138
  • Fixed TimeSeries.get_timestamps() to handle numpy array timestamps when they are set. @pauladkisson #2181
  • Fixed Units.waveform_rate and Units.waveform_unit to also map to the sampling_rate and unit attributes of the waveforms column on write and read, so waveform sampling metadata round-trips for Units tables that contain only waveforms (without waveform_mean or waveform_sd). @ehennestad #2183
  • Added Python 3.14 support. @bendichter, @rly #2168
  • Bumped the minimum HDMF dependency to >=6.1.0 for pandas 3.0 compatibility. See the HDMF changelog for the full list of changes in HDMF 6.1.0. @rly #2171, #2208
  • Deprecated Python 3.9 support. (EOL was Oct 31, 2025) @bendichter #2141
  • Deprecated BehavioralEvents and AnnotationSeries in favor of using an EventsTable in NWBFile.events. Creating a new instance of either type now emits a UserWarning; reading existing files containing these types continues to work without warnings. @rly #2156

Added

  • Added optional source_description attribute to EventsTable for a short free-text label of where events originated (e.g., "Acquisition system", "Manual video review"). Added NWBFile.merge_events_tables() to merge a list of EventsTable objects into a single DataFrame sorted by timestamp with a source_events_table column. Added NWBFile.get_all_events() to merge all tables in NWBFile.events. @rly #2192
  • Added support for NWB Schema 2.10.0 (NWBEP001), which introduces the EventsTable, TimestampVectorData, and DurationVectorData neurodata types and a new events group on NWBFile for storing EventsTable instances. Use NWBFile.add_events_table() to add an EventsTable and NWBFile.get_events_table() to retrieve one. NWB Schema 2.10.0 also incorporates hdmf-common-schema 1.9.0, which adds the MeaningsTable neurodata type (re-exported via hdmf.common) and support for attaching one or more MeaningsTable instances to a DynamicTable to document the meanings of values in a column. See the NWB Schema release notes and the hdmf-common-schema release notes for the full list of changes. @rly #2156
  • Added support for HERD (HDMF External Resources Data Structure) as the external_resources field on NWBFile, enabling users to associate external resource annotations (e.g., ontology term mappings) with their NWB files. link_resources is inherited from HERDManager in hdmf. @mavaylon1, @rly #2111
  • NWBFile.get_external_resources() returns the file's existing HERD or creates and attaches a new empty one if the file does not have external resources yet, mirroring get_intracellular_recordings(). @rly #2200
  • Added get_starting_time() and get_duration() methods to TimeSeries to get the starting time and duration of the time series. @h-mayorquin #2146
  • Added get_starting_time() and get_duration() methods to TimeIntervals to get the earliest start time and total duration (span from earliest start to latest stop) of all intervals. @h-mayorquin #2146
  • Added get_starting_time() and get_duration() methods to Units to get the earliest spike time and total duration (span from earliest to latest spike) across all units. @h-mayorquin #2164
  • Added pandas 3.0 compatibility. NWBFile.add_scratch now accepts a pandas.Series or a pandas ExtensionArray (e.g., StringArray and ArrowStringArray) as data, which is normalized to numpy when constructing ScratchData. This relies on the coercion added in hdmf-dev/hdmf#1469 (HDMF 6.1.0), which also makes the inherited PyArrow-backed string columns from pandas 3 DataFrames work across TimeSeries subclasses, add_unit, add_electrode, and DynamicTable.from_dataframe. The pandas<3 cap has been lifted. @rly #2208

Fixed

  • Fixed ROS3 streaming and added an aws_region argument to validate so the AWS region can be passed through when validating a file opened with the ros3 driver. HDF5 2.1.0 (h5py 3.16.0) requires the AWS region to be specified when opening an S3 URL with the ros3 driver, so the ROS3 tests and the streaming tutorial now pass aws_region="us-east-2" (the region of the DANDI Archive S3 bucket). @rly #2201
  • Fixed reading legacy files where Device.model is a string containing / or : (e.g., "MFC_200/250-0.66_40mm"), which previously raised a ValueError. The string is now remapped to a read-only DeviceModel that preserves the original name, with a warning explaining that the file cannot be written or exported until a DeviceModel with a valid name is created. Writing or exporting such a DeviceModel raises a clear error instead of silently corrupting the file. @rly #2186
  • Fixed invalid CSS properties in documentation assistant toggle that prevented proper positioning on displays ≥1400px wide. @rly #2151

Documentation and tutorial enhancements

  • Added a tutorial on using HERD to annotate an NWB file with external resources and store it at /general/external_resources, plus a companion example showing how to annotate multiple NWB files streamed from a DANDI dandiset with a single HERD. @rly, @mavaylon1 #2200
  • Added pandas.ExtensionArray to nitpick_ignore so the Sphinx build does not fail on the unresolved cross-reference that HDMF's array_data docval macro renders for every type that accepts array data. @rly #2209
  • Added app.readthedocs.org/projects/pynwb/* to linkcheck_ignore to stop the Sphinx linkcheck CI job from intermittently failing when GitHub Actions runners get throttled by readthedocs. @h-mayorquin #2191
  • Added documentation for ExternalImage to the images tutorial. @h-mayorquin #2159
  • Fixed broken and redirecting links in documentation. @bendichter #2165
  • Added EventsTable examples to the NWB file basics and behavior tutorials. @rly #2156
  • Added example of setting Units.resolution in the ecephys tutorial. @h-mayorquin #2174