Skip to content

pyflightstream.workspace.manifest (provisional)

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

Run and extraction records, manifest writers and the owned manifest lease.

The workspace facade keeps the historical imports and delegates writes here. Existing record shapes and serialized fields are preserved.

Used in the guides

pyflightstream.workspace.manifest.RunRecord

Bases: BaseModel

One manifest record: a single executed campaign point.

The record plus the staged inputs reproduce the run (NFR-07).

Attributes:

Name Type Description
run_id str

Unique identity of the executed point, for example "campaign/sim_9001/a+02.0_b+00.0"; the manifest rejects duplicates.

sim_id str

Simulation identity; ties the record to sims/sim_<sim_id>.

point dict of str to float

Sweep point coordinates, for example alpha and beta in deg.

fs_version_requested str

Canonical FlightStream version the script was built for.

fs_version_reported (str, optional)

Version printed in the solver outputs; filled by the parsers and cross-checked against the requested one (FR-18).

fs_build (str, optional)

Build string reported by the solver, when available.

fs_version_source str or None

Where the build this point ran on came from: "row" when the case named its own :attr:~pyflightstream.cases.SimCase.fs_build and "campaign_default" when it inherited the campaign's (PFS-2009.08.02). fs_exe and fs_version_requested say WHICH build; this says WHICH OF THE TWO SOURCES chose it, which the record could not state at all while a campaign declared one installation and a case could name another.

None means the row PREDATES the field and is not a claim that the build was inherited, exactly as manifest_schema may be None. Adding it did NOT move :data:MANIFEST_SCHEMA: that constant's own rule bumps for a removal or a change of meaning, never for an addition.

velocity_requested_m_s float or None

Free-stream velocity in m/s the case ASKED for, as :attr:~pyflightstream.cases.SimCase.velocity declared it (OPS-2009.01.13). Recorded because two places compare requested conditions against the conditions a solver export prints back, and only one of them could see this axis, so the two could reach opposite verdicts about one run.

None means the run did not request a velocity, which includes every row written before the field existed, and is NOT zero: a binding treats an unrequested axis as unasked rather than as agreed, and zero would be a request the export could contradict.

package_version str

pyflightstream version that produced the run. Read from the installed distribution's metadata, which is a static string, so every commit between two tags reports the tag: use package_commit to tell them apart.

package_commit (str, optional)

Git commit the package's code came from, when it came from a tracked work tree; None for a wheel install, where there is no repository to ask (PYFS-017).

package_dirty (bool, optional)

Whether that work tree had uncommitted changes. None travels with a None package_commit and means "not knowable here", never "clean".

script_sha256 str

Hash of the executed script text.

inputs_sha256 dict of str to str

Hash per staged input file name, recorded at staging time.

raw_flag bool

True when the script used the raw() escape hatch and its content bypassed database validation (FR-07).

manifest_schema str or None

Identifier of the record layout this row was written under. A reader that does not know the value should refuse rather than guess which fields exist (PYFS-015).

None means the row PREDATES the field and is not a claim that it was written under the current schema. Reading an older row does not stamp it with the current schema (REV010-014). "The field is absent because the row is old" and "the row asserts the current schema" are different facts about the evidence.

conditions list of dict, optional

The operating-point binding recorded by the assessor, one entry per requested axis the export printed back: axis, requested, reported, deviation, tolerance, unit and within (REV010-001). None means the run was recorded by an assessor that did not perform the comparison, which includes every row written before this field existed; an empty list means the comparison ran and had nothing to compare. The two are deliberately distinguishable.

fs_exe (str, optional)

Solver executable the run invoked, as resolved.

fs_exe_sha256 (str, optional)

Hash of that executable, so a later reader can tell whether the same binary is still installed. None when it could not be read.

argv list of str

The exact command line, argument by argument. Reproducing a run from the record needs the flags, not a guess at how the executor builds them.

cwd (str, optional)

Working directory the solver process ran in.

timeout_s (float, optional)

Wall-clock limit actually applied to the process.

recipe (str, optional)

