solprop.output.scan#

Commit independently completed points to one recoverable HDF5 scan file.

Only the controller writes this file. Staged point groups are the recovery source; layout arrays and exact CSR statistics are rebuilt from committed groups at close.

Functions

grid_values(path, name)

Read a uniform result in global-index order with unfinished points masked.

read_point(path, index)

Read committed point data without exposing unfinished arrays.

validate_result(result)

Check the complete payload before changing committed data.

Classes

PointResult(index, status[, ...])

Carry a worker's complete result or failure to the single writer.

ScanWriter(path, scan, settings)

Own the collected file for one controller session.

class solprop.output.scan.PointResult(index, status, configuration_hash='', metadata_json='', arrays=<factory>, reductions=<factory>, error='', wall_time=0.0, n_steps=0, n_rejected=0)[source]#

Bases: object

Carry a worker’s complete result or failure to the single writer.

Attributes:
indexint

Global scan index.

statusstr

Done, failed, skipped or conflict.

configuration_hashstr

Single-run configuration digest, empty if construction failed.

metadata_jsonstr

Complete run metadata, empty if construction failed.

arraysdict

Named retained fields, statistics and reduction arrays.

reductionsdict

Reducer declarations with units, parameters and source provenance.

errorstr

Traceback or conflict explanation, empty on success.

wall_timefloat

Build and run wall time, s.

n_stepsint

Attempted propagation steps.

n_rejectedint

Rejected propagation steps.

arrays: Mapping[str, ndarray]#
configuration_hash: str = ''#
error: str = ''#
index: int#
metadata_json: str = ''#
n_rejected: int = 0#
n_steps: int = 0#
reductions: Mapping[str, object]#
status: str#
wall_time: float = 0.0#
class solprop.output.scan.ScanWriter(path, scan, settings)[source]#

Bases: object

Own the collected file for one controller session.

Parameters:
pathpathlib.Path or str

Collected HDF5 path.

scanScan

Complete scan or selection; file identity uses the complete axes.

settingsmapping

Retention and reducer contracts; changed contracts refuse append.

close(*, consolidate=True)[source]#

Build layout arrays and CSR statistics, then close the writer.

A hard interruption before this point is readable from committed staging.

Parameters:
consolidatebool, optional

False closes an unchanged collection without rebuilding its layouts.

commit(result)[source]#

Validate and commit a result, publishing done after its payload.

Parameters:
resultPointResult

Complete worker result; failure payloads never touch numerical arrays.

Raises:
OutputError

If a cached configuration differs, a completed point would be demoted, or numerical results are not finite.

mark_running(index, now)[source]#

Publish a point claim before dispatch.

Parameters:
indexint

Global point index.

nowfloat

Current Unix time, s.

record_execution(executor, policy)[source]#

Append the controller policy and measured resource calculation.

Parameters:
executorstr

Executor class name.

policymapping

Effective thread, process and memory settings, including the probe.

state(index)[source]#

Read the durable scheduling state for a point.

Parameters:
indexint

Global point index.

Returns:
tuple

Status, configuration hash and last ownership update in Unix seconds.

solprop.output.scan.grid_values(path, name)[source]#

Read a uniform result in global-index order with unfinished points masked.

Parameters:
pathpathlib.Path

Collected scan file.

namestr

Flat point-array path.

Returns:
numpy.ma.MaskedArray

Array with leading global-point axis.

Raises:
ProcessingError

If no completed point has the result or its shapes differ.

solprop.output.scan.read_point(path, index)[source]#

Read committed point data without exposing unfinished arrays.

Parameters:
pathpathlib.Path

Scan file.

indexint

Global point index.

Returns:
collections.abc.Mapping

Status, traceback, metadata and flat array paths.

Raises:
ProcessingError

If the index is outside the scan.

solprop.output.scan.validate_result(result)[source]#

Check the complete payload before changing committed data.

Parameters:
resultPointResult

Complete point payload with status and provenance.