Load values from external IDSes#170
Open
DaanVanVugt wants to merge 4 commits into
Open
Conversation
b26ea19 to
85dade5
Compare
SBlokhuizen
reviewed
Jun 24, 2026
mikesndrs
reviewed
Jun 24, 2026
When a tendency entry has no explicit `type`, infer it from its keys
instead of always defaulting to linear: `to` -> linear, `time` ->
piecewise, `value` -> constant. Anything else falls back to linear, so
a linear tendency does not require `to` (a from-only/rate-only/bare
segment is still linear and takes its endpoints from its neighbours).
A segment whose distinguishing key is absent must name its type
explicitly: the periodic shapes, smooth, and a value-less constant (a
bare {duration} is read as a linear ramp).
Documents the behaviour (yaml_format + tendencies) and tests the
inference, the linear-without-`to` forms, the value-less ambiguity, and
that an explicit type takes precedence.
Adds a single `globals.imports` map (name -> IMAS URI, or {port: <name>}
for an IDS received on a MUSCLE3 port at run time) consumed by
`{ref: <name>}` import entries in waveforms. This replaces the
machine_description, top-level references, and base_idss overlay with one
mechanism.
- ImportTendency: a 0D import segment, combinable with analytic segments
(each fills its [start, end] window); resolved by the exporter.
- ImportWaveform / StaticWaveform: a non-0D or wildcard import owns the
whole waveform; StaticWaveform carries a single string constant.
- A whole-IDS import (<ids>/*) is overlaid first as a base, then leaf
waveforms override it, reproducing the machine-description behaviour.
- Imports are resampled onto the export time base with a selectable
interpolation mode (closest/linear/previous), via an in-memory entry so
any backend can be sliced.
- Index wildcards (source(*), incl. multiple for higher dimensions) and
trailing-subtree wildcards; a (*) over an array of structure whose size
varies in time raises rather than silently mis-populating.
- The `ref` key infers the `import` tendency type (`reference` kept as an
alias); imports editing UI (free-text-key DictEditor) in Edit Global
Properties.
- Docs + a literalinclude reference example; tests migrated and extended.
b3719a6 to
e11680d
Compare
Move scalar import resolution out of the exporter into the waveform. ImportTendency.get_value now produces values itself -- raw source samples while editing/plotting, resampled onto the export time base at export -- via a new ImportResolver that is the single owner of all IMAS source reading (open, resample, extract, wildcard expansion). Composites of analytic and import segments now work through the normal tendency evaluator, and the editor plots real imported curves. The exporter is reduced to orchestration, and the IDS node-filling shared by the exporter and resolver is factored into ids_fill. Generalise imports to overlay whole entries: a bare `*` overlays every IDS a source provides, and any overlay key may list several sources. Conflicts resolve by specificity (`*` < `<ids>/*` < subtree `.../*` < explicit leaf), falling back to listing order for equal specificity, so ordering no longer changes broad-vs-specific results. Also adds the imports editing tooltip in the globals tab and shortens the import documentation.
Remove the whole-entry (`*`) import. It existed only to save listing a few `<ids>/*` overlays, but required runtime IDS discovery (source_ids_names probing every DD IDS, with a broad except); the well-tested `<ids>/*` whole-IDS overlay and multi-source overlays cover the real need without it. Replace the incidental, order-dependent array sizing with an explicit sizing pass (size_arrays): walk all waveform paths together, compute each array of structure's required size as the max over every path (an explicit index + 1, a bounded slice's stop, or the time length for a dynamic array), and resize each array once before any value is filled. A `:` slice therefore expands against the final size regardless of declaration order, replacing the previous two-pass-plus-reverse heuristic that assumed waveforms were listed in increasing-index order.
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.
After #168
Also allows loading 2D values, but then cannot be combined with other tendencies in the same variable.
Also allows wildcards in the IDS path.