|
| 1 | +# ndi_matlab_python_bridge.yaml — src/ndi/common/ |
| 2 | +# The Primary Contract for the ndi.common namespace. |
| 3 | + |
| 4 | +project_metadata: |
| 5 | + bridge_version: "1.1" |
| 6 | + naming_policy: "Strict MATLAB Mirror" |
| 7 | + indexing_policy: "Semantic Parity (1-based for user concepts, 0-based for internal data)" |
| 8 | + |
| 9 | +# ========================================================================= |
| 10 | +# Standalone functions |
| 11 | +# ========================================================================= |
| 12 | +functions: |
| 13 | + |
| 14 | + - name: timestamp |
| 15 | + type: function |
| 16 | + matlab_path: null |
| 17 | + python_path: "ndi/common/__init__.py" |
| 18 | + input_arguments: [] |
| 19 | + output_arguments: |
| 20 | + - name: ts |
| 21 | + type_python: "str" |
| 22 | + decision_log: > |
| 23 | + Python-specific utility. No direct MATLAB equivalent. |
| 24 | + Returns ISO 8601 timestamp in UTC. |
| 25 | +
|
| 26 | + - name: getLogger |
| 27 | + type: function |
| 28 | + matlab_path: "+ndi/+common/getLogger.m" |
| 29 | + python_path: "ndi/common/__init__.py" |
| 30 | + input_arguments: |
| 31 | + - name: name |
| 32 | + type_matlab: "char" |
| 33 | + type_python: "str" |
| 34 | + default: "'ndi'" |
| 35 | + output_arguments: |
| 36 | + - name: logger |
| 37 | + type_python: "logging.Logger" |
| 38 | + decision_log: "Exact match." |
| 39 | + |
| 40 | + - name: getCache |
| 41 | + type: function |
| 42 | + matlab_path: "+ndi/+common/getCache.m" |
| 43 | + python_path: "ndi/common/__init__.py" |
| 44 | + input_arguments: [] |
| 45 | + output_arguments: |
| 46 | + - name: cache |
| 47 | + type_python: "Cache" |
| 48 | + decision_log: "Exact match. Returns a global singleton." |
| 49 | + |
| 50 | + - name: getDatabaseHierarchy |
| 51 | + type: function |
| 52 | + matlab_path: "+ndi/+common/getDatabaseHierarchy.m" |
| 53 | + python_path: "ndi/common/__init__.py" |
| 54 | + input_arguments: [] |
| 55 | + output_arguments: |
| 56 | + - name: hierarchy |
| 57 | + type_python: "dict[str, Any]" |
| 58 | + decision_log: > |
| 59 | + Exact match. Reads document definitions from ndi_common/database_documents. |
| 60 | + Result is cached after first call. |
| 61 | +
|
| 62 | + - name: assertDIDInstalled |
| 63 | + type: function |
| 64 | + matlab_path: "+ndi/+common/assertDIDInstalled.m" |
| 65 | + python_path: "ndi/common/__init__.py" |
| 66 | + input_arguments: [] |
| 67 | + output_arguments: [] |
| 68 | + decision_log: > |
| 69 | + Exact match. Raises ImportError if 'did' package not installed. |
| 70 | + MATLAB equivalent raises error if DID toolbox is missing. |
| 71 | +
|
| 72 | +# ========================================================================= |
| 73 | +# Classes |
| 74 | +# ========================================================================= |
| 75 | +classes: |
| 76 | + |
| 77 | + # ========================================================================= |
| 78 | + # ndi.common.PathConstants |
| 79 | + # ========================================================================= |
| 80 | + - name: PathConstants |
| 81 | + type: class |
| 82 | + matlab_path: "+ndi/+common/PathConstants.m" |
| 83 | + python_path: "ndi/common/__init__.py" |
| 84 | + python_class: "PathConstants" |
| 85 | + |
| 86 | + properties: |
| 87 | + - name: NDI_ROOT |
| 88 | + type_matlab: "char" |
| 89 | + type_python: "Path" |
| 90 | + access: "class property (read-only)" |
| 91 | + decision_log: "Exact match. Python uses pathlib.Path." |
| 92 | + |
| 93 | + - name: COMMON_FOLDER |
| 94 | + type_matlab: "char" |
| 95 | + type_python: "Path" |
| 96 | + access: "class property (read-only)" |
| 97 | + decision_log: "Exact match. Python uses pathlib.Path." |
| 98 | + |
| 99 | + - name: DOCUMENT_PATH |
| 100 | + type_matlab: "char" |
| 101 | + type_python: "Path" |
| 102 | + access: "class property (read-only)" |
| 103 | + decision_log: "Exact match. Python uses pathlib.Path." |
| 104 | + |
| 105 | + - name: SCHEMA_PATH |
| 106 | + type_matlab: "char" |
| 107 | + type_python: "Path" |
| 108 | + access: "class property (read-only)" |
| 109 | + decision_log: "Exact match. Python uses pathlib.Path." |
| 110 | + |
| 111 | + methods: |
| 112 | + - name: set_paths |
| 113 | + kind: classmethod |
| 114 | + input_arguments: |
| 115 | + - name: ndi_root |
| 116 | + type_python: "Path | None" |
| 117 | + default: "None" |
| 118 | + - name: common_folder |
| 119 | + type_python: "Path | None" |
| 120 | + default: "None" |
| 121 | + - name: document_path |
| 122 | + type_python: "Path | None" |
| 123 | + default: "None" |
| 124 | + - name: schema_path |
| 125 | + type_python: "Path | None" |
| 126 | + default: "None" |
| 127 | + output_arguments: [] |
| 128 | + decision_log: > |
| 129 | + Python-specific method for programmatic path overrides. |
| 130 | + MATLAB uses environment variables or property assignment. |
0 commit comments