Skip to content

pyflightstream.post.series (stable)

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

The per-step exports of an unsteady point as a series (PFS-2031.18.01).

A row stating EXPORT_UNSTEADY_AFTER_REV or EXPORT_UNSTEADY_AFTER_ITER has the solver export its loads, sectional loads and probe points on every step from the threshold on, each file stamped _iteration=N beside the simulation (RPT-041 finding 3). Those files are what the reference incidence study reads, one revolution after another, and a folder of forty stamped spreadsheets is not a series until something tables them: this module writes, per point, one table per export kind under post/<matrix stem>/series/, a row per step (and per surface, section or probe where the export carries several), the step's time and azimuth from the clock the run record carries, which is the same arithmetic the counter program runs on the machine (run/_actions_counter.py, state()), so the series and the counter agree by construction.

Native surface files and the _cp files remain listed in products.json. The distribution writer also tables sectional loads and Cp, one file per pproc distribution, while this module retains the combined sections series.

Advanced

pyflightstream.post.series.PROBE_COLUMN module-attribute

PROBE_COLUMN = 'PROBE'

pyflightstream.post.series.SECTIONS_SERIES_LEAD module-attribute

SECTIONS_SERIES_LEAD: tuple[str, ...] = (
    "STEP",
    "time_s",
    "FAMILY",
    "PLANE",
    "ROTOR",
    "AZIMUTH",
)

pyflightstream.post.series.SERIES_DIR module-attribute

SERIES_DIR = 'series'

pyflightstream.post.series.SERIES_KINDS module-attribute

SERIES_KINDS: tuple[tuple[str, str | None], ...] = (
    ("loads", None),
    ("sections", "_sloads"),
    ("probes", "_probes"),
)

pyflightstream.post.series.SERIES_LEAD module-attribute

SERIES_LEAD: tuple[str, ...] = (
    "STEP",
    "time_s",
    "azimuth_deg",
)

pyflightstream.post.series.run_clock

run_clock(
    record: RunRecord,
) -> tuple[float | None, float | None]

Return (delta_time_s, step_deg) as the record states them, or what it lets one infer.

Public because the sections table needs the same answer. Reaching into a sibling module for an underscore-private name is the boundary this package already refuses for a helper, and the honest fix is to publish it: two functions computing one clock is how two products of the same point come to disagree about when it was sampled.

A record with a declared clock carries both in its export window; one without a declared clock carries neither, and its azimuth step is still known from the reductions plan's steps per revolution, while its time step is not known at all and the column is left unstated rather than guessed.

THE AZIMUTH STEP IS UNSIGNED. The recorded step_deg of an export window and the inferred 360 / steps_per_revolution both carry the size of one step and not the sense the rotor turns, so a series azimuth is the step times that size, degrees of turn counted from step zero, and says nothing of which way the rotor spins (X-F-0355).

UNSTATED HERE IS NA IN THE FILE, the same clause :func:_lead carries fifteen lines below: this returns a blank and the funnel renders it. The correction was applied to _lead alone when it was first made, in this same module, which is how one of two functions on one path ends up describing a product the other one writes.

Parameters:

Name Type Description Default
record RunRecord

The point's run record.

required

Returns:

Type Description
tuple of (float or None, float or None)

The time step in seconds and the azimuth step in degrees, None where not known.

pyflightstream.post.series.stamped_exports

stamped_exports(
    sim_dir: Path, stem: str, *more: Path
) -> dict[tuple[str, str], dict[int, Path]]

Return the stamped files of stem in sim_dir, by (suffix, extension) then step.

more are further folders to look in, a later one winning a step two hold. A SUBMITTED point runs in datapoints/DP-<tag>/ and the solver stamps its per-step exports into its working directory, which collect does not move because they are not declared outputs; scanning the simulation folder alone found nothing of such a point.

The suffix is "" for the loads spreadsheet and the Tecplot file, _cp, _sloads or _probes otherwise; the extension txt or dat. The pattern is the one the tier-3 actions test reads the same folder with.

Parameters:

Name Type Description Default
sim_dir Path

The simulation folder.

required
stem str

The point's file stem.

required
*more Path

Further folders to look in.

()

Returns:

Type Description
dict of (str, str) to dict of int to Path

(suffix, extension) to the file of each step.

pyflightstream.post.series.surface_export_metadata

surface_export_metadata(
    record: RunRecord, *, step: int | None = None
) -> dict[str, object]

Describe a native surface export from the run's immutable averaging request.

Parameters:

