Repository navigation
feat: Tier-1 records.json emitter (#615) - #32
Merged
Merged
Conversation
emit_records.py: stdlib-only, git-walk emitter producing a JSON array of neuroschema v0.3.0 `record` docs (one per primary signal file). Mirrors emit_manifest.py: pure git plumbing, no annex download, no MNE/biosig. Derives modality (from BIDS suffix), entities/datatype/suffix/extension (from the relpath), signal_summary nchans + channel_type_counts (from channels.tsv, authoritative), recording_duration/sampling_frequency (from the sidecar resolved by BIDS inheritance via git cat-file). recording_duration/ntimes are null when the sidecar lacks RecordingDuration; Tier-2 (biosigIO/zarr backfill) is a marked follow-up. Validates against the released neuroschema v0.3.0. Includes test_emit_records.py (real git fixtures, no mocks; 24 tests) + generate-records.yml (mirrors generate-manifest.yml; emit + neuroschema-from-git-tag validate are real, the S3 upload/.nemar commit-back are a marked skeleton) + test-emit-records.yml. Addresses review: install neuroschema from the git tag (not PyPI), map nirs->NIRS so .snirf isn't silently skipped, exclude sourcedata/, header-only channels.tsv -> null nchans (so the *ChannelCount fallback fires), drop unused annex helpers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First piece of nemarOrg/nemar-cli#615. The Tier-1 git-walk emitter that produces
records.json(a JSON array of neuroschema v0.3.0recorddocs, one per primary signal file).What
scripts/emit_records.py— stdlib-only, mirrorsemit_manifest.py(pure git plumbing, no annex download, no MNE/biosigIO; nemar-cli stays Python-free). Per primary file: modality (BIDS suffix), entities/datatype/suffix/extension (relpath),signal_summarynchans + channel_type_counts (fromchannels.tsv, authoritative),recording_duration/sampling_frequency(sidecar resolved by BIDS inheritance viagit cat-file). Validates against the released neuroschema v0.3.0 (FK fix letsnm*/on*pass).scripts/test_emit_records.py— real git fixtures, no mocks; 24 tests..github/workflows/generate-records.yml— mirrorsgenerate-manifest.yml; emit + validate (neuroschema from the git tag, not PyPI) are real; S3 upload toversion/v<X.Y.Z>-records.json+.nemar/records.jsoncommit-back are a marked skeleton pending the route contract.Tier-1 scope (follow-ups)
recording_duration/ntimesarenullwhen the sidecar omitsRecordingDuration(esp. MEG). Tier-2 backfills those from the already-converted Zarr stores / biosigIO (marked TODO).GET /<id>/<version>/records.jsonroute + S3 wiring + committed.nemar/records.jsonland in a follow-up.Review addressed
neuroschema-from-git-tag (PyPI 404),
nirs->NIRS(no more silent.snirfskip), excludesourcedata/, header-onlychannels.tsv-> null nchans, dropped unused annex helpers.Tested: 24 tests pass; ruff clean; real-fixture emit validates with 0 errors.