Skip to content

pyflightstream.post.glossary (provisional)

Generated from the docstrings at build time: every one of the 13 names in the __all__ of pyflightstream.post.glossary has an entry below. The names a guide or an example uses come first; the others follow under Advanced.

The input glossary, INPUTS.md, and the parts every generated input guide shares.

The glossary states every key an INPUT artifact may state, the matrix row, the setup, the pproc, the reference and the geometry sidecar, with what it sets, its unit or values, the run types or builds that accept it and the solver command it reaches (G08). It reads the registries the code uses: the run types' key tables, the matrix columns, the flight-condition vocabulary, the preset tables, the export kinds, the sidecar readers' keys and the fields of every input model, and the meaning of a key is the code's too (a model field's description, its Attributes entry or its #: comment, or the :class:~pyflightstream.cases.InputKey its registry carries). A key added without one is a row with no meaning, which the glossary's test refuses.

Beside it live the parts the generated pages share: the names of the pproc guides, which the glossary's introduction names, the generated-page banner, the idempotent write and the link to a documentation page. They are here, below :mod:pyflightstream.post.input_template and :mod:pyflightstream.post.guides, because both of those import this module and this module imports neither.

Every public name is re-exported, unchanged, by :mod:pyflightstream.post.guides, its path (AD-11).

Advanced

pyflightstream.post.glossary.ARTIFACT_HEADINGS module-attribute

ARTIFACT_HEADINGS: Mapping[str, str] = MappingProxyType(
    {
        "matrix": "The run matrix",
        "setup": "The setup artifact, `inputs/setups/<id>.toml`",
        "pproc": "The post-processing artifact, `inputs/pproc/<id>.toml`",
        "reference": "The reference artifact, `inputs/references/<id>.toml`",
        "geometry": "The geometry sidecar, `inputs/geometries/<stem>.boundaries.toml`",
    }
)

pyflightstream.post.glossary.DOCS_URL_LABEL module-attribute

DOCS_URL_LABEL = 'Documentation'

pyflightstream.post.glossary.GLOSSARY_COLUMNS module-attribute

GLOSSARY_COLUMNS: tuple[str, ...] = (
    "Key",
    "What it sets",
    "Unit or values",
    "Accepted by",
    "Command",
)

pyflightstream.post.glossary.GlossaryRow dataclass

GlossaryRow(
    key: str,
    meaning: str,
    values: str = "",
    accepted: str = "",
    commands: tuple[str, ...] = (),
)

One key of an input artifact, as the input glossary states it.

Attributes:

Name Type Description
key str

The key as the file spells it.

meaning str

What it sets, read from the code.

values str

Its unit, or the values it takes.

accepted str

The run types or builds that accept it, where the code says.

commands tuple of str

The solver commands it reaches.

pyflightstream.post.glossary.GlossaryTable dataclass

GlossaryTable(
    artifact: str,
    heading: str,
    intro: str,
    rows: tuple[GlossaryRow, ...],
    commands: tuple[str, ...] = (),
)

One table of the input glossary: the keys of one table of one artifact.

Attributes:

Name Type Description
artifact str

Which artifact, a key of :data:ARTIFACT_HEADINGS.

heading str

The table as the file spells it, or its name.

intro str

What the table is.

rows tuple of GlossaryRow

One per key the table may hold.

commands tuple of str

The solver commands the key holding this table reaches.

pyflightstream.post.glossary.INPUT_GLOSSARY_NAME module-attribute

INPUT_GLOSSARY_NAME = 'INPUTS.md'

pyflightstream.post.glossary.PACKAGE_SET_FIELDS module-attribute

PACKAGE_SET_FIELDS: frozenset[tuple[str, str]] = frozenset(
    {
        ("ProbesSpec", "resolved_points_file"),
        ("PortBoundary", "profile_sha256"),
        ("PortBoundary", "boundary"),
        ("PortBoundary", "velocity"),
        ("PortBoundary", "profile"),
        ("RawCommand", "setup"),
        ("RawCommand", "source"),
        ("CustomFlag", "setup"),
    }
)

