Add Python symmetry tests for ingested DAQ sessions#42
Merged
Conversation
Mirror the MATLAB symmetry tests for session ingestion artifacts: - ingestionIntan: native Intan reader with .rhd data - ingestionIntanNDR: NDR wrapper reader with Intan .rhd data - ingestionAxonNDR: NDR wrapper reader with Axon .abf data Each test type has both makeArtifacts (generate) and readArtifacts (verify) halves. makeArtifacts tests skip when example data is not available; readArtifacts tests skip when artifacts don't exist. Shared helpers in _ingestion_helpers.py handle data discovery and session setup. https://claude.ai/code/session_01DqZDq59zdpbunYovuPKahY
Adds `query = ndi_query` in __init__.py so that `ndi.query('','isa','base')`
works directly, matching MATLAB conventions. All existing import patterns
(`from ndi.query import ndi_query`) continue to work unchanged.
https://claude.ai/code/session_01DqZDq59zdpbunYovuPKahY
When reconstructing objects from documents (filenavigator, daqreader, metadatareader, subject), `self.identifier = base_id` set a plain attribute instead of updating `self._id` which is what `ndi_ido.id` reads. This caused freshly generated IDs to be used in database queries (e.g. find_ingested_documents) instead of the stored document IDs, making epochfiles_ingested lookups fail silently. https://claude.ai/code/session_01DqZDq59zdpbunYovuPKahY
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.
Summary
This PR adds comprehensive Python symmetry tests for ingested DAQ sessions, mirroring the existing MATLAB test suite. The changes enable cross-language validation of session ingestion workflows for both Intan and Axon data formats using native and NDR reader implementations.
Key Changes
New helper module (
_ingestion_helpers.py): Provides shared utilities for ingestion-based tests_find_intan_rhd()and_find_axon_abf(): Locate example data files from multiple well-known locations (environment variables, CI layout, home directory, package resources)setup_intan_session()andsetup_axon_session(): Set up session directories with real DAQ data and required epochprobemap filesdelete_raw_files(): Clean up raw data files after ingestion, keeping only the.ndidatabase (mirrors MATLAB behavior)Make artifacts tests (3 new test classes):
TestIngestionIntan: Creates and exports artifacts for native Intan reader ingestionTestIngestionIntanNDR: Creates and exports artifacts for Intan data via NDR wrapper readerTestIngestionAxonNDR: Creates and exports artifacts for Axon ABF data via NDR wrapper readerRead artifacts tests (3 new test classes):
TestIngestionIntan,TestIngestionIntanNDR,TestIngestionAxonNDR: Parameterized tests that load artifacts from either MATLAB or Python sourcesNotable Implementation Details
https://claude.ai/code/session_01DqZDq59zdpbunYovuPKahY