Recipe identifier as the case declared it.

recipe_sha256 (str, optional)

Hash of the recipe function's source at run time. A recipe is user code that can be edited between runs, so the name alone does not identify what built the script; None when the source is not introspectable.

script_path (str, optional)

Generated script, relative to the simulation folder.

outputs_sha256 dict of str to str

Hash per collected output, keyed by the same relative name that appears in outputs. Empty for a point that collected nothing and for manifests written in legacy releases. Inputs have carried a hash since the first manifest and outputs did not, so a record could name evidence that had since been edited, truncated or replaced with nothing to compare against (PYFS-006).

waived_commands list of BrokenCommandRecord

Serialized :class:~pyflightstream.script.BrokenCommandUse entries, one per command the script emitted under an allow_broken waiver (FR-48). That class is the single home of the field list and their meanings; note only that TWO of them are versions and they are not interchangeable, version being the build the script targeted and source_version the build whose record is broken, which is the build the cited report was run on.

The key was broken_commands in legacy releases (PFS-2022.01.05, OPS-2009.02.08), and read as the commands that broke in the run, which is the opposite of a waiver the recipe registered on purpose. Reading a row with the old key is refused with an instruction to run pyfs-workspace migrate; no row is written under it. The rename moved :data:MANIFEST_SCHEMA to pyfs-manifest/3, for the reason recorded on that constant. Empty for the ordinary run, which is the point: a run that leaned on a command known not to work is distinguishable from one that did not, forever, without re-reading the script.

source_version is REQUIRED since pyfs-manifest/2 (PFS-2012.03). :meth:read_manifest refuses an entry that lacks it, naming this manifest and the stamp the row carries, rather than reading the field as empty.

executor ExecutorRecord or None

Which executor ran the point and the argv it ran, read off the run rather than asserted (PFS-2012.04); None on a point where no solver ran, and on every row written in legacy releases. Adding it did not move :data:MANIFEST_SCHEMA.

export_window ExportThresholdRecord or None

The export threshold the row states for its unsteady exports (PFS-2031.18), as resolved for this run: stated_form (revolutions or iterations, the key the row wrote), stated_value, first_step (the first time step whose export runs) and the local time_iterations. step_offset is the absolute step where this march begins. None for a row that states no threshold (a count-only march or no counter staged), and for older records. This is distinct from the public averaging ExportWindow; the persisted key remains compatible.

solver_setup (dict, optional)

Serialized solver-setup snapshot (:class:pyflightstream.script.solver_setup.SolverSetup) of the built script: every solver flag with its effective value and provenance (explicit, default with citation, or unknown). None for scripts built without the curated solver_settings helper and for manifests written in legacy releases.

status RunStatus

Terminal status of the point.

iterations (int, optional)

Solver iterations reached, when parsed.

residual (float, optional)

Final residual, when parsed.

wall_time_s (float, optional)

Wall-clock duration of the solver process in seconds.

started_at (str, optional)

When the solver process was started, ISO 8601 in UTC to the second, as the executor read its clock (PFS-2012.08.01); the provenance document the products stage writes states it as the run activity's start. None where no solver ran, where the executor reports no clock, and on every row written in legacy releases. Adding it did not move :data:MANIFEST_SCHEMA.

finished_at (str, optional)

When the process ended, or was killed on timeout, the same way.

outputs list of str

Collected output files, relative to the simulation folder (for example "outputs/loads.txt"; a record written in legacy releases names "raw/loads.txt" and is read unchanged, FR-84).

error (str, optional)

Error text for failed points.

flight_condition_defaults dict of str to float

The fluid pins the row's SETUP artifact supplied, with the values used, for the keys the row did not state (PFS-2030.08). Empty means the row stated everything its resolution used, which is every record written in legacy releases; it is NOT a claim that the setup carried no table. HOW TO READ THE PAIR: a pin in flight_condition and not here was stated by the ROW and overrode whatever the setup said, since a key the row states never enters this mapping. Recorded beside the condition as written because without it a record cannot be recomputed once the constants move out of the row, and adding it did not move :data:MANIFEST_SCHEMA, whose rule bumps for a removal or a change of meaning and never for an addition.

