aqnwb 0.1.0
Loading...
Searching...
No Matches
NWB Schema 🧠

The NWB file format is formally described by the NWB Format Specification Schema. The data organization of NWB files and the core NWB format is described by these nwb-schema format specification documents.

Generating the schema header files

AqNWB is linked to a specific version of the nwb-schema, and the schema version is written to the nwb_version field of the NWB File during acquisition. The full specification documentation for that schema version is also cached in the specifications group of the NWB File to facilitate compatibility with other NWB-related software.

The contents of the specifications group are defined using the header files in the spec subfolder, which are in turn generated from the nwb-schema and hdmf-common-schema files. To regenerate these header files, it is recommended to use the script:

bash resources/utils/generate_nwb_schema_headers.sh

This script will:

  • Clone the latest NWB and HDMF schema repositories into a temporary directory
  • Run resources/utils/generate_spec_files.py for both the NWB core and HDMF common schemas
  • Copy the generated C++ header files to src/spec
  • Clean up all temporary files automatically

Optional environment variables:

  • PYTHON: Python interpreter to use (default: python)
  • NWB_REPO: URL of the NWB schema git repository
  • HDMF_REPO: URL of the HDMF common schema git repository

Example:

PYTHON=python3 bash resources/utils/generate_nwb_schema_headers.sh

For use with extensions and other advanced or custom use cases, developers may still run resources/utils/generate_spec_files.py directly.

Updating the schema

Currently, the version of the schema being used for development is fixed and stored in the /resources/schema folder. Updating to a newer version of the schema requires:

  • Regeneration of the spec header files via resources/utils/generate_spec_files.py
  • Update of existing Container classes and unit tests in AqNWB to match changes in the new schema compared to the previous schema
  • Successful completion of all unit-test and round-trip testing with PyNWB and MatNWB