Skip to content

Add MATLAB-Python bridge documentation and porting instructions#22

Merged
stevevanhooser merged 3 commits intomainfrom
claude/sync-did-python-matlab-5Wmbq
Apr 13, 2026
Merged

Add MATLAB-Python bridge documentation and porting instructions#22
stevevanhooser merged 3 commits intomainfrom
claude/sync-did-python-matlab-5Wmbq

Conversation

@stevevanhooser
Copy link
Copy Markdown
Contributor

Summary

This PR introduces comprehensive YAML-based bridge documentation that defines the contract between DID-MATLAB and DID-Python implementations, along with detailed porting instructions for keeping the two codebases synchronized.

Key Changes

  • Four bridge YAML files defining the mapping between MATLAB and Python implementations:

    • did_matlab_python_bridge.yaml — Core classes (database, document, query, ido, documentservice, binarydoc)
    • did_matlab_python_bridge_implementations.yaml — Implementation classes (sqlitedb, doc2sql, binarydoc_matfid)
    • did_matlab_python_bridge_file.yaml — File I/O classes and utilities (fileobj, readonly_fileobj, binaryTable)
    • did_matlab_python_bridge_util.yaml — Utility functions (databaseSummary, compareDatabaseSummary, graph functions, datastructures)
  • PORTING_INSTRUCTIONS.md — Complete guide for developers on:

    • How to check for drift between MATLAB and Python using git commit hashes
    • Step-by-step process for porting MATLAB changes to Python
    • Naming and type conversion conventions (camelCase→snake_case, struct→dict, cell→list, etc.)
    • How to update bridge YAML files after porting
    • How to run symmetry tests to verify cross-language compatibility

Notable Implementation Details

  • Each bridge entry includes matlab_last_sync_hash to enable drift detection via git log <hash>..HEAD
  • Properties and methods are documented with type mappings (MATLAB types → Python types)
  • decision_log fields track synchronization dates and rationale for deviations
  • out_of_sync flags identify known divergences (e.g., MATLAB's recent websave→ndi.cloud.api.files.getFile change)
  • Bulk drift-checking script provided in porting instructions for monitoring all bridge files at once
  • Comprehensive field reference table for bridge YAML structure

This documentation enables systematic tracking of MATLAB-Python parity and provides a clear process for maintaining synchronization as both codebases evolve.

https://claude.ai/code/session_015g95pQvxDUnTWxHYmTnreG

claude added 3 commits April 13, 2026 00:34
Introduce four bridge YAML files (following NDI-python pattern) that map
every DID-matlab source file to its Python counterpart, tracking sync
status via matlab_last_sync_hash. Also add PORTING_INSTRUCTIONS.md with
drift-check commands, porting conventions, and current sync status.

All recent MATLAB changes (binary-mode fixes, fread/fwrite updates) were
verified to already be handled correctly by Python's Fileobj.fopen()
which appends 'b' to mode strings automatically.

https://claude.ai/code/session_015g95pQvxDUnTWxHYmTnreG
DID-matlab moved symmetry tests to tests_symmetry/ in commit b6a3a05,
but DID-python's symmetry.yml still referenced DID-matlab/tests. This
caused "Unable to find the did.symmetry.makeArtifacts namespace" errors.

https://claude.ai/code/session_015g95pQvxDUnTWxHYmTnreG
The symmetry tests depend on did.test.fixture.PathConstantFixture which
lives in DID-matlab/tests/. Need both tests/ (for fixtures) and
tests_symmetry/ (for symmetry test packages) on the MATLAB path,
matching DID-matlab's own test-symmetry.yml workflow.

https://claude.ai/code/session_015g95pQvxDUnTWxHYmTnreG
@stevevanhooser stevevanhooser merged commit 1b1491f into main Apr 13, 2026
5 checks passed
@stevevanhooser stevevanhooser deleted the claude/sync-did-python-matlab-5Wmbq branch April 13, 2026 01:17
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