Skip to content

[Zarr-Support] Introduce LazyArray abstraction for HDF5-backed DataStub#800

Merged
ehennestad merged 95 commits intomainfrom
zarr-support/2-add-lazy-array-generalization
Apr 15, 2026
Merged

[Zarr-Support] Introduce LazyArray abstraction for HDF5-backed DataStub#800
ehennestad merged 95 commits intomainfrom
zarr-support/2-add-lazy-array-generalization

Conversation

@ehennestad
Copy link
Copy Markdown
Collaborator

@ehennestad ehennestad commented Mar 31, 2026

Summary

Create a LazyArray base type and a HDF5LazyArray backend for the DataStub class. This moves all h5 specific code out of the DataStub and prepares for adding support to read Zarr files .

What Changed

  • add io.backend.base.LazyArray
  • add io.backend.hdf5.HDF5LazyArray
  • refactor types.untyped.DataStub to delegate metadata lookup and lazy loads through a backend lazy array
  • update io.backend.hdf5.HDF5Reader to wrap non-scalar non-empty datasets in DataStub backed by HDF5LazyArray
  • extend backend tests and add focused HDF5LazyArray coverage

ehennestad and others added 30 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 changed the title [codex] Introduce LazyArray abstraction for HDF5-backed DataStub [Zarr-Support] Introduce LazyArray abstraction for HDF5-backed DataStub Apr 8, 2026
@ehennestad ehennestad marked this pull request as ready for review April 9, 2026 18:37
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 9, 2026

Codecov Report

❌ Patch coverage is 92.46862% with 18 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.37%. Comparing base (2b4425e) to head (56616ff).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
+io/+backend/BackendFactory.m 47.05% 9 Missing ⚠️
+io/+backend/+hdf5/@HDF5LazyArray/load_mat_style.m 94.53% 7 Missing ⚠️
+io/+backend/+base/LazyArray.m 96.96% 1 Missing ⚠️
+io/+backend/+hdf5/@HDF5LazyArray/load_h5_style.m 96.15% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #800      +/-   ##
==========================================
- Coverage   95.46%   95.37%   -0.09%     
==========================================
  Files         195      199       +4     
  Lines        7148     7205      +57     
==========================================
+ Hits         6824     6872      +48     
- Misses        324      333       +9     

☔ 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.

@bendichter
Copy link
Copy Markdown
Contributor

bendichter commented Apr 13, 2026

Have you thought about the dimension ordering issue? I think Zarr will be in C order, not F order

@ehennestad ehennestad changed the base branch from refactor-hdf5-backend-reader to main April 13, 2026 14:43
@ehennestad ehennestad enabled auto-merge April 13, 2026 16:02
@ehennestad ehennestad requested a review from bendichter April 15, 2026 14:36
@ehennestad ehennestad added this pull request to the merge queue Apr 15, 2026
Merged via the queue into main with commit 36bc56d Apr 15, 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