Name Type Description Default
record RunRecord

The point's run record.

required
step int

The step of the export described.

None

Returns:

Type Description
dict of str to object

{'kind': 'average', 'window': ...}, {'kind': 'instant'}, or why the export is skipped.

pyflightstream.post.series.translated_surface

translated_surface(
    record: RunRecord | AdditionalRecord, path: Path
) -> dict[str, object]

Say what a Tecplot surface the package wrote from a VTK is (G45).

Empty for a .dat the solver wrote, which is every Tecplot of a record written in legacy releases: nothing about it changed. For one the run wrote from its VTK, at the end of the run or stamped at a step: translated_from, the VTK beside it; source_sha256, that VTK's sha256 as the .dat itself states it (NA where the file cannot be read); location cell-centred; frame reference; and not_carried, the solver Tecplot's variables the VTK does not hold.

Parameters:

Name Type Description Default
record RunRecord or AdditionalRecord

The record whose run wrote the file.

required
path Path

The Tecplot file.

required

Returns:

Type Description
dict of str to object

The translation's metadata; empty for a Tecplot the solver wrote.

pyflightstream.post.series.write_point_series

write_point_series(
    root: Path,
    *,
    sim_dir: Path,
    record: RunRecord,
    stem: str,
    out: Path,
    overwrite: bool = False,
    target: Callable[[Path], Path] | None = None,
    condition: Mapping[str, object] | None = None,
    reference: Mapping[str, object] | None = None,
    rotors: Mapping[str, Mapping[str, object]]
    | None = None,
    skipped: dict[str, str] | None = None,
    surface_exports: dict[str, dict[str, object]]
    | None = None,
    failed: dict[str, str] | None = None,
) -> tuple[list[Path], dict[str, dict[str, object]]]

Write the series tables of one point from its stamped exports.

condition and reference are the point's, as every other product of it states them; without them the cells read NA. rotors is what the sections identity needs of each rotor, as :func:~pyflightstream.post.products.write_sections_table takes it.

surface_exports, when given, receives manifest entries for native Tecplot, VTK and CSV files. Those files are listed, not rewritten, and are separate from the returned tables and their entries.

A KIND WITH NO STAMPED FILE IS NOT WRITTEN. skipped, when given, receives the reason under the table's own name.

A STEP OF THE WINDOW THAT free-space DELETED (prune_step_exports) refuses that kind's table, naming the step and the storage call, under the same name in skipped, or as a :class:~pyflightstream._errors.ProductError when no skipped is given.

Parameters:

Name Type Description Default
root Path

The workspace root. Listed files, like product keys, are named relative to out, the matrix's products folder.

required
sim_dir Path

The simulation folder, where the solver left the stamped files.

required
record RunRecord

The point's run record; its export_window says which steps exist and the clock they were stepped with.

required
stem str

The point's name, the loads spreadsheet's name without .txt.

required
out Path

The matrix's products folder; the tables land under series/.

required
overwrite bool

Consulted only when target is None: whether an existing table may be rewritten, refused otherwise with :class:~pyflightstream.post.products.ProductExistsError.

False
target callable

Called with each table's path before that table is written, and the table is written to the path it returns, and its entry is keyed by that path: the same seam the retired write_superfiles takes. When it is given, IT ALONE decides what becomes of an existing table and overwrite is not consulted, which is the rule every other product of the stage follows. The products stage passes its archiver, which moves an existing table into series/archive/<day and hour>/, or, called with archive=False, leaves it to be overwritten.

None
condition mapping of str to object

The point's condition, as every product of it states it.

None
reference mapping of str to object

The point's reference dimensions.

None
rotors mapping of str to mapping

What the sections identity needs of each rotor.

None
skipped dict of str to str

Receives the reason a kind is not written, under the table's name.

None
surface_exports dict of str to dict

Receives the manifest entries of the native Tecplot, VTK and CSV files.

None
failed dict of str to str

Receives, under the table's name, the refusal of a kind whose stamped files cannot be read, and the other kinds are still written. Without it that refusal is raised and no table of the point is returned.

None

Returns:

Type Description
tuple

The tables written, and their products.json entries keyed by the path each was written to, relative to out (absolute when a target wrote it outside out): the runs, the steps tabled, the steps the window states, and on the loads entry the sections (_cp) and Tecplot (.dat) files of the window by path, under sections_files and tecplot_files.

Raises:

Type Description
ProductError

If a step of the window was deleted by free-space and no skipped is given.

ProductExistsError

If a table exists, no target is given and overwrite is not set.