loader¶
Load RCA artifact bundles from a full-result JSON file or a fixtures directory.
Run the Streamlit app from this directory so import loader resolves:
cd DACKAR/src/dackar/RCA/viz && streamlit run app.py
Attributes¶
Functions¶
|
|
|
|
|
Classify a path as a full-result JSON file or a fixtures/run directory. |
|
Load a single JSON object (e.g. v32_full_result.json). Keys pass through unchanged. |
|
Merge every |
|
Return primary with any keys it lacks filled in from supplemental. |
|
Auto-detect file vs directory and load. |
Load optional pre-refine causality artifact. |
|
|
Return the bundle's artifact keys, sorted, excluding load-error markers. |
Module Contents¶
- loader.detect_input_mode(path)[source]¶
Classify a path as a full-result JSON file or a fixtures/run directory.
@ In, path, str, filesystem path to a
.jsonfile or a directory @ Out, mode, str,"fixtures_dir"for a directory,"full_result"fora
.jsonfile- Parameters:
path (str)
- Return type:
Literal[‘full_result’, ‘fixtures_dir’]
- loader.load_from_full_result(path)[source]¶
Load a single JSON object (e.g. v32_full_result.json). Keys pass through unchanged.
- Parameters:
path (str)
- Return type:
- loader.load_from_fixtures_dir(directory)[source]¶
Merge every
*.jsonin a directory into one bundle, keyed by filename.The directory may be a hand-built fixtures folder or a real orchestrator run folder (
ArtifactStorewrites one<artifact_name>.jsonper artifact), so scanning the directory surfaces whatever artifacts are actually present rather than a fixed allow-list._FIXTURE_FILE_MAPis consulted as an alias layer: a basename it names maps to that key, otherwise the filename stem is the key. Missing files are simply absent; never raises for them.- Parameters:
directory (str)
- Return type:
- loader.merge_bundles(primary, supplemental)[source]¶
Return primary with any keys it lacks filled in from supplemental.
Primary wins on every shared key, so a complete run bundle is never overwritten; the supplement only contributes artifacts the primary is missing (e.g. the raw
event/telemetry_summaryinputs that av32_full_result.jsondoes not carry, or the generated artifacts a hand-built fixtures folder lacks). This lets one view combine the data provided as input with the data produced by every pipeline stage.
- loader.load_artifacts(path)[source]¶
Auto-detect file vs directory and load.
- Parameters:
path (str)
- Return type:
- loader.load_pre_refine_causality(path)[source]¶
Load optional pre-refine causality artifact.
Accepts either a bare
causality_candidatesobject (hascandidates) or a full bundle (usescausality_candidateskey if present).- Parameters:
path (str)
- Return type:
Optional[JsonDict]
- loader.list_bundle_keys(bundle)[source]¶
Return the bundle’s artifact keys, sorted, excluding load-error markers.
@ In, bundle, dict, a loaded bundle (may contain
<key>__load_errormarkers) @ Out, keys, list, sorted artifact keys with the error markers removed- Parameters:
bundle (JsonDict)
- Return type:
List[str]