flight_condition_defaults_from str

Which setup supplied those pins, id and path, for example setup 's001' (inputs/setups/s001.toml). Empty when the row inherited nothing, which includes every record written in legacy releases.

angles_not_stated list of str

The flow angles (ALPHA, BETA) the point neither swept nor the row stated, so it ran at the 0.0 degrees default (FR-69). Empty where both were stated and on every record written in earlier releases.

matrix_stem (str, optional)

The stem of the run matrix the point came from, when the campaign was converted from one (PFS-2031.04). A workspace may hold several matrices sharing this one manifest, and the sweep table and the products of each are rebuilt from the records that name it. None means the record predates the field or the campaign was authored in Python; such a record belongs to no matrix and is left out of a per-matrix table rather than counted in every one. Adding it did not move :data:MANIFEST_SCHEMA.

reductions dict or None

The windows of every reduction the products stage writes beside the point's plots table (PFS-2015.04), resolved off the row by :func:pyflightstream.cases.workflows.reduction_windows when the record was written: time_iterations, steps_per_revolution, blades, and one entry per applicable reduction (time_average, phase_locked, per_blade) carrying its windows in solver steps and window_from, how the row stated them, or skipped with the reason the row could not window it. None means the row carries no time history (a steady point) or the record predates the field; a products stage reading None writes no reduction and records why. Adding it did not move :data:MANIFEST_SCHEMA. [REF-03]

a row that names its rotors by alias also carries rotors (FR-68), alias to one block per rotor holding that rotor's blades, rpm, steps_per_revolution, period_steps and its own phase_locked and per_blade; on such a row the flat passage entries carry a skip naming that block, because one blade passage of the ROW has no length when two rotors turn at two speeds. Adding it did not move :data:MANIFEST_SCHEMA either: it is an ADDITION, and a record written before it degrades correctly, a products stage finding no rotors reading the flat keys exactly as it always did.

flight_condition dict of str to float

The flight condition AS WRITTEN in the row, canonical key to value, in the units the key names (MACH dimensionless, TASmps m/s, REmi millions, ALTFT ft, dISA Celsius as a delta). Empty when the case stated none.

density_kg_m3 (float, optional)

Resolved density in kg/m3. None when no condition resolved.

temperature_k (float, optional)

Resolved static temperature in K, including any ISA deviation.

viscosity_pa_s (float, optional)

Resolved dynamic viscosity in Pa s, from Sutherland's law at temperature_k.

density_source ({'atmosphere', 'solved-from-reynolds'}, optional)

WHICH BRANCH produced density_kg_m3. "atmosphere" is the standard value at the stated altitude; "solved-from-reynolds" means the density was solved to meet a stated Reynolds number and is deliberately not a point in any atmosphere. Read it before reading the density as an altitude.

reference_length_m (float, optional)

The reference length in m that the resolution used, which is None unless a Reynolds number was stated. Recorded because the resolved density cannot be checked without it.

action_program (str, optional)

The counter program the run layer wrote for a row stating EXPORT_UNSTEADY_AFTER_REV or EXPORT_UNSTEADY_AFTER_ITER (PFS-2031.18), relative to the simulation folder; its sha256 is in inputs_sha256 under the same name, because the program is an input of the run like the geometry. None for a row stating neither key, which is every record written in legacy releases.

action_script (str, optional)

The file the SCRIPT action points at and the program rewrites, relative to the simulation folder; inputs_sha256 carries the hash of the EMPTY file the run layer wrote, not of what the run left, which is the rewritten one. None likewise.

action_count (int, optional)

The invocation count the program reached, read from its count file after the solver exited: the number of time steps the solver completed, since the count is the step count exactly (RPT-041). None when the file was never written: a row with no threshold, or a solver that never reached a time step.

Examples:

A synthetic record illustrates serialization without running a solver:

