solprop.calibration.refine#
Stage 2: refine the workspace settings for one simulation (SEP 46 section 6.6).
The machine profile fits the native backend to the machine; a costly campaign can
then fit it to its own simulation. refine() builds fresh workspaces from the
simulation’s translated problem in the calling process, under the process’s record
and under each candidate’s, and never touches the simulation’s state, output or
callbacks. The candidates are the operation-grain moves of the simulation’s own work
sizes (solprop.calibration.grain), each timed by trial steps of the
simulation’s own operators at positions spread along its length, interleaved with the
base record and admitted by §6.5’s rule; the winners are validated together. Speed
alone never admits a candidate: every candidate’s trial steps must end finite and
within ten times the run’s relative tolerance of the base’s (section 12 item 4).
The result is stored under the simulation’s execution descriptor
(_profile.descriptor), and every later run or scan point with an equal descriptor
applies it while the machine profile it refined still holds.
Module Attributes
Interleaved rounds per comparison, as at the standard level. |
|
Trial-step windows along the simulation's length: its start, a third and two. |
|
How many times the run's relative tolerance a candidate's fields may differ by. |
Functions
|
Refine the native workspace settings for simulation (SEP 46 stage 2). |
Classes
|
What a refinement measured and kept. |
- solprop.calibration.refine.ACCURACY = 10.0#
How many times the run’s relative tolerance a candidate’s fields may differ by.
- solprop.calibration.refine.POSITIONS = 3#
Trial-step windows along the simulation’s length: its start, a third and two.
- solprop.calibration.refine.ROUNDS = 5#
Interleaved rounds per comparison, as at the standard level.
- class solprop.calibration.refine.RefinementReport(status, descriptor, changes=<factory>, evidence=<factory>, reason='', seconds=0.0, path=None)[source]#
Bases:
objectWhat a refinement measured and kept.
- Attributes:
- statusstr
"published"(a refinement was stored),"kept"(the machine profile stays: no candidate won and was accurate), or"inconclusive"(too noisy, too little time, or no machine profile to refine).- descriptorstr
The simulation’s execution descriptor.
- changesMapping[str, object]
The workspace settings stored over the process’s record.
- evidenceMapping[str, object]
The noise, each candidate’s verdict and accuracy, and the validation.
- reasonstr
Why.
- secondsfloat
The wall time taken.
- pathpathlib.Path or None
The refinement file, if one was stored.
- solprop.calibration.refine.refine(simulation, budget=60.0, *, progress=None)[source]#
Refine the native workspace settings for simulation (SEP 46 stage 2).
- Parameters:
- simulationsolprop.driver.Simulation
The simulation; it is translated if it is not already, and otherwise left alone.
- budgetfloat, optional
The deadline, in seconds.
- progresscallable or None, optional
Called with a line of text as each stage starts.
- Returns:
- RefinementReport
What was kept and whether it was stored.
- Raises:
- CalibrationError
For a budget that is not positive, or a simulation not on the native backend.