upxo.meshing.gbconformant.pipeline.comparison_view module

The before/after comparison of a run: which two representations are compared, the tables and the figures.

The representations are the voxel structure, the grain boundary surface before and after smoothing, the closed remeshed surface before tetrahedral meshing and the tetrahedral mesh (fm_steel_abaqus.snapshots). They are measured when asked for, from the artefacts of the run, and kept until an artefact or a setting changes. Everything is labelled with the name of the representation, never with “before” and “after” alone, and lengths are shown in the units of COMPARE_PLOT_UNITS.

exception upxo.meshing.gbconformant.pipeline.comparison_view.SnapshotUnavailable[source]

Bases: ValueError

A representation cannot be measured for this run; the message says what to run first.

class upxo.meshing.gbconformant.pipeline.comparison_view.Picture(key: 'str', title: 'str', figure: 'Any', note: 'str' = '')[source]

Bases: object

key: str
title: str
figure: Any
note: str = ''
class upxo.meshing.gbconformant.pipeline.comparison_view.ViewSettings(before: str = 'voxels', after: str = 'tets', kind: str = 'histogram', bins: int = 40, bin_width: float | None = None, bandwidth: float | None = None, log: bool = False, density: bool = False, matched_kind: str = 'scatter', units: str = 'auto', color_before: str = '#4878CF', color_after: str = '#D65F5F', show_mean: bool = True, show_std: bool = True, show_median: bool = False, normalisation: str = 'fraction of the boundary area', grain_weight: str = 'number of grains')[source]

Bases: object

The display settings of the comparison, read from a run’s configuration.

before: str = 'voxels'
after: str = 'tets'
kind: str = 'histogram'
bins: int = 40
bin_width: float | None = None
bandwidth: float | None = None
log: bool = False
density: bool = False
matched_kind: str = 'scatter'
units: str = 'auto'
color_before: str = '#4878CF'
color_after: str = '#D65F5F'
show_mean: bool = True
show_std: bool = True
show_median: bool = False
normalisation: str = 'fraction of the boundary area'
grain_weight: str = 'number of grains'
upxo.meshing.gbconformant.pipeline.comparison_view.view_settings(cfg: dict) → ViewSettings[source]

The comparison’s display settings of cfg (checked).

upxo.meshing.gbconformant.pipeline.comparison_view.get_snapshot(state: PipelineState, key: str)[source]

The measured representation key (a key or a title); raises SnapshotUnavailable.

upxo.meshing.gbconformant.pipeline.comparison_view.snapshot_problems(state: PipelineState) → dict[source]

{key: why not (or None when it can be measured)} for every representation.

upxo.meshing.gbconformant.pipeline.comparison_view.pair_snapshots(state: PipelineState, view: ViewSettings | None = None)[source]

(before snapshot, after snapshot, view settings) of the chosen pair.

upxo.meshing.gbconformant.pipeline.comparison_view.pair_phrase(before, after) → str[source]
upxo.meshing.gbconformant.pipeline.comparison_view.display_units(view: ViewSettings, power: int, source: str, arrays) → str[source]
upxo.meshing.gbconformant.pipeline.comparison_view.comparison_figure(state: PipelineState, parameter_key: str, view_name: str = 'distribution', view: ViewSettings | None = None) → Picture[source]

One parameter of the chosen pair as a distribution, as the matched change per item, or as pole figures.

upxo.meshing.gbconformant.pipeline.comparison_view.comparison_tables(state: PipelineState, view: ViewSettings | None = None) → list[tuple][source]

[(title, columns, rows)] of the chosen pair: what was compared, then one table per parameter.

upxo.meshing.gbconformant.pipeline.comparison_view.comparison_text(state: PipelineState, view: ViewSettings | None = None) → str[source]

The tables of the chosen pair as one block of text.