>>> from pyflightstream.workspace import RunRecord, RunStatus
>>> record = RunRecord(
...     run_id="demo/sim_1/AL+000", sim_id="1",
...     fs_version_requested="25.0", package_version="0.36.0",
...     script_sha256="0" * 64, raw_flag=False, status=RunStatus.SUBMITTED,
... )
>>> record.model_dump(mode="json")["status"]
'SUBMITTED'
>>> record.as_points()[0] is record
True

as_points

as_points() -> list[RunRecord]

Return this record as one record per POINT.

THE MANIFEST STORES JOBS and a steady matrix row is one job over several points, so a consumer that reasons per point (the physics reduction, a per-point table, an assessor comparing angles) would see one point where three ran. Rather than have each of them learn the job shape, they ask here.

A record that is one point returns itself, unchanged and not copied, so every caller can use this unconditionally and the common path costs nothing.

pyflightstream.workspace.manifest.RunStatus

Bases: StrEnum

Terminal status of one executed campaign point (SAD Section 7).

Every executed point lands in exactly one of these; a silent skip is structurally impossible in the campaign loop.

Examples:

>>> from pyflightstream.workspace import RunStatus
>>> RunStatus("SUBMITTED") is RunStatus.SUBMITTED
True
>>> str(RunStatus.CONVERGED)
'CONVERGED'

Advanced

pyflightstream.workspace.manifest.ADDITIONAL_MANIFEST module-attribute

ADDITIONAL_MANIFEST = 'additional.json'

pyflightstream.workspace.manifest.ADDITIONAL_MANIFEST_SCHEMA module-attribute

ADDITIONAL_MANIFEST_SCHEMA = 'pyfs-additional/1'

pyflightstream.workspace.manifest.AdditionalRecord

Bases: BaseModel

One extraction of the additional post: a saved simulation reopened, with no solve.

Written to :data:ADDITIONAL_MANIFEST and never to runs.json, so the point's own record stays exactly as its run wrote it. Every path is relative to the point's simulation folder, as a run record's are.

Attributes:

Name Type Description
manifest_schema str

:data:ADDITIONAL_MANIFEST_SCHEMA.

extraction_id str

<point run_id>/additional/<pproc id>, the identity of this extraction; the LATEST record of an identity is the one that counts.

run_id str

The point's run id, as :meth:RunRecord.as_points names it.

job_id str or None

The run id of the job record the point belongs to, for a steady row run as one job; None for a point recorded on its own.

sim_id, point_name, matrix_stem str or None

Copied from the point's record.

pproc str

The ADDITIONAL pproc id, which the products are marked with.

pproc_sha256 str or None

sha256 of inputs/pproc/<pproc>.toml when the extraction ran, so an artifact edited since is extracted again.

fsm str

The point's saved simulation, as its record names it.

fsm_sha256 str

Its sha256 in the point's record, which the file on disk matched and the copy the solver opened matched too.

fsm_sha256_after str or None

The ORIGINAL file hashed again after the launch; it equals fsm_sha256 or the extraction is recorded failed.

unsteady bool

Whether the point marched in time; its extraction is then one instant, the last.

note str or None

What a reader of the extraction must know: the one-instant sentence on an unsteady point.

fs_version_requested, fs_exe, fs_exe_sha256 str or None

The build the extraction was emitted under and run on.

package_version, package_commit, package_dirty

As on a run record.

script_path, script_sha256 str

The extraction script, under scripts/additional/<pproc>/.

working_dir str

Where the solver ran and wrote: datapoints/DP-<point>/additional/<pproc>.

argv, cwd, timeout_s, executor, started_at, finished_at, wall_time_s

How the solver was called, as on a run record.

status ExtractionStatus

The terminal status.

error str or None

Why a failed extraction failed.

outputs list of str

The files written, relative to the simulation folder.

outputs_sha256 dict of str to str

sha256 of each, keyed by the same name.

sections_layout list of dict

Which rows of the sections exports are which distribution: the run's own layout first, then the additional pproc's blocks, numbered on after the run's and marked with the pproc (RPT-062: a reopened export carries the run's distributions first and the new ones after them).

