Skip to content

[Zarr-Support] Refactor nwbRead around HDF5 backend reader#796

Merged
ehennestad merged 78 commits intomainfrom
refactor-hdf5-backend-reader
Apr 13, 2026
Merged

[Zarr-Support] Refactor nwbRead around HDF5 backend reader#796
ehennestad merged 78 commits intomainfrom
refactor-hdf5-backend-reader

Conversation

@ehennestad
Copy link
Copy Markdown
Collaborator

@ehennestad ehennestad commented Mar 28, 2026

Summary

In order to support reading Zarr NWB files, this PR adds a backend reader abstraction and concrete HDF5 class to read HDF5 backed files, by extracting direct h5-library calls from nwbRead and parse helpers into the reader class.

Details

Included:

  • io.backend.base.Reader
  • io.backend.BackendFactory
  • io.backend.hdf5.HDF5Reader
  • minimal wiring in nwbRead, parseGroup, parseDataset, and parseAttributes
  • unit tests for the factory and HDF5 reader

ehennestad and others added 29 commits March 10, 2026 13:46
Extend the test helper to treat types.untyped.DataPipe like DataStub by calling load() on actualValue before comparing.
Replace the old SKIP_PYNWB_COMPATIBILITY_TEST_FOR_TUTORIALS env var with SKIP_PYNWB_TESTS across tests and nwbtest.m, and update +tests/nwbtest.default.env.
Update CI workflow matrix keys and usage in prepare_release.yml, run_tests.yml, and configurations/matlab_release_matrix_strategy.yml to use the new key (matrix.skip-pynwb-tests) and wire the MATLAB setenv accordingly.
Move conditional installation of pynwb into the workflows (install pynwb only when skip-pynwb-tests == '0') and remove the direct git+ dependency from +tests/requirements.txt (update comment to reflect conditional installs).
Also add TestTags = {'UsesPython'} to PyNWBIOTest.

These changes centralize the CI control of pynwb installation and standardize the skip variable name.
…nore-nwbinspector-subject-checks-in-tutorialtests
checking if this class attribute trips up docs build
Move TestTags to methods blocks. Check if that fixes issue with sphinx build of docs
…nore-nwbinspector-subject-checks-in-tutorialtests
Install pynwb and nwbinspector from PyPI stable releases in the main
test workflow so CI only fails due to matnwb regressions. Add a
separate weekly workflow that tests against the dev branches to catch
upstream incompatibilities early without blocking PRs.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Added more details in comments
Removed unused vars NWB_TEST_DEBUG, GITHUB_TOKEN
Added PYNWB_REPO_DIR
Replace custom venv/download/GitHub API infrastructure with a simple
approach: read tutorial files from PYNWB_REPO_DIR env var pointing to
a pre-cloned pynwb repo, and run them against the system Python. The
CI workflows are now responsible for cloning the repo and setting the
env var. TestTags = {'UsesPython'} added so the tag selector in the
dev workflow picks up these tests, and SKIP_PYNWB_TESTS correctly
excludes them on older MATLAB releases.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Covers prerequisites, running tests via nwbtest() and the MATLAB unit
testing framework, Python dependency setup, environment variable
configuration, and test authoring conventions.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
actions/checkout requires path to be within the workspace directory.
Use path: pynwb-repo (inside workspace) instead of ../pynwb-repo.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Suppress output
Suppress warning that happens due to wrong values in the file's version attribute in the source schemas for v 2.2.0 and 2.6.0
Added section about setting up dynamically loaded filters
Move test tags to methods block, as testtags in classdef breaks the sphinx/docs build
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ehennestad ehennestad marked this pull request as draft March 28, 2026 19:22
@ehennestad ehennestad force-pushed the refactor-hdf5-backend-reader branch from ec69bd6 to 08662b8 Compare March 31, 2026 12:07
…taset

Codex removed some relevant comments
Carry over some changes from refactored io.parseDataset
Keep comments in readAttributeValue
@ehennestad ehennestad requested a review from bendichter March 31, 2026 13:27
@ehennestad ehennestad changed the base branch from refactor-io-parse-dataset to main April 1, 2026 14:23
@ehennestad ehennestad changed the title Refactor nwbRead around HDF5 backend reader [Zarr-Support] Refactor nwbRead around HDF5 backend reader Apr 6, 2026
@ehennestad ehennestad marked this pull request as ready for review April 7, 2026 20:15
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

❌ Patch coverage is 93.38235% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.51%. Comparing base (6148385) to head (4387700).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
+io/+backend/+hdf5/HDF5Reader.m 91.02% 7 Missing ⚠️
+io/+backend/BackendFactory.m 92.30% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #796      +/-   ##
==========================================
+ Coverage   95.49%   95.51%   +0.02%     
==========================================
  Files         192      195       +3     
  Lines        7097     7151      +54     
==========================================
+ Hits         6777     6830      +53     
- Misses        320      321       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ehennestad ehennestad enabled auto-merge April 7, 2026 20:46
Add note on implementation detail of not using abstract class explicitly
@ehennestad ehennestad changed the title [Zarr-Support] Refactor nwbRead around HDF5 backend reader [Zarr-Support] Refactor nwbRead around HDF5 backend reader Apr 8, 2026
@ehennestad ehennestad added this pull request to the merge queue Apr 13, 2026
Merged via the queue into main with commit fef2bac Apr 13, 2026
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants