Repository navigation
Bugfix/hashing and mf4 saving - #215
AndraeCarotta wants to merge 14 commits into
Conversation
358a194 to
35823c5
Compare
d25e59b to
2c5cfb1
Compare
1807288 to
50c6aea
Compare
ffdd925 to
cc7ea36
Compare
cc7ea36 to
fc67499
Compare
e42a133 to
b63f158
Compare
Jonny3
left a comment
There was a problem hiding this comment.
good but lets clean a little.
| """Return the source hashes in this object's data dependency tree. | ||
|
|
||
| Args: | ||
| cache (dict[str, AresDataInterface]): Cache used to resolve data dependencies. |
There was a problem hiding this comment.
| cache (dict[str, AresDataInterface]): Cache used to resolve data dependencies. | |
| cache (Mapping[str, AresDataInterface]): Cache used to resolve data dependencies. |
There was a problem hiding this comment.
and I guess MApping is a list
| logger.warning( | ||
| f"Unequal signal length detected for '{signal.label}': " | ||
| f"got {signal.shape[0]}, expected {expected_length}." | ||
| ) |
There was a problem hiding this comment.
break loop after detection of unequal shape?
| @typechecked | ||
| def get_origin_hashes( | ||
| self, | ||
| cache: Mapping[str, "AresDataInterface"], |
There was a problem hiding this comment.
in Class itself it is:
cache: ClassVar[dict[str, "AresDataInterface"]] = {}
There was a problem hiding this comment.
see comments ares-data-interface
| visited.add(self.hash) | ||
|
|
||
| dependencies = [ | ||
| cache[dependency] for dependency in self.dependencies if dependency in cache |
There was a problem hiding this comment.
maybe we should think about claling depedency_hahes
| origin_hashes = instance.get_origin_hashes( | ||
| cast(Mapping[str, AresDataInterface], cache) | ||
| ) | ||
| else: |
There was a problem hiding this comment.
even with tpying i'd like to write
elif isinstance(instance, AresParamInterface) instead of else. and for security add an else: with logger.error() if we want.
| if instance is None: | ||
| continue | ||
| if isinstance(instance, AresDataInterface): | ||
| origin_hashes = instance.get_origin_hashes( |
There was a problem hiding this comment.
| origin_hashes = instance.get_origin_hashes( | |
| origin_hashes: set[str] = instance.get_origin_hashes( |
| continue | ||
| if isinstance(instance, AresDataInterface): | ||
| origin_hashes = instance.get_origin_hashes( | ||
| cast(Mapping[str, AresDataInterface], cache) |
There was a problem hiding this comment.
please also here consider the datatype, ClassVAr vs Mapping
| origin_hashes = instance.get_origin_hashes( | ||
| cast(Mapping[str, AresParamInterface], cache) | ||
| ) | ||
| for origin_hash in origin_hashes: |
There was a problem hiding this comment.
setdefault is not necessary here or we should simplify. "origin_hashes" is a set so it's unique. so default is not necessary since no other same value can exist.
| if combination_list not in combinations: | ||
| combinations.append(combination_list) | ||
|
|
||
| return combinations |
There was a problem hiding this comment.
have to step in this but looks okay!
fe0ece0 to
64052be
Compare
1161a1d to
7a6a727
Compare
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical defects can corrupt merge ancestry, truncate preferred signals, and mix channel values across sources.
7 open issues
Stack duplicate channel arrays separately by source · New Preserve input ancestry when reusing cached merged content · New Resolve duplicate sources before resampling to common overlap · New Apply read-element resampling options during ingestion · New Raise explicit ValueErrors for invalid shapes and dtypes · New Handle empty timebases when writing MF4 channels · New Avoid loading all samples when retrieving source names · New
What changed in this PR
This PR updates ARES data merging and MF4 persistence to preserve duplicate
signals and separate timebases, while adding source-aware selection for
simulation inputs.
Changes:
- Adds common-source and Cartesian merge modes, duplicate-data controls, and
dependency-origin traversal. - Preserves duplicate MF4 channels and groups writes by source and timebase.
- Adds regression tests, workflow examples, and documentation for the new behavior.
| File | Description |
|---|---|
test/utils/test_select_signals_by_source_priority.py |
Tests source ordering and fallback selection. |
test/pydantic_models/test_workflow_model.py |
Tests merge options and runtime source-priority reset. |
test/plugins/test_merge.py |
Tests combinations, precedence, and duplicate retention. |
test/interfaces/parameter/test_ares_parameter_interface.py |
Updates duplicate-filter method references. |
test/interfaces/data/test_mf4_handler.py |
Tests separate timebases and duplicate-channel round trips. |
test/interfaces/data/test_ares_signal.py |
Adds timestamp casting and shape-validation tests. |
test/interfaces/data/test_ares_data_interface.py |
Updates interface tests and adds origin-matching coverage. |
README.md |
Documents merge modes and duplicate-data controls. |
examples/workflow/parameter_interface/param_merge.wf.json |
Demonstrates explicit parameter merge modes. |
examples/workflow/data_interface/data_merge.wf.json |
Demonstrates source-aware merging and duplicate precedence. |
examples/Makefile |
Builds the simulation unit required by the merge example. |
examples/data/data_example_7_mf4.py |
Generates input and reference-output signals. |
examples/data/data_example_5_6mf4.py |
Generates multidimensional MF4 example data. |
ares/utils/select_signals_by_source_priority.py |
Adds duplicate-label selection by source priority. |
ares/pydantic_models/workflow_model.py |
Adds merge configuration and runtime source priority. |
ares/plugins/simunit.py |
Selects input sources and warns on missing simulation results. |
ares/plugins/merge.py |
Implements merge strategies and duplicate handling. |
ares/interface/parameter/jsonparam_handler.py |
Updates duplicate filtering and a docstring type. |
ares/interface/parameter/dcm_handler.py |
Uses the renamed duplicate filter. |
ares/interface/parameter/ares_parameter_interface.py |
Adds origin/source queries and renames duplicate filtering. |
ares/interface/data/mf4_handler.py |
Preserves occurrences and writes separate source/timebase groups. |
ares/interface/data/ares_signal.py |
Changes validation errors, annotations, and docstrings. |
ares/interface/data/ares_data_interface.py |
Adds origin/source queries and removes stored resampling defaults. |
ares/core/pipeline.py |
Supplies simulation source priority from workflow ordering. |
.vscode/launch.json |
Adds simulation preparation before debugging. |
Review effort: Balanced
abe358c to
130099e
Compare
… be a priority based on the element workflow
…s with different time arrays
6f41c19 to
1859948
Compare
1859948 to
49440cf
Compare


No description provided.