leading_sections int

How many rows at the head of those exports are the run's own.

frames dict

The frames the extraction cited, by name, as the run created them.

inventory list of str or None

The boundary names the saved simulation holds, in the solver's order.

surface_translations list of dict or None

The Tecplot surfaces the package wrote from the extraction's VTK (G45), as a run record states them.

pyflightstream.workspace.manifest.BrokenCommandRecord

Bases: TypedDict

One serialized :class:~pyflightstream.script.BrokenCommandUse.

The JSON shape of a waived_commands entry of the manifest, declared here rather than imported so the workspace layer keeps its manifest schema and the script layer keeps the model. The model is the single home of what each field MEANS: read :class:~pyflightstream.script.BrokenCommandUse for that, including why two of these are versions and are not interchangeable.

Every key is optional (total=False) and no member type is narrower than the model's, which is the compatibility half: a manifest row written before a key existed still reads back, exactly as :attr:RunRecord.manifest_schema may be None. Unknown keys are KEPT rather than dropped, so reading a manifest a later version wrote never quietly edits the evidence.

pyflightstream.workspace.manifest.COST_EXCLUDED_STATUSES module-attribute

COST_EXCLUDED_STATUSES = frozenset(
    status
    for status in RunStatus
    if status.name.startswith("FAILED")
    or status
    in {
        RunStatus.WALLTIME_REACHED,
        RunStatus.SUBMITTED,
        RunStatus.RAN_MISSING_LOG,
        RunStatus.GEOMETRY_FAILED,
    }
)

Statuses whose wall clock is not a completed-run cost sample.

pyflightstream.workspace.manifest.ExecutorRecord

Bases: TypedDict

How the solver was called, as the run layer read it off the run.

The JSON shape of the executor entry of a manifest row (PFS-2012.04). class_name is the executor's class as it ran (LocalExecutor today; an HPC executor the day FR-15 lands) and argv the command line it returned, which is the same list as the row's own argv and travels here as well so the entry is one self-contained fact a report can be built from. Both keys are required: the entry is written whole or, on a point where no solver ran, not at all, and the row says None. forced_local is present, and true, only on a point the run's local switch kept on a machine that would otherwise have submitted; a record written before it, or by a run that did not ask, has no key, and a legacy reader refuses a manifest that carries one.

pyflightstream.workspace.manifest.ExtractionStatus

Bases: StrEnum

Status of one extraction of the additional post (G12).

There is no convergence verdict among them: an extraction solves nothing, so it is judged by its process and by the files it declared.

pyflightstream.workspace.manifest.JOB_TAG module-attribute

JOB_TAG = 'sweep'

pyflightstream.workspace.manifest.KNOWN_MANIFEST_SCHEMAS module-attribute

KNOWN_MANIFEST_SCHEMAS = (
    "pyfs-manifest/1",
    "pyfs-manifest/2",
    "pyfs-manifest/3",
)

pyflightstream.workspace.manifest.MANIFEST_LOCK_POLL_S module-attribute

MANIFEST_LOCK_POLL_S = 0.02

pyflightstream.workspace.manifest.MANIFEST_LOCK_RENEW_S module-attribute

MANIFEST_LOCK_RENEW_S = 5.0

pyflightstream.workspace.manifest.MANIFEST_LOCK_STALE_S module-attribute

MANIFEST_LOCK_STALE_S = 300.0

pyflightstream.workspace.manifest.MANIFEST_LOCK_TIMEOUT_S module-attribute

MANIFEST_LOCK_TIMEOUT_S = 60.0

pyflightstream.workspace.manifest.MANIFEST_SCHEMA module-attribute

MANIFEST_SCHEMA = 'pyfs-manifest/3'

pyflightstream.workspace.manifest.SOURCE_VERSION_REQUIRED_SINCE module-attribute

SOURCE_VERSION_REQUIRED_SINCE = 'pyfs-manifest/2'

pyflightstream.workspace.manifest.WorkspaceError

Bases: PyflightstreamError, RuntimeError

