Align Python API with MATLAB naming conventions for session and dataset#23
Merged
Merged
Conversation
…match MATLAB Create ndi_matlab_python_bridge.yaml contract files for src/ndi/dataset/ and src/ndi/session/ per the bridge protocol defined in AGENTS.md. Rename all Pythonized method names back to their exact MATLAB equivalents: - Dataset: delete_ingested_session -> deleteIngestedSession - DirSession: delete_session_data_structures -> deleteSessionDataStructures - SessionTable: get_session_table -> getsessiontable, get_session_path -> getsessionpath, add_entry -> addtableentry, remove_entry -> removetableentry, check_table -> checktable, is_valid_table -> isvalidtable, backup -> backupsessiontable, backup_file_list -> backupfilelist, clear -> clearsessiontable, local_table_filename -> localtablefilename, _write_table -> _writesessiontable All test files updated to use the new method names. https://claude.ai/code/session_01VJENBg37bS8hwtJ3oDbwYu
…aset
- Session.unique_reference_string: deprecated method returning
'{reference}_{identifier}', issues DeprecationWarning per MATLAB
- Session.isIngestedInDataset: searches for session_in_a_dataset docs
with is_linked=0 to check if session is ingested in a dataset
- Session.findexpobj: searches DAQ systems and probes by name/class
- DatasetDir.dataset_erase (static): removes .ndi directory from dataset
- Dataset.database_existbinarydoc: delegates to session, was present in
MATLAB but missing from Python Dataset class
Bridge YAML files updated to remove not_yet_ported status.
https://claude.ai/code/session_01VJENBg37bS8hwtJ3oDbwYu
Create ndi_matlab_python_bridge.yaml for all cloud subpackages: - src/ndi/cloud/ (root): auth, orchestration, download, upload, filehandler, internal - src/ndi/cloud/api/: datasets, documents, files, users, compute - src/ndi/cloud/sync/: mode, operations, index - src/ndi/cloud/admin/: doi, crossref All Python function names already match MATLAB exactly — no renames needed. Documents not-yet-ported MATLAB functions and Python-only extensions. https://claude.ai/code/session_01VJENBg37bS8hwtJ3oDbwYu
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 establishes a formal MATLAB-Python bridge contract for the
ndi.sessionandndi.datasetnamespaces, renaming Python methods to match MATLAB's naming conventions exactly. This ensures API consistency across both languages and improves maintainability.Key Changes
New Bridge Documentation
src/ndi/session/ndi_matlab_python_bridge.yaml— comprehensive contract documenting all session classes, methods, properties, and their MATLAB equivalentssrc/ndi/dataset/ndi_matlab_python_bridge.yaml— comprehensive contract for dataset classes and methodsSession API Renames
get_session_table()→getsessiontable()get_session_path()→getsessionpath()add_entry()→addtableentry()remove_entry()→removetableentry()check_table()→checktable()is_valid_table()→isvalidtable()backup()→backupsessiontable()backup_file_list()→backupfilelist()clear()→clearsessiontable()local_table_filename()→localtablefilename()_write_table()→_writesessiontable()delete_session_data_structures()→deleteSessionDataStructures()Dataset API Renames
delete_ingested_session()→deleteIngestedSession()New Methods Added
Session.unique_reference_string()— deprecated method that wrapsid()with DeprecationWarningSession.isIngestedInDataset()— checks if session is ingested (not just linked) in a datasetSession.findexpobj()— searches for objects by name and class nameDataset.database_existbinarydoc()— checks if binary document file existsTest Updates
getsessiontable(),addtableentry(),deleteIngestedSession(), etc.Implementation Details
DeprecationWarningto guide users to replacementshttps://claude.ai/code/session_01VJENBg37bS8hwtJ3oDbwYu