upxo.meshing.gbconformant.fm_steel_abaqus.parameters module

The quantities the before/after comparison can show, read from a Snapshot.

Each Parameter says what is plotted (one value per grain, per junction line or per boundary), which views make sense and what a snapshot must hold. read() returns the values of one parameter in one snapshot as a Series; matched_items() pairs two series by grain (or junction set) for the matched-change view. Values stay in the snapshot’s output units; unit_factor() and choose_units() scale them for display.

exception upxo.meshing.gbconformant.fm_steel_abaqus.parameters.Unavailable[source]

Bases: ValueError

The parameter cannot be read from this snapshot; the message says why.

class upxo.meshing.gbconformant.fm_steel_abaqus.parameters.Parameter(key: 'str', label: 'str', group: 'str', dimension: 'str', noun: 'str', views: 'tuple' = ('distribution', 'matched'), needs_volume: 'bool' = False, description: 'str' = '')[source]

Bases: object

key: str
label: str
group: str
dimension: str

length, area, volume, count, ratio or angle (what one value measures).

noun: str

What one value belongs to (grains, lines, boundaries).

views: tuple = ('distribution', 'matched')
needs_volume: bool = False
description: str = ''
upxo.meshing.gbconformant.fm_steel_abaqus.parameters.parameter(key_or_label) → Parameter[source]
class upxo.meshing.gbconformant.fm_steel_abaqus.parameters.Series(values: ndarray, weights: ndarray | None = None, items: dict | None = None, noun: str = 'grains', dimension: str = 'length', y_kind: str = 'count', total: float | None = None, note: str = '', integer: bool = False)[source]

Bases: object

The values of one parameter in one snapshot.

values: ndarray
weights: ndarray | None = None
items: dict | None = None

{grain label or junction set: value}, for the matched-change view.

noun: str = 'grains'
dimension: str = 'length'
y_kind: str = 'count'

what the weights add up to per unit of value.

Type:

count (unweighted), fraction, area or per_length

total: float | None = None
note: str = ''
integer: bool = False
property count: int
upxo.meshing.gbconformant.fm_steel_abaqus.parameters.read(parameter_, snapshot: Snapshot, *, normalisation='fraction of the boundary area', grain_weight='number of grains') → Series[source]

The values of parameter_ in snapshot; raises Unavailable when it has none.

upxo.meshing.gbconformant.fm_steel_abaqus.parameters.available(parameter_, snapshot: Snapshot) → str | None[source]

Why parameter_ cannot be read from snapshot, or None when it can.

upxo.meshing.gbconformant.fm_steel_abaqus.parameters.matched_items(before: Series, after: Series)[source]

(keys, before values, after values) for the items present on both sides, in key order.

upxo.meshing.gbconformant.fm_steel_abaqus.parameters.unit_power(dimension: str, y_kind: str = 'count') → int[source]

The power of a length that dimension is (0 for a number, an angle or a ratio).

upxo.meshing.gbconformant.fm_steel_abaqus.parameters.unit_factor(power: int, source: str, target: str) → float[source]

Factor converting a quantity of dimension length**power from source to target units.

upxo.meshing.gbconformant.fm_steel_abaqus.parameters.choose_units(power: int, source: str, arrays) → str[source]

The unit (of microns, mm, m) that gives the numbers of arrays the fewest digits, around 10.

upxo.meshing.gbconformant.fm_steel_abaqus.parameters.unit_text(power: int, units: str, *, plain: bool = False) → str[source]

um-style text of a quantity’s unit: mm, mm^2 or, for a plot, mathtext such as $\mu$m$^2$.

upxo.meshing.gbconformant.fm_steel_abaqus.parameters.count_noun(noun: str, n: int) → str[source]

271 grains, 1 grain.