upxo.meshing.gbconformant.pipeline.settings module
Settings of the conformal meshing pipeline: names, types, limits, defaults and versions.
Every setting is described once, in SETTINGS. The defaults, the type and range
checks, the stages a setting influences and the migration of settings saved by an
older version all derive from that table. Names keep the notebook spelling.
- exception upxo.meshing.gbconformant.pipeline.settings.SettingsError[source]
Bases:
ValueErrorA setting name or value that cannot be used.
- class upxo.meshing.gbconformant.pipeline.settings.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).
- upxo.meshing.gbconformant.pipeline.settings.register_settings(extra: Iterable[Setting]) None[source]
Add
extrasettings to the table (a set provider’s own settings). Registering a key again replaces it.
- upxo.meshing.gbconformant.pipeline.settings.prepare_provider(values: Mapping) None[source]
Load the set provider
valuesnames (SET_PROVIDER) so that its settings are known.
- upxo.meshing.gbconformant.pipeline.settings.default_config(extra: Iterable[Setting] = ()) dict[source]
A fresh, mutable settings dict holding every default (plus those of
extra).
- upxo.meshing.gbconformant.pipeline.settings.settings_of_stage(stage_id: str) tuple[str, ...][source]
Names of the settings that decide the results of
stage_id.
- upxo.meshing.gbconformant.pipeline.settings.migrate_config(config: Mapping, from_version: int) dict[source]
Bring settings saved at
from_versionup toCONFIG_VERSION.
- upxo.meshing.gbconformant.pipeline.settings.clean_path_text(text: Any) str[source]
A path as typed or pasted: no surrounding blanks, line ends or quotes.
Windows “Copy as path” puts the path in double quotes; they are not part of the path. A pair of single quotes is removed too; a double quote never belongs to a Windows path, so a stray one at either end goes as well.
- upxo.meshing.gbconformant.pipeline.settings.coerce_value(setting: Setting, value: Any) tuple[Any, str | None][source]
(value, problem):valuebrought to the setting’s type;problemisNonewhen it was fine.A value that cannot be used is replaced by the default and described in
problem.
- upxo.meshing.gbconformant.pipeline.settings.coerce_config(loaded: Mapping, extra: Iterable[Setting] = ()) tuple[dict, list[str]][source]
Defaults overlaid with
loadedvalues, each brought to its type.Returns
(config, problems). A value that cannot be used falls back to the default and is listed; settings this version does not know are kept.
- upxo.meshing.gbconformant.pipeline.settings.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.settings.parse_value(setting: Setting, text: str) Any[source]
The value a person typed for
setting, checked against its type and limits.
- upxo.meshing.gbconformant.pipeline.settings.parse_assignment(text: str, extra: Iterable[Setting] = ()) tuple[str, Any][source]
"KEY=VALUE"->(KEY, checked value).