A file-management operation was refused or impossible.

The refusals protect run evidence: archiving or cleaning without a manifest record would destroy a run the manifest cannot account for, and collection of a declared output that the solver never produced points at an incomplete run.

pyflightstream.workspace.manifest.append_record

append_record(
    workspace: _ManifestWorkspace, record: RunRecord
) -> None

Append one record to the manifest, atomically.

The manifest is rewritten through a temporary file and an atomic replace, so a crash never leaves it half-written; a duplicate run_id is rejected because the manifest is the run identity (PP-6).

Existing rows are carried across AS THEY WERE WRITTEN. REV010-014: do not re-serialize existing rows through validated models, which would add defaults and a manifest_schema not recorded by their writer. Historical evidence is not this method's to edit; migrating a manifest is a separate, deliberate, auditable act.

Parameters:

Name Type Description Default
workspace CampaignWorkspace

The owner of the manifest and its read and write operations.

required
record RunRecord

The new run to append, with a unique run_id.

required

Raises:

Type Description
WorkspaceError

If the run_id is already in the manifest, or if the record carries a waiver row that this version may not write: one whose source_version names no build, or one under any stamp but :data:MANIFEST_SCHEMA. Refused before anything is written, because the row would be one :meth:read_manifest refuses and nothing here migrates a manifest (PFS-2012.03).

Examples:

Append a synthetic record to a temporary workspace without a solver:

>>> from tempfile import TemporaryDirectory
>>> from pyflightstream.workspace import CampaignWorkspace, RunRecord, RunStatus
>>> from pyflightstream.workspace.manifest import append_record
>>> record = RunRecord(
...     run_id="demo/sim_1/AL+000", sim_id="1",
...     fs_version_requested="25.0", package_version="0.36.0",
...     script_sha256="0" * 64, raw_flag=False, status=RunStatus.SUBMITTED,
... )
>>> with TemporaryDirectory() as directory:
...     workspace = CampaignWorkspace(directory)
...     append_record(workspace, record)
...     workspace.read_manifest()[0].run_id == record.run_id
True

pyflightstream.workspace.manifest.complete_submitted_record

complete_submitted_record(
    workspace: _ManifestWorkspace, record: RunRecord
) -> None

Replace a SUBMITTED row with the completed run it became (FR-99).

THE ONE METHOD THAT REWRITES A ROW, and the narrowness is the whole design. :meth:append_record carries existing rows across AS THEY WERE WRITTEN because historical evidence is not this class's to edit; a manifest that any code may rewrite is a manifest whose rows are opinions.

A SUBMITTED row is the ONE deliberate exception, and it is an exception in a precise sense: it is not a finished record that a later reading disagrees with, it is a record that says in its own status that the run has not come back yet. Completing it is not editing evidence. It is the evidence ARRIVING.

So the refusal is on the existing row rather than on the new one: a row in any other status is a run that finished, and this refuses to touch it whatever the caller passes. That is what stops this method becoming the general-purpose rewrite that append_record's docstring exists to prevent.

Parameters:

Name Type Description Default
workspace CampaignWorkspace

The owner of the manifest and its read and write operations.

required
record RunRecord

The completed record replacing the row with the same run_id.

required

Raises:

Type Description
WorkspaceError

When the manifest holds no row with that run_id, or when the row it holds is not SUBMITTED. Both name the run and the status found, because a collector pointed at the wrong workspace and a collector pointed at a finished run are different mistakes and the message has to tell them apart.

pyflightstream.workspace.manifest.manifest_lock

manifest_lock(
    manifest: Path,
    *,
    root: Path,
    timeout_s: float,
    renew_s: float,
    stale_s: float,
    poll_s: float,
) -> Iterator[None]

Hold the manifest's read-modify-replace under an owned, renewable lease.

manifest is the file the lease guards, runs.json unless named: the extraction manifest of the additional post (G12) takes a lease of its own under the same rules, additional.json.lock, so an extraction never holds or waits on the lease of the runs.