pyflightstream.post.glossary.PPROC_GUIDE_NAMES module-attribute

PPROC_GUIDE_NAMES: tuple[str, ...] = (
    "VARIABLES.md",
    "WRITING-EQUATIONS.md",
)

pyflightstream.post.glossary.REFERENCE_BLOCK_HEADINGS module-attribute

REFERENCE_BLOCK_HEADINGS: Mapping[str, str] = (
    MappingProxyType(
        {
            "rotors": '`[<NAME>]` with `kind = "rotor"`',
            "actuators": '`[<NAME>]` with `kind = "actuator"`',
            "points": "`[<NAME>]` with any other `kind`",
        }
    )
)

pyflightstream.post.glossary.input_glossary_markdown

input_glossary_markdown() -> str

Return the input glossary, INPUTS.md, as Markdown.

One section per input artifact and one table per table of the artifact, each row a key with its meaning, its unit or values, where it is accepted and the command it reaches. Generated from the code on every call.

Returns:

Type Description
str

The Markdown page, ending with a newline.

Examples:

>>> text = input_glossary_markdown()
>>> text.splitlines()[0]
'# Inputs'
>>> "| `analysis_families` |" in text
True

pyflightstream.post.glossary.input_glossary_tables cached

input_glossary_tables() -> tuple[GlossaryTable, ...]

Every table of the input glossary, in the page's order.

Read from the registries the readers and the builders use and from the models' own fields, so a key the package gains is a row here; its meaning comes from the code beside it (a field's description, its Attributes entry or its #: comment, or the registry's :class:InputKey), and a key that has none is a row with an empty meaning, which the glossary's test refuses.

Returns:

Type Description
tuple of GlossaryTable

The matrix, the setup, the pproc, the reference and the geometry sidecar, each artifact's tables together.

pyflightstream.post.glossary.write_input_glossary

write_input_glossary(
    folder: str | Path,
    *,
    changed: list[Path] | None = None,
    overwrite: bool = True,
) -> Path

Write the input glossary, INPUTS.md, into folder; return its path.

Only the marked generated block is refreshed. Existing unmarked content and notes outside that block remain byte-for-byte intact. A legacy glossary under pproc is left in place and linked as preserved compatibility content.

Parameters:

Name Type Description Default
folder str or Path

Where to write it: the workspace's inputs root. Created if absent.

required
changed list

Receives the page when this call actually wrote it.

None
overwrite bool

Replace a file that already exists, as the writer always did (the default). False refuses an existing file, naming it, before it is replaced.

True

Returns:

Type Description
Path

The page, written or not.

Raises:

Type Description
InputArtifactError

If the existing page holds the generated-block markers more than once, or in reversed order, so the block cannot be refreshed safely.

Examples:

>>> import tempfile
>>> folder = tempfile.mkdtemp()
>>> first: list = []
>>> write_input_glossary(folder, changed=first).name
'INPUTS.md'
>>> again: list = []
>>> _ = write_input_glossary(folder, changed=again)
>>> len(first), len(again)
(1, 0)

pyflightstream.post.glossary.write_workspace_input_glossary

write_workspace_input_glossary(
    inputs_dir: str | Path, *, overwrite: bool = True
) -> list[Path]

Write INPUTS.md into inputs_dir; return it if it CHANGED.

The input-guide writer this package registers with :func:pyflightstream.workspace.register_input_guide beside the pproc guides, which is how pyfs-workspace init, pyfs-matrix plan and pyfs-matrix post reach it.

Parameters:

Name Type Description Default
inputs_dir str or Path

The workspace's inputs root; created if absent.

required
overwrite bool

Replace a file that already exists, as the writer always did (the default). False refuses an existing file, naming it, before it is replaced.

True

Returns:

Type Description
list of pathlib.Path

The page when this call wrote it, otherwise an empty list.