upxo.meshing.gbconformant.pipeline package
Submodules
- upxo.meshing.gbconformant.pipeline.advice module
- upxo.meshing.gbconformant.pipeline.background module
- upxo.meshing.gbconformant.pipeline.cancel module
- upxo.meshing.gbconformant.pipeline.checkpoints module
- upxo.meshing.gbconformant.pipeline.cli module
- upxo.meshing.gbconformant.pipeline.comparison_view module
SnapshotUnavailablePictureViewSettingsViewSettings.beforeViewSettings.afterViewSettings.kindViewSettings.binsViewSettings.bin_widthViewSettings.bandwidthViewSettings.logViewSettings.densityViewSettings.matched_kindViewSettings.unitsViewSettings.color_beforeViewSettings.color_afterViewSettings.show_meanViewSettings.show_stdViewSettings.show_medianViewSettings.normalisationViewSettings.grain_weight
view_settings()get_snapshot()snapshot_problems()pair_snapshots()pair_phrase()display_units()comparison_figure()comparison_tables()comparison_text()
- upxo.meshing.gbconformant.pipeline.estimate module
- upxo.meshing.gbconformant.pipeline.handlers module
- upxo.meshing.gbconformant.pipeline.iteration_metrics module
- upxo.meshing.gbconformant.pipeline.manifest module
- upxo.meshing.gbconformant.pipeline.mesh_regions module
- upxo.meshing.gbconformant.pipeline.preflight module
- upxo.meshing.gbconformant.pipeline.presets module
- upxo.meshing.gbconformant.pipeline.progress module
- upxo.meshing.gbconformant.pipeline.provenance module
- upxo.meshing.gbconformant.pipeline.quality_figures module
- upxo.meshing.gbconformant.pipeline.quality_report module
- upxo.meshing.gbconformant.pipeline.quality_snapshots module
- upxo.meshing.gbconformant.pipeline.region_quality module
RegionSettingsRegionSettings.orderRegionSettings.modeRegionSettings.touchRegionSettings.include_rve_facesRegionSettings.featuresRegionSettings.exclude_linesRegionSettings.exclude_pointsRegionSettings.exclude_orderRegionSettings.min_dihedralRegionSettings.target_dihedralRegionSettings.max_dihedralRegionSettings.min_angle
region_figures()region_flat_table()region_quality()region_settings()region_tables()summary_numbers()triangle_measures()write_region_files()
- upxo.meshing.gbconformant.pipeline.resources module
- upxo.meshing.gbconformant.pipeline.results module
BlockResultFigurestage_rows()input_block()subset_block()cleaning_block()surface_block()mesh_block()tet_stage_block()export_block()boundary_block()timing_block()stage_note()stage_summary_block()summary_blocks()summary_text()settings_block()quality_blocks()region_data()region_blocks()region_flat_block()region_result_figures()quality_figures()quality_data()quality_report_blocks()quality_grain_table()write_csv()fidelity_blocks()grain_data()grain_table()grain_blocks()merge_data()merge_blocks()merge_table()fidelity_figure()grain_data_ok()fidelity_figures()human_size()deliverables()deliverables_block()report_session()populate_report()
- upxo.meshing.gbconformant.pipeline.rolling module
- upxo.meshing.gbconformant.pipeline.run module
- upxo.meshing.gbconformant.pipeline.runfiles module
- upxo.meshing.gbconformant.pipeline.runner module
- upxo.meshing.gbconformant.pipeline.runs module
RunInfoRunInfo.nameRunInfo.pathRunInfo.modifiedRunInfo.parentRunInfo.subset_indexRunInfo.datasetRunInfo.levelRunInfo.subset_boxRunInfo.stages_savedRunInfo.last_stageRunInfo.last_stage_titleRunInfo.finishedRunInfo.saved_bytesRunInfo.has_manifestRunInfo.has_reportRunInfo.voxelsRunInfo.tetsRunInfo.secondsRunInfo.peak_memory_mbRunInfo.disk_bytesRunInfo.history_bytesRunInfo.older_export_bytesRunInfo.older_exports_textRunInfo.folder_textRunInfo.history_textRunInfo.disk_textRunInfo.size_textRunInfo.modified_textRunInfo.progress_text
folder_size()runs_directory()describe_run()list_runs()RunDeletionErroris_run_folder()delete_run()older_exports()delete_older_exports()drop_run_history()
- upxo.meshing.gbconformant.pipeline.saved_results module
- upxo.meshing.gbconformant.pipeline.serialize module
- upxo.meshing.gbconformant.pipeline.settings module
- upxo.meshing.gbconformant.pipeline.stage_cleaning module
- upxo.meshing.gbconformant.pipeline.stage_input module
- upxo.meshing.gbconformant.pipeline.stage_output module
- upxo.meshing.gbconformant.pipeline.stage_quality module
- upxo.meshing.gbconformant.pipeline.stage_surface module
backend_kwargs()effective_spacing()rve_dimensions()frozen()current_interfaces()save_surface_vtp()handle_smooth_interfaces()handle_geometry_guard()handle_guard_relax()handle_unpinch()handle_gmsh_interfaces()handle_close_rve()handle_pre_joint_quality()handle_joint_remesh()handle_pre_tet_validation()handle_contact_repair()handle_crossing_repair()handle_surface_repair()handle_surface_gate()
- upxo.meshing.gbconformant.pipeline.stage_volume module
- upxo.meshing.gbconformant.pipeline.stages module
- upxo.meshing.gbconformant.pipeline.state module
StageStatusPipelineStatePipelineState.statusPipelineState.reportsPipelineState.artefactsPipelineState.artefact_writerPipelineState.current_stagePipelineState.errorsPipelineState.stale_reasonsPipelineState.log_linesPipelineState.busyPipelineState.try_begin_operation()PipelineState.end_operation()PipelineState.request_cancel()PipelineState.check_cancel()PipelineState.set_progress_handler()PipelineState.report_progress()PipelineState.append_log()PipelineState.set_status()PipelineState.pop_history()PipelineState.store_artefact()PipelineState.get_artefact()PipelineState.invalidate_from()PipelineState.invalidate_after()PipelineState.invalidation_preview()PipelineState.stale_reason_text()
- upxo.meshing.gbconformant.pipeline.units module
- upxo.meshing.gbconformant.pipeline.worker module
Module contents
Run the grain-conformal tetrahedral meshing pipeline, and save and restore its stage results.
from upxo.meshing.gbconformant.pipeline import run result = run(RAW_FOLDER=”path/to/raw_export”, HIERARCHY_LEVEL=”blk”, through=”export_abaqus”)
run applies the stages in order (see STAGES), saving each stage’s results in the
run folder in portable files; a second run of the same settings restores them and runs
only what changed. python -m upxo.meshing.gbconformant.pipeline --help lists the commands.
- class upxo.meshing.gbconformant.pipeline.CheckpointStore(run_folder, keep_history=True)[source]
Bases:
objectStage results in
<run_folder>/checkpoints.With
keep_history(the default) every stage keeps the results it wrote, so a stage can be run again from the results of the stage before it. Without it a newer stage’s result replaces the older copy of the same artefact, which takes less disk; a restore then returns only a prefix of stages whose results are all still complete.- save_stage(state, stage_id, signature, status='OK', report=None, config_changes=None)[source]
Write the results
stage_idproduced; return its meta dictionary.config_changesare the settings the stage itself changed while running (the hierarchy level it found, the spacing after an upscale); a restore applies them again.
- save_marker(stage_id, signature, status, report=None, config_changes=None)[source]
A stage with no results of its own (for instance a skipped one).
- history_bytes(order)[source]
Disk the older copies of artefacts take: every artefact kept by more than one stage, less its newest copy.
- drop_history(order)[source]
Keep each artefact only in the last stage of
orderthat wrote it; returns the bytes freed.A run that finished still restores as a whole afterwards (its results are the newest copies); what is lost is running a stage again from the results of the stage before it.
- restore(state, stage_ids, signatures, set_status, set_config=None)[source]
Load every stage that is still valid, in order; later stages follow earlier ones.
set_status(stage_id, text)receives'OK','Skipped'or'Stale';set_config(stage_id, changes)receives the settings a restored stage changed. Returns{'restored': [...], 'stale': [...], 'bytes': n, 'problems': [...]}.
- class upxo.meshing.gbconformant.pipeline.PipelineState(config: dict, stage_ids: list[str])[source]
Bases:
objectHolds settings, artefacts, and per-stage status.
- set_progress_handler(handler) None[source]
handler(message, current=None, total=None)receives the progress of the running stage.
- set_status(stage_id: str, status: StageStatus) None[source]
- pop_history(stage_id: str, data: dict) dict[source]
Move
data['history']into the stage’s history artefact; returnsdatawithout it.The per-pass list stays out of the compact stage report (and the JSON written for it) the same way it was dropped before this existed; it is kept instead at
"<stage_id>.history"for later per-pass inspection, and is invalidated together with the stage that wrote it.
- invalidate_from(stage_id: str, reason: str = '') list[str][source]
Mark
stage_idand every later stage stale; drop their artefacts.reasonsays why (it is kept for each stage that held results). Returns the list of invalidated stage ids.
- invalidate_after(stage_id: str, reason: str = '') list[str][source]
Invalidate every stage that comes after
stage_id; returns their ids.
- class upxo.meshing.gbconformant.pipeline.RunResult(state: PipelineState, run_folder: Path, through: str, restored: list[str] = <factory>, ran: list[str] = <factory>, skipped: list[str] = <factory>, failed_stage: str | None = None, error: str | None = None, manifest: Path | None = None)[source]
Bases:
objectWhat a run did.
- state: PipelineState
- exception upxo.meshing.gbconformant.pipeline.SerializeError[source]
Bases:
TypeErrorA value cannot be written in the portable form.
- class upxo.meshing.gbconformant.pipeline.Setting(key: str, default: Any, kind: str = '', minimum: float | None = None, maximum: float | None = None, choices: tuple = (), auto: bool = False, size: int = 0, container: str = 'tuple', integral: bool = False, stages: tuple = (), unit: str = '', signed_when_changed: bool = False)[source]
Bases:
objectOne setting: its default, type, limits and the stages whose results it decides.
- kind: str = ''
bool | int | float | text | choice | int_choice | sequence | ids | any (derived from the default when empty).
- exception upxo.meshing.gbconformant.pipeline.SettingsError[source]
Bases:
ValueErrorA setting name or value that cannot be used.
- class upxo.meshing.gbconformant.pipeline.StageDef(id: str, title: str, group: str, kind: str = 'compute', optional_flag: str | None = None, backend: str = 'd3v2p0')[source]
Bases:
objectOne stage that computes or writes something.
- class upxo.meshing.gbconformant.pipeline.StageStatus(*values)[source]
-
- NOT_RUN = 'Not run'
- RUNNING = 'Running'
- OK = 'OK'
- FAILED = 'Failed'
- STALE = 'Stale'
- SKIPPED = 'Skipped'
- upxo.meshing.gbconformant.pipeline.build_config(overrides: Mapping | None = None, *, extra: Iterable[Setting] = (), **named) dict[source]
Defaults changed by
overridesandnamedvalues, each checked.Unknown names and unusable values raise
SettingsError.
- upxo.meshing.gbconformant.pipeline.canonical_signature(parts)[source]
Short hash of
parts(numbers, text, lists and dictionaries in any order).
- upxo.meshing.gbconformant.pipeline.chain_signatures(stage_ids, own)[source]
Signature per stage that also depends on every earlier stage’s own part.
- upxo.meshing.gbconformant.pipeline.default_config(extra: Iterable[Setting] = ()) dict[source]
A fresh, mutable settings dict holding every default (plus those of
extra).
- upxo.meshing.gbconformant.pipeline.load_versioned(loaded: Mapping, version: int, extra: Iterable[Setting] = ()) tuple[dict, list[str]][source]
Migrate settings saved at
versionand coerce them; returns(config, problems).
- upxo.meshing.gbconformant.pipeline.parse_assignment(text: str, extra: Iterable[Setting] = ()) tuple[str, Any][source]
"KEY=VALUE"->(KEY, checked value).
- upxo.meshing.gbconformant.pipeline.read_value(stem)[source]
Read what
write_value()wrote; refuses an unknown format or version.
- upxo.meshing.gbconformant.pipeline.run(config: dict | None = None, *, through: str = 'export_abaqus', resume: bool = True, on_event: Callable[[dict], None] | None = None, write_manifest: bool = True, **settings) RunResult[source]
Run the pipeline up to and including
through.configand keywordsettingsare settings by name (seeupxo.meshing.gbconformant.pipeline.settings); unknown names and unusable values raiseSettingsError. Withresumethe results a previous run of the same run folder saved are restored first (each stage only while its settings and everything before it are unchanged) and only the remaining stages run. A failing stage does not raise: the result names it infailed_stageanderror.
- upxo.meshing.gbconformant.pipeline.write_value(stem, value, where='value')[source]
Write
valueas<stem>.json(+<stem>.npzwhen it holds arrays).Returns
{'json': name, 'npz': name or None}; raisesSerializeError.