runs.json.lock records the PID, host and a unique token. A background heartbeat updates its modification timestamp every five seconds. A waiter recovers it only for a confirmed dead local PID or after 300 seconds with no renewal; elapsed time since acquisition alone never expires a lease. Legacy PID-only files have no verifiable host and use the same stale bound.

A persistent .runs.json.lock.guard serialises ownership changes and the entire read-modify-replace interval using an OS byte/file lock. It is never deleted: replacing its inode would split the arbitration between waiters. The OS releases this guard if its process dies. The filesystem must honour these locks across clients (SMB/NFS deployments must support locking), and hosts must synchronise clocks for the stale-heartbeat fallback. A live writer retains the guard even if its heartbeat stalls, so a successor cannot take over while the former writer can still publish its snapshot.

A release removes only its own token, including on a refused write.

Parameters:

Name Type Description Default
manifest Path

The manifest file whose lease is acquired.

required
root Path

The workspace directory, created before acquiring the lease.

required
timeout_s float

Finite, nonnegative maximum wait in seconds for another writer or the arbitration guard.

required
renew_s float

Seconds between heartbeat renewals while the lease is held.

required
stale_s float

Seconds without renewal after which a lease may be recovered.

required
poll_s float

Seconds between acquisition attempts.

required

Yields:

Type Description
None

Control to the writer while it owns the lease.

Raises:

Type Description
WorkspaceError

If the timeout is invalid or another writer holds the manifest for the configured wait bound.

pyflightstream.workspace.manifest.planned_points_without_record

planned_points_without_record(
    planned: Iterable[str],
    rows: Iterable[Mapping[str, object]],
) -> list[str]

Return the planned run ids no record carries, in the order planned.

A planned point (<campaign>/sim_<id>/<point>, as plan.json lists it) is recorded by a record of its own id; by a record of the same campaign and simulation whose id ends with its point, which is a continuation of it; by a JOB record of its row (<campaign>/sim_<id>/sweep) whose points_ran names it; or by a job record that ran no point, which stands for every point of its row (a job refused before it ran records them all at once). Rows without a run_id, such as a delete-sims note, carry nothing.

Parameters:

Name Type Description Default
planned iterable of str

The planned run ids.

required
rows iterable of mapping

The manifest's rows as written (runs.json), or records dumped to mappings.

required

Returns:

Type Description
list of str

The planned run ids with no record, the points a run never attempted.

Examples:

>>> planned_points_without_record(
...     ["c/sim_1/J1", "c/sim_1/J2", "c/sim_2/AL+000"],
...     [{"run_id": "c/sim_1/J1", "sim_id": "1"},
...      {"run_id": "c/sim_2/sweep", "sim_id": "2", "points_ran": []}],
... )
['c/sim_1/J2']

pyflightstream.workspace.manifest.supersede_records

supersede_records(
    workspace: _ManifestWorkspace,
    run_ids: Sequence[str],
    *,
    stamp: datetime | None = None,
) -> Path | None

Copy the manifest into archive/ and take the named rows out of it.

For a FORCED RE-RUN: a point whose matrix row was wrong keeps its identity when the correction does not change its name, so the recorded row has to leave before the point can run again. The copy is made FIRST and the write is atomic, so there is no instant at which the workspace holds neither the old manifest nor a whole one.

THE COPY GOES WHERE THIS PACKAGE ALREADY PUTS ONE. pyfs-matrix rename archives the manifest to archive/runs-<stamp>.json before rewriting it, and a second home for one artifact name is how a reader who knows the first never finds the second.

Parameters:

Name Type Description Default
workspace CampaignWorkspace

The owner of the manifest and its read and write operations.

required
run_ids sequence of str

The run identities to remove. One that the manifest does not hold is not an error here: the caller decides what an unmatched name means, and for a forced re-run it refuses before reaching this.

required
stamp datetime

The moment the copy is named for. Injected so a test does not race the clock; the default is now.

None

Returns:

Type Description
Path or None

Where the manifest was copied, or None when there is no manifest to copy, which is a workspace nothing has run in yet.