Skip to content

[Zarr-Support] Route nwbExport through HDF5 backend writer#801

Merged
ehennestad merged 104 commits intomainfrom
zarr-support/3-backend-writer
Apr 21, 2026
Merged

[Zarr-Support] Route nwbExport through HDF5 backend writer#801
ehennestad merged 104 commits intomainfrom
zarr-support/3-backend-writer

Conversation

@ehennestad
Copy link
Copy Markdown
Collaborator

@ehennestad ehennestad commented Mar 31, 2026

Motivation

This change decouples generated export code from raw HDF5 file identifiers by routing export operations through a backend writer object in order to easier facilitate export to other formats, i.e Zarr.

The generated export methods now accept a writer and call writer methods instead of calling io.writeGroup, io.writeDataset, and io.writeAttribute directly. The handwritten export helpers on the same path were updated to normalize either a writer object or legacy file id input, and the HDF5 path now uses a thin HDF5Writer adapter so behavior stays functionally identical for existing HDF5 export.

This keeps the scope limited to the export path while removing another HDF5-hardcoded seam from the architecture.

How to test the behavior?

addpath(genpath('.'));
results = runtests({'tests.unit.nwbExportTest', 'tests.unit.dataPipeTest', 'tests.unit.linkTest', 'tests.unit.io.WriteTest'});
assertSuccess(results);

Checklist

  • Have you ensured the PR description clearly describes the problem and solutions?
  • Have you checked to ensure that there aren't other open or previously closed Pull Requests for the same change?
  • If this PR fixes an issue, is the first line of the PR description fix #XX where XX is the issue number?

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>
Add note on implementation detail of not using abstract class explicitly
@ehennestad ehennestad changed the title [codex] Route generated export through backend writer [Zarr-Support] Route generated export through backend writer Apr 8, 2026
@ehennestad ehennestad changed the title [Zarr-Support] Route generated export through backend writer [Zarr-Support] Route nwbExport through backend writer Apr 8, 2026
@ehennestad ehennestad changed the title [Zarr-Support] Route nwbExport through backend writer [Zarr-Support] Route nwbExport through HDF5 backend writer Apr 8, 2026
@ehennestad ehennestad changed the base branch from zarr-support/2-add-lazy-array-generalization to main April 13, 2026 16:01
@ehennestad ehennestad marked this pull request as ready for review April 13, 2026 16:02
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 13, 2026

Codecov Report

❌ Patch coverage is 90.90909% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.38%. Comparing base (19239e8) to head (8234daa).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
+io/+backend/BackendFactory.m 80.95% 4 Missing ⚠️
+io/+backend/+base/Writer.m 82.35% 3 Missing ⚠️
+io/+backend/+hdf5/HDF5Writer.m 93.33% 2 Missing ⚠️
+types/+untyped/ObjectView.m 0.00% 2 Missing ⚠️
+types/+untyped/ExternalLink.m 80.00% 1 Missing ⚠️
+types/+untyped/Set.m 75.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #801      +/-   ##
==========================================
- Coverage   95.44%   95.38%   -0.06%     
==========================================
  Files         203      205       +2     
  Lines        7261     7323      +62     
==========================================
+ Hits         6930     6985      +55     
- Misses        331      338       +7     

☔ 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 21, 2026 13:37
@ehennestad ehennestad added this pull request to the merge queue Apr 21, 2026
Merged via the queue into main with commit 4715b87 Apr 21, 2026
19 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