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
|
Read a uniform result in global-index order with unfinished points masked. |
|
Read committed point data without exposing unfinished arrays. |
|
Check the complete payload before changing committed data. |
Classes
|
Carry a worker's complete result or failure to the single writer. |
|
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:
objectCarry 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.
- class solprop.output.scan.ScanWriter(path, scan, settings)[source]#
Bases:
objectOwn 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.
- 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.