NDR-python is a faithful Python port of NDR-matlab (Neuroscience Data Reader).
- Lead-Follow: MATLAB is the source of truth. Python mirrors it exactly.
- Bridge Contract: Each sub-package has an
ndr_matlab_python_bridge.yamldefining the function names, arguments, and return types. - Naming: Preserve MATLAB names exactly. Use
readchannels_epochsamples, notread_channels_epoch_samples.
ndr.reader.base— Abstract base class. All readers inherit from this.ndr.reader(wrapper) — High-level interface that delegates to a base reader.ndr.reader.intan_rhd,ndr.reader.axon_abf, etc. — Format-specific readers.
- Check the bridge YAML in the target package.
- If the function is missing, add it based on the MATLAB source.
- Record the MATLAB git hash in
matlab_last_sync_hash. - Implement the Python code.
- Run
blackandruff check --fixbefore committing. - Run
pytestto verify.
- Unit tests:
pytest tests/ - Symmetry tests:
pytest tests/symmetry/(excluded from default run)
- Python 3.10+
- NumPy for all numerical data
- Pydantic for input validation (
@validate_call)