upxo.meshing.gbconformant.pipeline.saved_results module

Connects a pipeline run to the checkpoint store of its run folder.

Settings that decide a stage’s results (its own settings, its enable flag, the input dataset, the subset box, the seeds, the backend) go into a signature that chains through the stages, so a restore trusts a stage only while everything up to it is unchanged.

upxo.meshing.gbconformant.pipeline.saved_results.stage_order() → list[str][source]
upxo.meshing.gbconformant.pipeline.saved_results.input_signature(config: dict) → list[source]

Name, size and modification time of the input files (not their contents).

upxo.meshing.gbconformant.pipeline.saved_results.effective_level(config: dict) → str[source]

The hierarchy level that will be (or was) loaded: the chosen one, else the finest.

upxo.meshing.gbconformant.pipeline.saved_results.own_part(config: dict, stage_id: str) → dict[source]
upxo.meshing.gbconformant.pipeline.saved_results.signatures(config: dict) → dict[source]
upxo.meshing.gbconformant.pipeline.saved_results.store_for(state) → CheckpointStore[source]
upxo.meshing.gbconformant.pipeline.saved_results.enable(state) → None[source]

Switch checkpointing on for state (when its settings allow it).

upxo.meshing.gbconformant.pipeline.saved_results.discard(state, stages) → None[source]
upxo.meshing.gbconformant.pipeline.saved_results.config_changes(before: dict, after: dict) → dict[source]

The settings whose value differs between before and after (a stage changed them).

upxo.meshing.gbconformant.pipeline.saved_results.apply_config_changes(config: dict, changes: dict) → None[source]

Set the settings a stage had changed, each brought to its type.

upxo.meshing.gbconformant.pipeline.saved_results.save_after_run(state, stage_id: str, changes: dict | None = None) → None[source]

Write the results stage_id just produced (and any finished upstream stage still unsaved).

changes are the settings the stage changed while running.

upxo.meshing.gbconformant.pipeline.saved_results.save_after_skip(state, stage_id: str, changes: dict | None = None) → None[source]
upxo.meshing.gbconformant.pipeline.saved_results.restore(state, before: str | None = None) → dict[source]

Load every still-valid stage of the state’s run folder; returns the store’s summary.

With before only the stages ahead of that stage are loaded.

upxo.meshing.gbconformant.pipeline.saved_results.load_stage(state, stage_id: str, run_folder=None) → None[source]

Take the saved results of stage_id into state (its status, report, artefacts and settings changes).

The saved signature must match the state’s current settings. run_folder is where they were saved when that differs from the state’s own run folder (a stage that crops the input starts a folder of its own).

upxo.meshing.gbconformant.pipeline.saved_results.missing_prerequisites(state, stage_id: str) → list[str][source]

Earlier stages whose saved results a fresh process could not take up from.

A stage is listed when it has not been run (and is not switched off), or when it ran but its saved results are missing, out of date or incomplete. A fresh process can take up from stage_id only when this list is empty.

upxo.meshing.gbconformant.pipeline.saved_results.rewind(state, stage_id: str) → list[str][source]

Bring back what the stages before stage_id left, after stage_id and the later stages were dropped.

Stages overwrite shared results in turn (the labels, the surface, the tetrahedra), so dropping a stage’s results also drops the newest copy of those. The copy the stage before it saved is read back from the run folder, so stage_id can run again from where the earlier stages left off. Returns the names restored.