pyflightstream.cases.farfield_inputs (provisional)¶
Generated from the docstrings at build time: every one of the 10 names in the __all__ of pyflightstream.cases.farfield_inputs has an entry below. The names a guide or an example uses come first; the others follow under Advanced.
What each far-field analysis of a row needs, and whether it is reused, added or refused.
Pipeline role: the ONE resolver of the far-field inputs (FR-455), called by
the plan and by post so the two cannot disagree. From the pproc artifact, the
row's run type and its facts, it states for every selected analysis and every
input one of four states: reused (the artifact declares it), added
(the plan adds it), not_applicable (the analysis does not apply to the run
type, FR-1059) or refused (it cannot be produced, FR-1049), each with
its source and its reason. It reads nothing from disk and imports no layer
above cases.
Advanced¶
pyflightstream.cases.farfield_inputs.FARFIELD_STATES
module-attribute
¶
FARFIELD_STATES: tuple[str, ...] = (
"reused",
"added",
"not_applicable",
"refused",
)
pyflightstream.cases.farfield_inputs.FarfieldInput
dataclass
¶
FarfieldInput(
analysis: str,
input: str,
state: str,
source: str = "",
reason: str = "",
entry: str = "",
variant: str = "",
)
One input of one analysis and how the row gets it.
Attributes:
| Name | Type | Description |
|---|---|---|
analysis |
str
|
|
input |
str
|
What the analysis reads: |
state |
str
|
One of :data: |
source |
str
|
The declaration reused, or what the plan adds. |
reason |
str
|
Why the input is not applicable or refused; empty otherwise. |
entry, variant |
str
|
The requesting entry's name and public variant, assigned by the workflow. |
pyflightstream.cases.farfield_inputs.FarfieldResolution
dataclass
¶
FarfieldResolution(
inputs: tuple[FarfieldInput, ...] = tuple(),
)
Every input of every selected analysis of one row.
refused
property
¶
refused: tuple[FarfieldInput, ...]
The inputs that cannot be produced; any one stops the plan.
state_of
¶
state_of(analysis: str) -> str
Return the analysis's state: refused, not_applicable, or ready (reused and added).
as_record
¶
as_record() -> dict[str, object]
Return the row's farfield object of plan.json (FR-1047).
pyflightstream.cases.farfield_inputs.ROTOR_RUN_TYPES
module-attribute
¶
ROTOR_RUN_TYPES = frozenset(
{"unsteady_rotor", "qsteady_rotor"}
)
pyflightstream.cases.farfield_inputs.STRIP_BIAS_PERCENT
module-attribute
¶
STRIP_BIAS_PERCENT: dict[int, float] = {
40: 1.05,
80: 0.52,
160: 0.26,
}
pyflightstream.cases.farfield_inputs.UNSTEADY_RUN_TYPES
module-attribute
¶
UNSTEADY_RUN_TYPES = frozenset(
{"unsteady", "unsteady_rotor"}
)
pyflightstream.cases.farfield_inputs.applies
¶
applies(
analysis: str, run_type: str, *, rotor: bool = False
) -> str
Return why analysis does not apply to run_type, or "" (FR-1059).
rotor marks a steady row whose far field is a rotor's.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
analysis
|
str
|
Far-field analysis name, such as trefftz:sections or trefftz:wake. |
required |
run_type
|
str
|
Resolved workflow name of the row. |
required |
rotor
|
bool
|
Whether the row describes a rotor rather than a wing configuration. |
False
|
Returns:
| Type | Description |
|---|---|
str
|
Reason the analysis is inapplicable, or an empty string when applicable. |
Examples:
>>> applies('trefftz:sections', 'steady')
''
>>> applies('trefftz:wake', 'unsteady')
''
pyflightstream.cases.farfield_inputs.few_stations_warning
¶
few_stations_warning(
family: str, per_side: int, stations: int
) -> str
Return the WARNING of a family traced on fewer stations than asked (FR-1019).
One sentence, said by the plan and by post alike: the family, its station
count per side, the count its [[farfields]] sections entry asks for, and the
strip bias of E_T the definitions page measured at the nearest count
(:data:STRIP_BIAS_PERCENT).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
family
|
str
|
The family the trace is of. |
required |
per_side
|
int
|
Its station count per side of the symmetry plane. |
required |
stations
|
int
|
The count per side its |
required |
Returns:
| Type | Description |
|---|---|
str
|
The sentence, or |
pyflightstream.cases.farfield_inputs.resolve_farfield
¶
resolve_farfield(
spec: FarfieldSpec,
*,
run_type: str,
covered_families: Collection[str],
selected_families: Sequence[str],
exports: dict[str, bool],
declares_lattice: bool,
declares_plane: bool,
coupled: bool,
admits_probes: bool,
has_command: Callable[[str], bool],
rotor: bool = False,
blade_loads: tuple[str, str] = ("", ""),
) -> FarfieldResolution
Resolve the inputs of every analysis spec selects for one row (FR-455).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
spec
|
FarfieldSpec
|
The row's named |
required |
run_type
|
str
|
The row's run type ( |
required |
covered_families
|
collection of str
|
The families a declared |
required |
selected_families
|
sequence of str
|
The families the |
required |
exports
|
dict of str to bool
|
The artifact's |
required |
declares_lattice
|
bool
|
Whether a |
required |
declares_plane
|
bool
|
Whether a |
required |
coupled
|
bool
|
Whether the row is a coupled FSI row. |
required |
admits_probes
|
bool
|
Whether the row type takes probes at all (a steady coupled row does not). |
required |
has_command
|
callable
|
Whether the selected build's command database records a command. |
required |
rotor
|
bool
|
Whether a steady row's far field is a rotor's (FR-1059). |
False
|
blade_loads
|
tuple of str
|
How a rotor row gets the blade sectional loads its disk total-pressure
correction reads (P0470-FFR): the state ( |
('', '')
|
Returns:
| Type | Description |
|---|---|
FarfieldResolution
|
Every input with its state, source and reason. |
pyflightstream.cases.farfield_inputs.traced_family
¶
traced_family(
families: Sequence[str], inventory: Sequence[str]
) -> str | None
Return the one family a section distribution cuts, or None (FR-1045, PFS-2081.100).
The one rule the plan and post share for whether a declared distribution
serves Trefftz A: the sectional-loads export holds one block per
distribution and plane, summed over the distribution's families, so only a
block of exactly one family can be traced. families is the block's
resolved list, where an empty list is the every-boundary form (all),
resolved against inventory; a block of several families is an aggregate
no export decomposes, and is not reused.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
families
|
sequence of str
|
The families of one block, as the script records them. |
required |
inventory
|
sequence of str
|
The geometry's families, which |
required |
Returns:
| Type | Description |
|---|---|
str or None
|
The family, or None where the block cuts none or several. |