waveform_editor.import_resolver.ImportResolver

class waveform_editor.import_resolver.ImportResolver(imports, dd_version, received_idss=None)

Bases: object

Reads named external data entries (globals.imports) from IMAS.

This is the single place that opens external entries / MUSCLE3 port IDSs and turns them into values: the raw source samples (for editing/plotting) and values resampled onto a requested export time base (for export). The waveforms ask the resolver for their values; the exporter only writes the result into the target IDS.

Each import name maps to an IMAS URI string, or a {port: <name>} referring to an IDS received on a MUSCLE3 port at run time (received_idss). Sources are read in full once and cached, then resampled in memory so any backend can be sliced (netCDF does not support get_slice directly).

__init__(imports, dd_version, received_idss=None)

Methods

__init__(imports, dd_version[, received_idss])

expand_index_wildcards(root, src_sub, dst_sub)

Expand every (*) index wildcard against the resampled source.

extract_values(node, path[, path_index])

Read the values at path from node as a per-time list where the path crosses a dynamic array of structures (mirror of the node-filling logic).

fill_import(ids, *, ref, src_path, dst_path, ...)

Copy a (resampled) non-0D / wildcard import from ref into ids.

navigate(node, path)

Walk an IDSPath, applying explicit indices; arrays of structure are kept.

raw(ref, ids_path, *[, time_offset])

The source's own (time, values) at ids_path, without resampling.

sample(ref, ids_path, time, *[, ...])

Values at ids_path from import ref, resampled onto time.

expand_index_wildcards(root, src_sub, dst_sub)

Expand every (*) index wildcard against the resampled source.

Yields (concrete_src_sub, concrete_dst_sub, is_subtree) tuples: each (*) is replaced (one at a time, recursively) by the 1-based index of every element of that array of structure in the source, a trailing /* is flagged as a whole-subtree mirror, and other index specs (2, 2:3, :) pass through unchanged. The concrete paths are read/filled via IDSPath, which owns indexing.

extract_values(node, path, path_index=0)

Read the values at path from node as a per-time list where the path crosses a dynamic array of structures (mirror of the node-filling logic).

fill_import(ids, *, ref, src_path, dst_path, time, time_offset, interp)

Copy a (resampled) non-0D / wildcard import from ref into ids.

Index wildcards (source(*)/...) are expanded against the source, iterating over every element of that array of structure; a trailing /* mirror-copies a whole subtree; everything else copies a single node.

static navigate(node, path)

Walk an IDSPath, applying explicit indices; arrays of structure are kept.

raw(ref, ids_path, *, time_offset=0.0)

The source's own (time, values) at ids_path, without resampling.

Used for editing/plotting: the raw samples are shown on the source's native time base (mapped into waveform time by subtracting time_offset). Returns empty arrays for a time-independent source, which has no curve to draw.

sample(ref, ids_path, time, *, time_offset=0.0, interp='closest')

Values at ids_path from import ref, resampled onto time.

Scalar quantities only; a static (time-independent) value is broadcast across time. Non-0D quantities are handled structurally via fill_import().


Last update: 2026-07-16