pyflightstream.workspace.inputs (stable)¶
Generated from the docstrings at build time: every one of the 74 names in the __all__ of pyflightstream.workspace.inputs has an entry below. The names a guide or an example uses come first; the others follow under Advanced.
Input-artifact library of the managed campaign workspace.
Pipeline role: organizes the reusable inputs of a campaign the same
way the workspace organizes its outputs. A support library under
inputs/ holds one declarative artifact per file, referenced by a
stable id (the file name stem), so a campaign line can select its
reference data, solver preset, boundary groups, geometry, and profile
by id instead of by path; the pattern is translated from the reference
research workflow. Artifacts are TOML, never executable code:
they are validated by pydantic models at load time and fail with a
didactic message naming the file and the available ids.
AN ID OF A CODED KIND DECLARES THAT KIND, (PFS-2009.01, PFS-2009.03). A reference id
begins with r, a setup id with s, a pproc id with p (e
in legacy releases, when the groups artifact became the post-processing
artifact, PFS-2029.07), so r003, s003 and p003 are three ids
rather than one number meaning three files. Before that, the three
folders each held a 003.toml and a number mistyped between the REF,
SET and PPROC columns of a run matrix resolved to another artifact with
no signal at all. A geometry is named by its file name with the
extension (PFS-2029.09) and a profile by its stem, because their ids are
the names of files the user staged and a letter rule there would refuse
a mesh for being called what it is called.
The library tree, created by CampaignWorkspace.init:
inputs/references/<id>.toml: reference data for coefficient normalization and rotor description (SI units in the field names: m, m^2, deg). The id begins withr.inputs/setups/<id>.toml: a named solver-setup preset, a free key-value table; the loader validates recognized solver settings and keeps the raw values for later matrix binding. The id begins withs.inputs/pproc/<id>.toml: the post-processing artifact (PFS-2029.07), twelve optional tables (listed on :class:PprocArtifact):[groups]maps a product name to one alias string,[exports]selects the export kinds,[sections],[plots]and[[probes]]are the solver definitions,[products]says which files are written after the run. The id begins withp, after the PPROC column that carries it.inputs/geometries/: staged geometry files of any extension, registered by file name; the id is the stem. A geometry sits either directly in the folder (the flat layout) or in one subfolder named by its stem,geometries/30_WB/30_WB.fsm, with its boundary inventory and provenance record beside it (PFS-2032.04); the cell says30_WB.fsmin both cases, and the folder is read first.inputs/profiles/: input profile files (for example actuator thrust distributions), registered by file name.inputs/freestreams/: custom free-stream fields a row'sFREESTREAMnames by stem (G15),<stem>.txtin the manual's STRUCTURED form or<stem>.datin its UNSTRUCTURED form; the matrix binding resolves them (workspace.matrix).inputs/calibrations/: the quasi-steady wheel's calibration files,<id>.toml, which a pproc's[qsteady_correction]table names by id (:mod:pyflightstream.cases.corrections); the plan validates the one a row's pproc names, and the post applies it.inputs/executables.toml: the build registry, mapping a FlightStream build id to its executable path; an explicit override path bypasses the registry, and that override is the only way to run an unregistered build (the MANUAL mode of the run matrix). An entry is a bare path string, or a table carrying that path and, optionally, the FlightStream version the build's scripts are emitted under (:func:resolve_build).
FIVE MODULES (AD-11). The files beside a geometry (the
boundary inventory, the provenance record, the raw-mesh sidecar and the
layout migration) are :mod:pyflightstream.workspace.sidecars; the HPC
profile is :mod:pyflightstream.workspace.hpc; the build registry is
:mod:pyflightstream.workspace.builds; the rule on empty entity selections
is :mod:pyflightstream.workspace.selections. This module resolves the
artifacts and re-exports every name of the four at its public path, which
its __all__ lists.
Used in the guides¶
pyflightstream.workspace.inputs.write_inventory
¶
write_inventory(
geometry: str | Path, *, overwrite: bool = False
) -> Path
Write a kind-qualified boundary inventory beside a saved simulation or OBJ.
The surface order is read from the geometry (PFS-2029.06.02). A sidecar supplies declarations by name; it does not override the order that the solver assigns to the imported surfaces.
AN OBJ IS READ FROM ITS GROUPS (G30). It carries no mesh block, and
its sidecar is written through :func:ensure_inventory, the function
the matrix binding reaches it through as well, so pyfs-matrix
inventory and a plan write the same file. An OBJ's existing sidecar
is refused with overwrite too: beside a raw mesh it also carries
the [import] table and the trailing edges, which a rewrite of the
list would lose. An STL, which names no group, is refused as before.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
geometry
|
str or Path
|
A saved simulation file carrying a mesh block, or an OBJ. |
required |
overwrite
|
bool
|
Rewrite a saved simulation's sidecar that already exists. Without it an existing sidecar is refused, because the file may have been edited by the user after it was written. |
False
|
Returns:
| Type | Description |
|---|---|
Path
|
The sidecar written. |
Raises:
| Type | Description |
|---|---|
InputArtifactError
|
A geometry that cannot be read, that carries no mesh block, or
whose block does not hold its shape, each naming the file; a
sidecar that already exists, naming it and |
Examples:
>>> from pathlib import Path
>>> from tempfile import TemporaryDirectory
>>> from pyflightstream.workspace.sidecars import write_inventory
>>> with TemporaryDirectory() as folder:
... mesh = Path(folder) / "wing.obj"
... _ = mesh.write_text("v 0 0 0\nv 1 0 0\nv 0 1 0\ng Wing\nf 1 2 3\n")
... print(write_inventory(mesh).name)
wing.obj.boundaries.toml
Advanced¶
pyflightstream.workspace.inputs.BASE_REGIONS_TABLE
module-attribute
¶
BASE_REGIONS_TABLE = 'base_regions'
pyflightstream.workspace.inputs.CleanedGeometry
dataclass
¶
CleanedGeometry(
actions: tuple[tuple[str, str, str], ...],
backup: Path | None,
blocks_reset: tuple[str, ...] = (),
note: str | None = None,
)
What :func:clean_saved_actions changed in a saved simulation.
Attributes:
| Name | Type | Description |
|---|---|---|
actions |
tuple of (str, str, str)
|
Each removed action's name, command or script file, and type. |
backup |
Path or None
|
The copy of the file as it was, None when nothing was changed. |
blocks_reset |
tuple of str
|
The blocks put back to their fresh-import content (FR-312), in file order; empty when none was measured for the file or none differed. |
note |
str or None
|
Why no block was reset, when the file's build and unit have no measured fresh import; None otherwise. |
pyflightstream.workspace.inputs.ENTITY_SELECTIONS
module-attribute
¶
ENTITY_SELECTIONS: tuple[EntitySelection, ...] = (
EntitySelection(
"setup",
"viscous_excluded",
"DELETE_VISCOUS_EXCLUDED_BOUNDARIES",
True,
"An empty selection emits the clearing command (FSM-26.120 p.341).",
),
EntitySelection(
"setup",
"valarezo_separation_boundaries",
"DELETE_VALAREZO_SEPARATION_BOUNDARIES",
True,
"An empty selection requests the dedicated clearing command (RPT-018); the build's command evidence still governs its availability.",
),
EntitySelection(
"setup",
"crossflow_separation_boundaries",
"DELETE_CROSSFLOW_SEPARATION_BOUNDARIES",
True,
"An empty selection emits the clearing command (FSM-26.100 p.340).",
),
EntitySelection(
"setup",
"axial_separation_families",
"SET_AXIAL_SEPARATION_BOUNDARIES",
False,
"This family selector must resolve to at least one boundary; it does not request the separate clearing command.",
),
EntitySelection(
"setup",
"disabled_wake_trailing_edges",
"DISABLE_WAKE_NODES_ON_TRAILING_EDGE",
None,
"No empty-list clearing form is established for this sequence of edge selections.",
),
EntitySelection(
"setup",
"leading_edge_wake_boundaries",
"DETECT_LEADING_EDGES_WAKES_BY_SURFACE",
None,
"No empty boundary selection is established for this detection request.",
),
EntitySelection(
"setup",
"delete_inlets",
"DELETE_INLET",
None,
"No empty-list meaning is established for this sequence of inlet deletions.",
),
EntitySelection(
"setup",
"delete_outlets",
"DELETE_OUTLET",
None,
"No empty-list meaning is established for this sequence of outlet deletions.",
),
EntitySelection(
"setup",
"proximal_boundaries",
"SOLVER_PROXIMAL_BOUNDARIES",
None,
"The all-boundaries form is the explicit all token on supported builds, not an established empty-list clearing form.",
),
EntitySelection(
"setup",
"delete_transition_trips",
"DELETE_TRANSITION_TRIP",
None,
"No empty-list meaning is established for this sequence of trip deletions.",
),
EntitySelection(
"setup",
"delete_surfaces",
"DELETE_SURFACES",
None,
"No empty-list meaning is established for this sequence of named surface deletions.",
),
EntitySelection(
"setup",
"vorticity_drag_boundaries",
"SET_VORTICITY_DRAG_BOUNDARIES",
False,
_VORTICITY_EMPTY,
),
EntitySelection(
"setup",
"set_vorticity_drag_boundaries",
"SET_VORTICITY_DRAG_BOUNDARIES",
False,
_VORTICITY_EMPTY,
),
EntitySelection(
"setup",
"vorticity_drag_families",
"SET_VORTICITY_DRAG_BOUNDARIES",
False,
_VORTICITY_EMPTY,
),
EntitySelection(
"setup",
"analysis_families",
"SET_SOLVER_ANALYSIS_BOUNDARIES",
False,
_ANALYSIS_EMPTY,
),
EntitySelection(
"setup",
"set_solver_analysis_boundaries",
"SET_SOLVER_ANALYSIS_BOUNDARIES",
False,
_ANALYSIS_EMPTY,
),
EntitySelection(
"setup",
"aliases.<name>",
"every boundary-citing key of a row naming this preset",
False,
"An alias stands for the boundary names or families listed after it, and over none it would name nothing while reading as though it named a set; the empty list that means every family is the pproc group's, one line below.",
),
EntitySelection(
"pproc",
"groups.<name>",
"the polar table written per group (products.polars)",
True,
"An empty group is every family the geometry carries: the polar table sums every surface row of the loads table, and a motion naming the group moves every boundary of the file.",
),
EntitySelection(
"pproc",
"plots.groups[].families",
"UNSTEADY_SOLVER_NEW_FORCE_PLOT",
False,
"The entry exists to emit one plot per parameter over the families it names; over none it would emit nothing while reading as though it had. A family the geometry does not carry is left out at emission, which is the documented way an entry resolves to fewer families than it names.",
),
EntitySelection(
"pproc",
"sections.distributions[].families",
"NEW_SURFACE_SECTION_DISTRIBUTION",
False,
"The entry exists to emit one distribution per plane over the families it names; over none it would emit nothing while reading as though it had. A family the geometry does not carry is left out at emission, which is the documented way an entry resolves to fewer families than it names.",
),
)
pyflightstream.workspace.inputs.EXECUTABLES_FILE
module-attribute
¶
EXECUTABLES_FILE = 'executables.toml'
pyflightstream.workspace.inputs.EXECUTABLE_ENTRY_KEYS
module-attribute
¶
EXECUTABLE_ENTRY_KEYS = (
"path",
"version",
"accept_unregistered_build",
)
pyflightstream.workspace.inputs.EntitySelection
dataclass
¶
EntitySelection(
kind: str,
key: str,
consumer: str,
empty_admitted: bool | None,
reason: str,
)
One artifact key whose list selects the entities a command applies to.
PFS-2005.02. Handing such a key an empty list looks like stating no preference, and it is not: the command the list feeds is either not emitted at all, which is the solver's own default and is asked for by dropping the key, or emitted naming nothing, and either way the run proceeds against a setup nobody selected and still reports numbers. Whether an empty list can mean anything is decided one key at a time, by the domain seat, and the decision is written beside the key so the refusal can say whose it is.
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
str
|
The artifact kind the key lives in, |
key |
str
|
The key as the file spells it; a placeholder marks a table whose
every entry is a selection ( |
consumer |
str
|
What the list feeds: the FlightStream command, or the product this package writes from it. |
empty_admitted |
bool or None
|
True where an empty list has a documented meaning and is accepted, False where it is refused on the manual's word, and None where the domain seat has not yet decided, in which case it is refused until the owning seat rules. |
reason |
str
|
The sentence the refusal prints beside the verdict: what the manual says, or that nothing does yet. |
pyflightstream.workspace.inputs.GEOMETRIES_README
module-attribute
¶
GEOMETRIES_README = 'README.md'
pyflightstream.workspace.inputs.GEOMETRY_SIDECAR_KEYS
module-attribute
¶
GEOMETRY_SIDECAR_KEYS: Mapping[str, InputKey] = {
"ports": InputKey(
"Stable port identity to exact surface name; conditions belong to setup and MATRIX.",
'a table such as [ports] with feed = "Inlet"',
),
"boundaries": InputKey(
"The mesh's boundary names in the solver's order, the name at position i being boundary i; read from a saved simulation by pyfs-mesh inventory, read from an OBJ's groups by the plan when it has no sidecar, written by hand for an STL.",
"a list of names",
),
"file": InputKey(
"The file the inventory was read from, as pyfs-mesh inventory writes it; nothing reads it back.",
"a file name",
),
MESH_FACES_KEY: InputKey(
"The mesh's face count, counted when the inventory is taken from a saved simulation or an OBJ; the post carries it as MESH_FACES, and warns where the run's recorded sha256 of the geometry is not mesh_sha256 (FR-348).",
"a whole number",
),
BOUNDARY_FACES_KEY: InputKey(
"The face count of each boundary, in the order of boundaries, where the inventory's reader gives it; nothing reads it back.",
"a list of whole numbers",
),
MESH_SHA256_KEY: InputKey(
"The sha256 of the file the faces were counted in; the post warns where a run's recorded sha256 of the geometry differs from it.",
"a sha256, as text",
),
"thin_boundaries": InputKey(
"The boundaries the solver treats as thin surfaces, by their names in the boundary order; an empty list clears a saved selection. Absent, nothing is emitted.",
'a list of names, as thin_boundaries = ["Wing"]',
"SET_THIN_BOUNDARIES, DELETE_THIN_BOUNDARIES",
),
MESH_FRAME_KEY: InputKey(
"The frame the mesh is built in: what the mesh's +x, +y and +z point to. Absent means x aft, y right, z up, the expected frame; another right-handed axis-aligned frame is converted before the solver reads the mesh, and a left-handed one is refused.",
'a list of three words, as ["forward", "left", "up"]',
),
IMPORT_TABLE: InputKey(
"How a raw mesh is imported: the unit it is written in and the operations applied right after.",
"a table; see `[import]` below",
"IMPORT",
),
TRAILING_EDGES_TABLE: InputKey(
"How a raw mesh's trailing edges are marked, which every raw mesh a workflow imports declares.",
"a table; see `[trailing_edges]` below",
"IMPORT_WAKE_EDGES_FROM_FILE, AUTO_DETECT_TRAILING_EDGES, DETECT_TRAILING_EDGES_BY_SURFACE",
),
WAKE_TERMINATION_TABLE: InputKey(
"Detects a raw mesh's wake-termination nodes, only when written.",
"a table; see `[wake_termination]` below",
"AUTO_DETECT_WAKE_TERMINATION_NODES, DETECT_WAKE_TERMINATION_NODES_BY_SURFACE",
),
BASE_REGIONS_TABLE: InputKey(
"Detects a raw mesh's base regions over the whole mesh, only when written.",
"a table; see `[base_regions]` below",
"AUTO_DETECT_BASE_REGIONS",
),
}
pyflightstream.workspace.inputs.HPC_BUILD_ALIAS
module-attribute
¶
HPC_BUILD_ALIAS = 'fs_build_alias'
pyflightstream.workspace.inputs.HPC_FORMATS
module-attribute
¶
HPC_FORMATS = ('yaml', 'json', 'toml', 'text')
pyflightstream.workspace.inputs.HPC_LOG_KEYS
module-attribute
¶
HPC_LOG_KEYS: frozenset[str] = frozenset(
{"export_log", "native_log", "job_end_files"}
)
pyflightstream.workspace.inputs.HPC_PROFILE_KEYS
module-attribute
¶
HPC_PROFILE_KEYS: frozenset[str] = frozenset(
{
"application_id",
"descriptor",
"submit",
"defaults",
"builds",
"application_ids",
"walltime_arithmetic",
"log",
"max_walltime",
"job_root",
}
)
pyflightstream.workspace.inputs.HpcProfile
dataclass
¶
HpcProfile(
application_id: str,
descriptor_format: str,
descriptor_name: str,
fields: dict,
submit: tuple,
path: Path,
builds: dict = dict(),
application_ids: dict = dict(),
walltime_arithmetic: str = "wall",
export_log: bool = True,
native_log: str | None = None,
job_end_files: tuple[str, ...] = (),
max_walltime_s: float | None = None,
job_root: str = "{work_dir}",
)
How ONE cluster is asked to run a job (FR-99).
NO ROW CITES THIS. The code sees Linux and that is the cluster, so a study moves between machines by being opened on the other one and changing no cell.
Attributes:
| Name | Type | Description |
|---|---|---|
application_id |
str
|
The scheduler's own name for the application, for every build
|
descriptor_format |
str
|
One of :data: |
descriptor_name |
str
|
What it is called inside the simulation folder. |
fields |
dict of str to str
|
The keys THIS cluster expects, in the order they are written, and
what pyflightstream puts in each. A value in braces is substituted.
A cluster that spells |
submit |
tuple of str
|
The command, argument by argument, never one string through a shell: a path with a space in it is then not a second argument. |
path |
Path
|
Where this was read from, for a refusal that has to name it. |
builds |
dict of str to str
|
What this scheduler calls each canonical build, read from the
|
application_ids |
dict of str to str
|
The application name per canonical build where it differs from
|
application_id_for
¶
application_id_for(build: object) -> str
Return the application name the descriptor writes for build.
The line of [application_ids] for that canonical build when the
profile has one, otherwise the top-level application_id.
pyflightstream.workspace.inputs.INPUT_KINDS
module-attribute
¶
INPUT_KINDS = (
"geometries",
"references",
"setups",
"pproc",
"profiles",
"freestreams",
"calibrations",
"hpc",
"fsi",
"matrices",
"management",
)
pyflightstream.workspace.inputs.INVENTORY_SUFFIX
module-attribute
¶
INVENTORY_SUFFIX = '.boundaries.toml'
pyflightstream.workspace.inputs.InputArtifactError
¶
InputArtifactError(
message: str,
*,
kind: str | None = None,
artifact_id: str | None = None,
available: tuple[str, ...] = (),
where: dict | None = None,
)
Bases: PyflightstreamError, RuntimeError
An input artifact cannot be resolved or validated.
Raised when an id is unknown (the message lists the available ids of that kind), when an artifact file does not validate against its model, or when a geometry or profile id matches more than one staged file. Input mistakes must surface at resolution time, before any solver run consumes the artifact.
Import it from :mod:pyflightstream.workspace, which owns the input
library it describes, or from :mod:pyflightstream.exceptions:
from pyflightstream.workspace import InputArtifactError
It is DEFINED here rather than there because two layers name it: the
workspace layer raises it, and the layers that bind a run matrix to
the input library catch it and re-raise with the row and the file
they were resolving. Defining it in the workspace package made the
lower one import upward, which is the deferred-import shape the
layering guard refuses (OPS-2007.02.01). The public name is
unchanged and so is the pair of bases, so except RuntimeError
catches exactly what it always did.
Attributes:
| Name | Type | Description |
|---|---|---|
kind |
str or None
|
Artifact kind of the failed resolution ( |
artifact_id |
str or None
|
The id that failed to resolve, when the refusal is a miss. |
available |
tuple of str
|
Ids that would have resolved for the kind, so callers can
offer choices without parsing the message. It is populated on a
NOT-FOUND refusal and is EMPTY on a refusal about the id's own
shape, which is about what the caller wrote rather than about
what the library holds. The distinction is stated because an
empty tuple would otherwise be read as an empty library;
|
where |
dict
|
Optional diagnostic locations: family names, zero-based mesh vertex
indices in |
pyflightstream.workspace.inputs.KIND_COLUMNS
module-attribute
¶
KIND_COLUMNS = {
"reference": "REF",
"setup": "SET",
"pproc": "PPROC",
}
pyflightstream.workspace.inputs.KIND_LETTERS
module-attribute
¶
KIND_LETTERS = {
"reference": "r",
"setup": "s",
"pproc": "p",
}
pyflightstream.workspace.inputs.LOCAL_EXECUTABLES_FILE
module-attribute
¶
LOCAL_EXECUTABLES_FILE = 'executables.local.toml'
pyflightstream.workspace.inputs.PROVENANCE_SUFFIX
module-attribute
¶
PROVENANCE_SUFFIX = '.provenance.toml'
pyflightstream.workspace.inputs.PointXyz
¶
Bases: BaseModel
One point in the simulation geometry reference frame, meters.
Attributes:
| Name | Type | Description |
|---|---|---|
x_m |
float
|
X coordinate in m. |
y_m |
float
|
Y coordinate in m. |
z_m |
float
|
Z coordinate in m. |
kind |
str or None
|
What the point is, |
pyflightstream.workspace.inputs.PprocArtifact
¶
Bases: PprocSpec
The post-processing artifact (inputs/pproc/<id>.toml).
PFS-2029.07.01, the groups artifact IS the
home of post-processing and is renamed. The file carries twelve tables,
every one optional: [groups] maps each product name to one alias string;
define several members in the reference's [aliases] table;
[exports] which of the export kinds a point writes, where the
loads table and the saved simulation cannot be switched off and a steady point's solver
plots (plot_residuals,
plot_loads, plot_sections_cp) can;
[sections], [plots] and [[probes]] the solver definitions
the builders emit; [products] the post-processed files written
after the run; [phase_locked], [equations],
[glossary] and [names], which the post stage reads;
[time_averaging] the surface window; and [volume_section], the one flow-field plane
a steady point cuts and
exports. Group aliases are stored
verbatim and resolved by the script layer at emission time. Member lists,
including empty lists, are refused. The
shape is
:class:pyflightstream.cases.PprocSpec; this class is the file.
Validation refusals raise :class:InputArtifactError, including refusals
from nested tables. Field constraints retain the invalid field's location;
the artifact loader adds the source file's path.
Examples:
Use the built-in all only when no reference alias or boundary has that
name; otherwise declare a unique reference alias with the intended members.
The input is one string; the model normalizes it to a one-member list.
TOTAL and AIRFRAME are automatic groups; custom groups use other names.
>>> PprocArtifact(groups={"ALL_SURFACES": "all"}).groups
{'ALL_SURFACES': ['all']}
>>> PprocArtifact(groups={"WING_BODY": "wing_body"}).groups
{'WING_BODY': ['wing_body']}
pyflightstream.workspace.inputs.RAW_MESH_CONDITION_KEYS
module-attribute
¶
RAW_MESH_CONDITION_KEYS: Mapping[
str, Mapping[str, InputKey]
] = {
TRAILING_EDGES_TABLE: {
"files": InputKey(
"Ordered points files, each with its own trailing-edge type.",
"a nonempty list of file/type tables",
"IMPORT_WAKE_EDGES_FROM_FILE",
),
"none": InputKey(
"Explicitly declares a body without a trailing edge; no wake is generated by it.",
"true, alone in the table",
"",
),
"file": InputKey(
"The points file beside the sidecar holding the mid-point of every trailing-edge mesh edge, under a line naming their length unit; the default route.",
"a file name",
"IMPORT_WAKE_EDGES_FROM_FILE",
),
"type": InputKey(
"The edge type every point of the file is given.",
'text, default `"STANDARD"`',
"IMPORT_WAKE_EDGES_FROM_FILE",
),
"tolerance": InputKey(
"The distance within which an edge's mid-point counts as a point of the file.",
"m, > 0, default `0.0001`",
"IMPORT_WAKE_EDGES_FROM_FILE",
),
"detect": InputKey(
"Marks the edges by the solver's detection instead of a file, over every surface or on the surfaces named.",
'`"auto"`, or a table; see `detect = { ... }` below',
"AUTO_DETECT_TRAILING_EDGES, DETECT_TRAILING_EDGES_BY_SURFACE",
),
},
WAKE_TERMINATION_TABLE: {
"file": InputKey(
"Explicit wake-termination node coordinates.",
"a file name",
"SELECT_MESH_NODE, MARK_WAKE_TERMINATION_NODES",
),
"tolerance": InputKey(
"Maximum distance to exactly one mesh vertex.",
"m, > 0",
"SELECT_MESH_NODE",
),
"detect": InputKey(
"Detects the wake-termination nodes over every surface, or on the surfaces named.",
'`"auto"`, or `{ surfaces = ["<name>"] }`',
"AUTO_DETECT_WAKE_TERMINATION_NODES, DETECT_WAKE_TERMINATION_NODES_BY_SURFACE",
),
},
BASE_REGIONS_TABLE: {
"detect": InputKey(
"Detects the base regions over the whole mesh; a named boundary is the row's BASE_REGIONS key's.",
'`"auto"`',
"AUTO_DETECT_BASE_REGIONS",
)
},
}
pyflightstream.workspace.inputs.RAW_MESH_CONDITION_TABLES
module-attribute
¶
RAW_MESH_CONDITION_TABLES = (
TRAILING_EDGES_TABLE,
WAKE_TERMINATION_TABLE,
BASE_REGIONS_TABLE,
)
pyflightstream.workspace.inputs.ROTOR_FACT_KEYS
module-attribute
¶
ROTOR_FACT_KEYS: tuple[str, ...] = (
"rotation",
"blade_travel",
"rpm_sign_installed",
"rpm_sign_isolated",
)
pyflightstream.workspace.inputs.ReferenceArtifact
¶
Bases: BaseModel
Reference data of one configuration (inputs/references/<id>.toml).
Attributes:
| Name | Type | Description |
|---|---|---|
area_m2 |
float
|
Reference area S_ref in m^2; must be positive. |
chord_m |
float
|
Reference chord c_ref in m; must be positive. |
span_m |
float
|
Reference span b_ref in m; must be positive. |
rotor_diameter_m |
(float, optional)
|
Rotor diameter D in m; must be positive. IT LIVES HERE, BESIDE THE OTHER THREE LENGTHS, and not in
:class: Optional because a configuration with no rotor has no diameter, and stating a placeholder would be worse than stating nothing. A row asking for an advance ratio without it is refused naming this field. |
moment_point |
PointXyz
|
Moment reference point in the simulation geometry frame, m. |
body_axes |
dict of str to str
|
Which model axis, |
rotor |
(RotorReference, optional)
|
Rotor block, present for propulsive configurations. |
aliases |
dict of str to list of str
|
Names for groups of boundaries, each standing for the boundary names, families or aliases listed under it. |
frames |
list of FrameSpec
|
The custom coordinate systems of the configuration, in the order written. |
rotors |
dict of str to RotorBlock
|
One rotor per top-level table stating |
actuators |
dict of str to ActuatorBlock
|
One actuator disc per top-level table stating |
points |
dict of str to PointXyz
|
One named point per top-level table stating another point |
pyflightstream.workspace.inputs.RegisteredBuild
dataclass
¶
RegisteredBuild(
fs_exe: Path,
fs_version: str | None,
accept_unregistered_build: bool = False,
)
One entry of the workspace build registry, as the registry states it.
Attributes:
| Name | Type | Description |
|---|---|---|
fs_exe |
Path
|
The executable this build id names. Existence is checked by the executor at construction, so a campaign can be authored away from the licensed machine. |
fs_version |
str or None
|
The FlightStream version the registry DECLARES this build's
scripts are emitted under, canonical identifier ( It is a DECLARATION and never an inference. Nothing here reads a
version out of the executable path or out of the build id, which
is the rule :class: |
accept_unregistered_build |
bool
|
The entry of this machine's overlay accepts the build installed at
|
pyflightstream.workspace.inputs.RotorReference
¶
Bases: BaseModel
The recorded rotor of a reference artifact ([rotor]).
Attributes:
| Name | Type | Description |
|---|---|---|
radius_m |
(float, optional)
|
Rotor radius. Optional (PFS-2029.05): the diameter at the artifact's root is the length the package reads, and a radius stated beside it must be half of it. |
hub_radius_m |
(float, optional)
|
Hub radius. |
n_blades |
int
|
The RESOLVED blade count of the mesh a row opens, not the physical one: a periodic sector meshing one blade states 1 and the row's symmetry supplies the wheel. |
pitch_deg, toe_deg |
(float, optional)
|
Recorded installation angles; read by nothing in the package. |
position |
PointXyz
|
The rotor position, the one field of this block a builder
reads: the two unsteady run types turn it into the rotor's hub frame
(PFS-2030.03), the frame the reference probe lines and rotor plots
are defined in and the frame a rotor row turns about unless it
states |
Rotor motion belongs to the row, not the reference block (PFS-2029.08). The reference declares |
|
|
geometry; the builder reads the row's motion declaration. |
|
pyflightstream.workspace.inputs.SIDECAR_SUFFIXES
module-attribute
¶
SIDECAR_SUFFIXES = (
INVENTORY_SUFFIX,
PROVENANCE_SUFFIX,
INSTRUCTION_SUFFIX,
BUILD_RECORD_SUFFIX,
)
pyflightstream.workspace.inputs.SetupArtifact
¶
Bases: BaseModel
A named solver-setup preset (inputs/setups/<id>.toml).
The file's solver fields are validated at read time with SolverSettings.
The raw values remain in :attr:settings alongside non-solver entries
for matrix binding, without inserting defaults or coercing stored values.
Attributes:
| Name | Type | Description |
|---|---|---|
settings |
dict
|
The raw TOML table of the preset, verbatim (keys are setting names, values are TOML scalars, arrays, or nested tables). |
pyflightstream.workspace.inputs.StudyVocabulary
¶
Bases: BaseModel
The surfaces of a study, [study] surfaces of a reference artifact (FR-980).
One setup, one pproc and one reference may serve every model of a study only if a name one model lacks can be told from a misspelling. The table is where the study says which names it uses: with the reference's aliases and their members it is the vocabulary a cited name is judged against.
Attributes:
| Name | Type | Description |
|---|---|---|
surfaces |
tuple of str
|
The boundary names or family words the models of the study carry, at least one. |
pyflightstream.workspace.inputs.TRAILING_EDGES_TABLE
module-attribute
¶
TRAILING_EDGES_TABLE = 'trailing_edges'
pyflightstream.workspace.inputs.TRAILING_EDGE_DETECT_KEYS
module-attribute
¶
TRAILING_EDGE_DETECT_KEYS: Mapping[str, InputKey] = {
"surfaces": InputKey(
"The surfaces to detect on, by the sidecar's names.",
'a list of names, or `"all"` for every surface',
"DETECT_TRAILING_EDGES_BY_SURFACE",
),
"sweep_angle": InputKey(
"The sweep angle set before the detection, only when stated.",
"deg",
"SET_TRAILING_EDGE_SWEEP_ANGLE",
),
"bluntness_angle": InputKey(
"The bluntness angle set before the detection, only when stated; refused on a build whose command database has no row for the command.",
"deg",
"SET_TRAILING_EDGE_BLUNTNESS_ANGLE",
),
}
pyflightstream.workspace.inputs.WAKE_TERMINATION_TABLE
module-attribute
¶
WAKE_TERMINATION_TABLE = 'wake_termination'
pyflightstream.workspace.inputs.WALLTIME_ARITHMETIC
module-attribute
¶
WALLTIME_ARITHMETIC: frozenset[str] = frozenset(
{"wall", "seconds"}
)
pyflightstream.workspace.inputs.available_ids
¶
available_ids(
directory: Path, suffix: str | None = ".toml"
) -> list[str]
List the artifact ids present in one library directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
directory
|
Path
|
One |
required |
suffix
|
str
|
Restrict to files with this extension (default |
'.toml'
|
Returns:
| Type | Description |
|---|---|
list of str
|
Sorted file name stems; empty when the directory is missing. |
pyflightstream.workspace.inputs.boundaries_for_matrix
¶
boundaries_for_matrix(geometry: str | Path) -> Path
Locate a saved simulation's inventory in the matrix's declared reading order.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
geometry
|
str or Path
|
Saved simulation whose adjacent sidecars are searched. |
required |
Returns:
| Type | Description |
|---|---|
Path
|
First existing sidecar, or the qualified FSM path when none exists. |
pyflightstream.workspace.inputs.clean_saved_actions
¶
clean_saved_actions(
geometry: str | Path, *, stamp: str
) -> CleanedGeometry
Reduce a saved simulation to its meshes and applied boundary conditions (FR-308, FR-312).
The saved unsteady solver actions are removed (FR-308), and every block
:data:pyflightstream._fsm_fresh.FRESH_IMPORT measures for the file's
build and length unit is put back to its fresh-import content (FR-312);
the blocks of :data:pyflightstream._fsm_fresh.KEPT_BLOCKS never change.
The file as it was is copied to <name>.bak-<stamp> beside it first,
the new text replaces it through a temporary file, and it is read again:
its boundary names and every kept block must be as before and its action
records must read as none, or the copy is put back and the call refused.
A file already clean is not written.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
geometry
|
str or Path
|
A saved simulation. |
required |
stamp
|
str
|
The suffix of the backup's name, the caller's timestamp. |
required |
Returns:
| Type | Description |
|---|---|
CleanedGeometry
|
The actions removed, the blocks reset, the note when no block was measured, and the backup, which is None when nothing changed. |
Raises:
| Type | Description |
|---|---|
InputArtifactError
|
A file that cannot be read, that has no closed SOLVER block, whose actions do not hold their shape, whose measured blocks are missing, or which did not read back as it should. |
pyflightstream.workspace.inputs.descriptor_name_refusal
¶
descriptor_name_refusal(
name: str, source: object
) -> str | None
Why name cannot name a submission descriptor, or None when it can.
The descriptor is written in the folder each point runs in, so its name
is a plain file name: no folder, no parent folder, and no form Windows
reads as another file's, any of which would put it on a file another
point's record names. source names the profile in the sentence.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The descriptor name the profile states. |
required |
source
|
object
|
The profile (usually its path), named in the refusal sentence. |
required |
Returns:
| Type | Description |
|---|---|
str or None
|
The sentence that says why |
pyflightstream.workspace.inputs.ensure_inventory
¶
ensure_inventory(
geometry: str | Path,
*,
kind: Literal["obj", "fsm"] | None = None,
) -> Path
Return the boundary sidecar beside a geometry, writing an OBJ's from its groups (G30).
THE ONE PLACE A SIDECAR IS ASKED FOR. The matrix binding, which
pyfs-matrix plan and pyfs-matrix run both pass through, and
pyfs-mesh inventory (:func:write_inventory) reach the sidecar
through this function, so an OBJ is treated alike wherever a user
meets it:
- an OBJ with no sidecar gets one, its
boundariesread by :func:obj_boundary_namesunder a comment header naming the file's sha256 and RPT-078, and a line on stderr says so. It carries the list and nothing else: the[import]units and the trailing edges, which only the user can state, go beneath it. - an OBJ with a sidecar keeps it, never rewritten, because the file
may carry tables and names the user wrote. When its
boundariesdiffer from the groups, in names or in order, the run cites the sidecar's, as before, and a warning names both lists; when the groups cannot be read, the sidecar written by hand is that file's route and nothing is said. - any other geometry is left as it was: a saved simulation's sidecar
is written by
pyfs-mesh inventoryfrom its mesh block, and an STL's by hand.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
geometry
|
str or Path
|
The geometry the sidecar sits beside. |
required |
kind
|
('obj', 'fsm')
|
Filename kind for inventory writers; None preserves legacy run callers. |
"obj"
|
Returns:
| Type | Description |
|---|---|
Path
|
The sidecar beside |
Raises:
| Type | Description |
|---|---|
InputArtifactError
|
An OBJ with no sidecar whose groups cannot be read
(:func: |
Warns:
| Type | Description |
|---|---|
PyflightstreamWarning
|
An OBJ whose sidecar's |
pyflightstream.workspace.inputs.hpc_profiles
¶
hpc_profiles(inputs_dir: str | Path) -> list[Path]
Every HPC profile a workspace carries, sorted.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputs_dir
|
str or Path
|
The workspace |
required |
Returns:
| Type | Description |
|---|---|
list of Path
|
The profile files in name order; empty when the folder is absent or holds none. |
pyflightstream.workspace.inputs.inventory_sidecar
¶
inventory_sidecar(
geometry: str | Path,
kind: Literal["obj", "fsm"] | None = None,
) -> Path
Return the sidecar path beside geometry, whether or not it exists.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
geometry
|
str or Path
|
The geometry file. |
required |
kind
|
('obj', 'fsm')
|
Include the geometry kind for new inventories. With None, find an existing kind-qualified inventory, otherwise return the legacy name. The matrix's cross-kind fallback belongs to its own resolver. |
"obj"
|
Returns:
| Type | Description |
|---|---|
Path
|
The |
pyflightstream.workspace.inputs.is_valid_artifact_id
¶
is_valid_artifact_id(artifact_id: str) -> bool
Whether a string is well formed as an input-library id.
THE ONE HOME OF THE SHAPE RULE, published rather than left private because two layers need to ask it and the alternative was reaching for the private pattern across a module boundary, which a tier 1 guard refuses by design: an underscore-private name crossing into a public sibling is a layer boundary crossed for a helper.
An id is a file name STEM: letters, digits, dot, underscore or hyphen, beginning with a letter or a digit. It is never a path, and the leading-character half is the part a caller cannot infer from the permitted set, which is why a refusal that merely lists the permitted characters sends a user back to make the same mistake.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
artifact_id
|
str
|
The candidate id, as the matrix cell or the caller wrote it. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True when the shape is acceptable. It says nothing about whether
anything is STAGED under that id, which is
:func: |
Examples:
>>> is_valid_artifact_id("wing_clean")
True
>>> is_valid_artifact_id("blade.v2")
True
>>> is_valid_artifact_id("_scratch")
False
pyflightstream.workspace.inputs.obj_boundary_names
¶
obj_boundary_names(path: str | Path) -> tuple[str, ...]
Return measured OBJ boundary names in native order, preserving duplicates.
RPT-078 established face-bearing groups. GOAL-033 controls on 26.124, build 8172026 additionally measured an o-to-g transition, repeated g groups, a face prefix before the first g, and multiple names in a g statement. The latter uses only its first name, with a warning.
Repeated g groups remain separate boundaries; ambiguous labels must be selected by position downstream. Reverse g-to-o transitions, repeated o names, unnamed groups and multiword o names remain unmeasured here.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str or Path
|
The OBJ mesh file, read as UTF-8 text. |
required |
Returns:
| Type | Description |
|---|---|
tuple of str
|
The group names in the order the file opens them, repeated names kept. |
Raises:
| Type | Description |
|---|---|
InputArtifactError
|
If the file cannot be read as text, holds no face under a measured
group, or uses a variant that has not been measured (a group with no
name or several words after |
pyflightstream.workspace.inputs.read_hpc_profile
¶
read_hpc_profile(path: str | Path) -> HpcProfile
Read one HPC profile, refusing what it cannot act on.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
path
|
str or Path
|
The profile file, a TOML document. |
required |
Returns:
| Type | Description |
|---|---|
HpcProfile
|
The profile read from the file. |
Raises:
| Type | Description |
|---|---|
InputArtifactError
|
If the file is not valid TOML, lacks the scheduler's application name, asks for a descriptor format or walltime arithmetic this package does not write, names a descriptor that is not a plain file name, lists no descriptor fields or no submit command, states a key this package does not read (or one it owns under the wrong table), states descriptor, submit or log as something other than a table, or states export_log as anything but true or false. |
pyflightstream.workspace.inputs.read_inventory
¶
read_inventory(sidecar: str | Path) -> tuple[str, ...]
Return the ordered boundary names a sidecar states.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sidecar
|
str or Path
|
The |
required |
Returns:
| Type | Description |
|---|---|
tuple of str
|
The boundary names in the order the sidecar lists them. |
Raises:
| Type | Description |
|---|---|
InputArtifactError
|
A sidecar without a |
pyflightstream.workspace.inputs.read_marking_record
¶
read_marking_record(
geometry: str | Path,
) -> dict[str, Any] | None
Read a marking record and refuse changed or missing recorded inputs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
geometry
|
str or Path
|
Geometry beside the marking record. |
required |
Returns:
| Type | Description |
|---|---|
dict or None
|
Validated record, or None when no record exists. |
Raises:
| Type | Description |
|---|---|
InputArtifactError
|
The record is unreadable or its input digests no longer match. |
pyflightstream.workspace.inputs.read_mesh_frame
¶
read_mesh_frame(
sidecar: str | Path,
) -> tuple[str, str, str] | None
Return the mesh_frame a geometry's sidecar declares, or None where it states none.
The key is a list of three words, what the mesh's +x, +y and +z point to,
as mesh_frame = ["forward", "left", "up"]. pyflightstream expects
["aft", "right", "up"], and an absent key means exactly that, with no note.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sidecar
|
str or Path
|
The |
required |
Returns:
| Type | Description |
|---|---|
tuple of str or None
|
The three words, lower case; None when the sidecar is absent or states no frame. |
Raises:
| Type | Description |
|---|---|
InputArtifactError
|
A declaration that is not three accepted words naming three axes, or that is left-handed, naming the sidecar and the declaration. |
pyflightstream.workspace.inputs.read_mesh_import
¶
read_mesh_import(sidecar: str | Path) -> MeshImport | None
Return the [import] table a geometry's sidecar states, or None (G01, G03).
The table states the length unit a raw mesh is written in, and the mesh operations applied right after the import, in the order written::
boundaries = ["naca"]
[import]
units = "MILLIMETER"
[[import.operations]]
op = "rename"
surface = "naca"
to = "Wing"
Read at binding, beside :func:read_inventory, so a table that does
not hold its shape is refused with the row before any seat is spent,
an operation named by its position. Whether the unit is one IMPORT
takes, whether the geometry is a raw mesh at all, and whether each
cited surface exists at its step, is the builder's to judge, per build.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sidecar
|
str or Path
|
The |
required |
Returns:
| Type | Description |
|---|---|
MeshImport or None
|
None when the file holds no |
Raises:
| Type | Description |
|---|---|
InputArtifactError
|
A file that does not read as TOML, an |
pyflightstream.workspace.inputs.refuse_empty_selections
¶
refuse_empty_selections(
kind: str,
path: Path,
data: Mapping[str, Any],
*,
rules: Sequence[EntitySelection] = ENTITY_SELECTIONS,
) -> None
Refuse an artifact stating an empty list for an entity-selecting key.
PFS-2005.02. Called by the readers before the model validates, so the refusal names the artifact FILE, the key as the file spells it, and what the empty list would have disabled, with the domain seat's verdict beside it. The model's own validators stay: they guard the Python path, and this guards the file a matrix row names.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
kind
|
str
|
|
required |
path
|
Path
|
The artifact file, for the message. |
required |
data
|
mapping
|
The file's TOML table as loaded. |
required |
rules
|
sequence of EntitySelection, keyword-only
|
The verdicts the plain keys are judged by, :data: |
ENTITY_SELECTIONS
|
Raises:
| Type | Description |
|---|---|
InputArtifactError
|
The first key stated empty whose verdict is not "admitted". |
pyflightstream.workspace.inputs.resolve_build
¶
resolve_build(
inputs_dir: Path,
build_id: str,
override: str | Path | None = None,
) -> RegisteredBuild
Read the registry entry of one build id: its executable and its version.
Two explicit modes, translated from the run matrix's MANUAL pattern:
- Registry mode (default): the build id must exist in
inputs/executables.toml, a top-level TOML table mapping build ids to entries. - Override mode: an explicit
overridepath wins over the registry and is the only way to run an unregistered build; it is never guessed from the environment. An override declares NO version, because it is a bare path with no registry entry behind it to carry one.
TWO ENTRY SHAPES, and the difference is what a build may say about itself:
"26.120" = "C:/fs26120/FlightStream.exe"is the shape this registry has always had and means exactly what it meant: the build id names an executable and declares no version, so a campaign that sends a row to it emits that row's script under the campaign default version."26.123" = { path = "C:/fs26123/FlightStream.exe", version = "26.123" }declares the version as well, which is what lets ONE run matrix send its rows to two solver builds and record each row against the version its own build emits under (PFS-2009.05).
The table is where the declaration lives because it is already the
file in which the user says what a build id MEANS on this machine.
Deriving the version from the build id instead would be the
inference :class:pyflightstream.run.SolverBuild refuses, and the
two are not the same thing: a registry key is a name the campaign
user chose, and nothing stops it naming an installation whose
command database is anything at all.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputs_dir
|
Path
|
The workspace |
required |
build_id
|
str
|
Build identifier key of the registry, for example |
required |
override
|
str or Path
|
Explicit executable path bypassing the registry. |
None
|
Returns:
| Type | Description |
|---|---|
RegisteredBuild
|
The executable, and the declared version or None. |
Raises:
| Type | Description |
|---|---|
InputArtifactError
|
Registry file missing; build id not registered (the message
lists the registered build ids and the override mode); an entry
that is neither a path string nor a table; a table with no
|
Examples:
>>> from pyflightstream.workspace.inputs import resolve_build
>>> build = resolve_build(workspace.inputs_dir, "26.123")
>>> build.fs_version
'26.123'
pyflightstream.workspace.inputs.resolve_executable
¶
resolve_executable(
inputs_dir: Path,
build_id: str,
override: str | Path | None = None,
) -> Path
Resolve the FlightStream executable of one build id.
The path half of :func:resolve_build, which is where the registry
is read and where both entry shapes are described. This is the call
for a caller who wants the executable and nothing else; a caller who
also needs the version the build declares calls
:func:resolve_build instead, because the two facts come from one
entry and reading it twice is how they would drift apart.
Existence of the executable is checked by the executor at construction (so campaigns can be authored away from the licensed machine), not here.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputs_dir
|
Path
|
The workspace |
required |
build_id
|
str
|
Build identifier key of the registry, for example |
required |
override
|
str or Path
|
Explicit executable path bypassing the registry. |
None
|
Returns:
| Type | Description |
|---|---|
Path
|
The executable path. |
Raises:
| Type | Description |
|---|---|
InputArtifactError
|
Every refusal of :func: |
pyflightstream.workspace.inputs.resolve_geometry
¶
resolve_geometry(inputs_dir: Path, name: str) -> Path
Resolve the staged geometry file one GEOMETRY cell names.
THE CELL CARRIES THE FILE NAME WITH ITS EXTENSION
(PFS-2029.09, amending
PFS-2009.01): 30_WB.fsm resolves to inputs/geometries/30_WB.fsm
and blade.v2.fsm to that one file, one reading and no other. What
it buys is that the cell says what the file IS: a .fsm is a saved
simulation with its boundary conditions in it, a mesh is not, and the
workflow can tell the two apart before any seat is spent.
TWO LAYOUTS, THE FOLDER READ FIRST (PFS-2032.04). 30_WB.fsm resolves to
geometries/30_WB/30_WB.fsm when that folder exists and to
geometries/30_WB.fsm otherwise, so the cell does not change and
no matrix written breaks. What the folder buys is a home
for the files that belong to one geometry: its boundary inventory and
its provenance record sit beside it, and a point staged from the
folder shows that geometry's files and never the whole library
(:meth:~pyflightstream.workspace.CampaignWorkspace.stage_inputs).
The flat layout remains supported.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputs_dir
|
Path
|
The workspace |
required |
name
|
str
|
File name, extension included, of a file directly under
|
required |
Returns:
| Type | Description |
|---|---|
Path
|
The geometry file. |
Raises:
| Type | Description |
|---|---|
InputArtifactError
|
A bare stem (no extension), naming every staged file that carries that stem so the cell can be completed; a name the library does not hold, naming the files it does; a path, which is never an id. |
Examples:
>>> import tempfile
>>> from pathlib import Path
>>> from pyflightstream._errors import InputArtifactError
>>> from pyflightstream.workspace.inputs import resolve_geometry
>>> with tempfile.TemporaryDirectory() as folder:
... geometries = Path(folder) / "geometries"
... geometries.mkdir()
... _ = (geometries / "wing.fsm").write_text("")
... print(resolve_geometry(Path(folder), "wing.fsm").name)
... try:
... resolve_geometry(Path(folder), "wing")
... except InputArtifactError:
... print("a bare stem is refused")
wing.fsm
a bare stem is refused
pyflightstream.workspace.inputs.resolve_hpc_profile
¶
resolve_hpc_profile(
inputs_dir: str | Path,
) -> HpcProfile | None
Return the profile of the cluster this workspace is on, or None.
ONE PROFILE NEEDS NO SELECTOR. A workspace carrying several and no
selection (:func:select_hpc_profile, CLI --hpc NAME) is REFUSED
rather than guessed, because guessing spends a queue.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputs_dir
|
str or Path
|
The workspace |
required |
Returns:
| Type | Description |
|---|---|
HpcProfile or None
|
The selected profile, else the profile of the one cluster the workspace carries, or None when it carries no profile. |
Raises:
| Type | Description |
|---|---|
InputArtifactError
|
If a selection names no profile of the folder, if the folder holds
more than one profile and none is selected, or the profile is refused
by :func: |
pyflightstream.workspace.inputs.resolve_pproc
¶
resolve_pproc(
inputs_dir: Path, artifact_id: str
) -> PprocArtifact
Load the post-processing artifact one id names.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputs_dir
|
Path
|
The workspace |
required |
artifact_id
|
str
|
File name stem under |
required |
Returns:
| Type | Description |
|---|---|
PprocArtifact
|
The validated artifact, group members stored verbatim. |
Raises:
| Type | Description |
|---|---|
InputArtifactError
|
Unknown id (the message lists the available ids), a file that does not validate, or a file in the shape the groups artifact had, which is named with the command that moves it. |
Notes
An old-shape groups file is told by its BARE LISTS: a group name to
its members at the top level, with no [groups] table. The
top-level base_regions list is refused by name before that check,
naming the boundaries file and the row's BASE_REGIONS column (PFS-2252),
so it is never read as a legacy group.
pyflightstream.workspace.inputs.resolve_profile
¶
resolve_profile(inputs_dir: Path, artifact_id: str) -> Path
Resolve the input profile file one id names.
Profiles (for example actuator thrust distributions) register by file name; the id is the stem.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputs_dir
|
Path
|
The workspace |
required |
artifact_id
|
str
|
File name stem under |
required |
Returns:
| Type | Description |
|---|---|
Path
|
The profile file. |
Raises:
| Type | Description |
|---|---|
InputArtifactError
|
Unknown id (the message lists the available ids) or an ambiguous stem shared by several files. |
pyflightstream.workspace.inputs.resolve_reference
¶
resolve_reference(
inputs_dir: Path, artifact_id: str
) -> ReferenceArtifact
Load the reference artifact one id names.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputs_dir
|
Path
|
The workspace |
required |
artifact_id
|
str
|
File name stem under |
required |
Returns:
| Type | Description |
|---|---|
ReferenceArtifact
|
The validated reference data (SI units in the field names). |
Raises:
| Type | Description |
|---|---|
InputArtifactError
|
Unknown id (the message lists the available ids) or a file that does not validate. |
pyflightstream.workspace.inputs.resolve_setup
¶
resolve_setup(
inputs_dir: Path, artifact_id: str
) -> SetupArtifact
Load the solver-setup preset one id names.
Recognized solver fields are validated with SolverSettings before returning
the raw table in :attr:SetupArtifact.settings. Non-solver entries retain
their later matrix-binding validation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
inputs_dir
|
Path
|
The workspace |
required |
artifact_id
|
str
|
File name stem under |
required |
Returns:
| Type | Description |
|---|---|
SetupArtifact
|
The preset with its raw settings table. |
Raises:
| Type | Description |
|---|---|
InputArtifactError
|
Unknown id (the message lists the available ids) or invalid TOML or solver settings outside the model's declared bounds. |
pyflightstream.workspace.inputs.rotor_integration_groups
¶
rotor_integration_groups(
rotors: Mapping[str, object],
declared: Mapping[str, Sequence[int | str]],
) -> dict[str, list[int | str]]
Return the pproc's groups with one integration group per DECLARED rotor.
an integration group is always created for each rotor that does not already have one.
WHY IT IS CREATED RATHER THAN REQUIRED. The rotor table integrates thrust and torque over ONE rotor's own families. Left to a user remembering to declare the group, the coefficient and the group are two lists kept in step by hand, and the day they drift one rotor's thrust is reported under another rotor's coefficient -- a number that looks right and is wrong, which is the same class as a rotor turning the wrong way. Created from the rotor itself, the group and the coefficient agree by construction.
THE CREATED GROUP IS A NORMAL GROUP. It takes the rotor's ALIAS as its name and the rotor's own families as its members, general families first and then the blades, so it produces its own products like any other group. A group that exists but is invisible is the kind of thing nobody can debug.
A GROUP THE USER DECLARED IS NEVER REPLACED. Creation fills a gap; it does not overrule what the user wrote.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rotors
|
mapping of str to object
|
The pproc's rotor blocks by alias; each block's |
required |
declared
|
mapping of str to sequence of int or str
|
The groups the pproc declares, by name, with their members. A group whose only member names a rotor is read as that rotor's families. |
required |
Returns:
| Type | Description |
|---|---|
dict of str to list of int or str
|
The declared groups, with each rotor's integration group added under the rotor's alias when none was declared. |
Raises:
| Type | Description |
|---|---|
CampaignConfigError
|
If a DECLARED group takes a rotor's alias and its members are not that rotor's families. The two then disagree about what the alias means, and silently preferring either one attributes one rotor's loads to another rotor's coefficient. The message names BOTH sets, because a refusal that names only the alias sends the reader to two files to find out which half is wrong. |
pyflightstream.workspace.inputs.stage_mesh_frame
¶
stage_mesh_frame(
sim_dir: str | Path, geometry: str | Path
) -> str | None
Convert the geometry to the expected frame inside the simulation folder, if declared.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sim_dir
|
str or Path
|
The simulation's folder. |
required |
geometry
|
str or Path
|
The mesh as the library holds it. |
required |
Returns:
| Type | Description |
|---|---|
str or None
|
The converted copy's path, absolute, when the mesh is declared in another frame; None otherwise, and the run opens the library's file as before. |
Raises:
| Type | Description |
|---|---|
InputArtifactError
|
As :func: |