scale.olm.check

Module for checking classes.

class GridGradient(_model: dict = None, _env: dict = {}, eps0: float = 1e-20, epsa: float = 0.1, epsr: float = 0.1, target_q_r: float = 0.5, target_q_ar: float = 0.7, _type: Literal['scale.olm.check:GridGradient'] = None)[source]

Compute the grid gradients

Computes the absolute and relative gradients of the reaction coefficient data in each dimension at each point and collects them into a data structure.

The fraction of relative gradients which fall below the specified limit epsr is the relative quality score, q_r=1-f_r where f_r is the failed fraction. The relative score passes if q_r >= target_q_r.

Most often, we care less about relative differences when the absolute values are very small, e.g. a 10% difference in a 1e-12 barn cross section is not as big a deal as a 1% difference in a 100 barn cross section. Quality score q_ar takes this into account by considering the fraction of points which fail the pure relative test, q_r, and those that fail a combined test where the relative gradient must exceed epsr and the absolute gradient must exceed epsa. The failed fraction is f_ar and the combined score for q_ar=1-0.9*f_ar-0.1*f_r. In this way, one cannot get a perfect 1.0 for either score if there are any failures in a relative sense, but the second score penalizes them less. The absolute-relative score passes if q_ar >= target_q_ar.

Parameters:
  • eprs – The limit for the relative gradient.

  • epsa – The limit for the absolute gradient.

  • target_q_r – The target for the q_r (relative only) score.

  • target_q_ar – The target for the q_ar (weighted relative and absolute) score.

  • eps0 – The minimum gradient to care about.

info()[source]

Recalculate and return the score information.

run(reactor_library)[source]

Run the calculation and return post-processed results

class LowOrderConsistency(name: str = '', template: str = '', metric: LowOrderConsistencyMetric = LowOrderConsistencyMetric.GRAMS_PER_INITIAL_HM, eps0: float = 1e-12, epsa: float = 1e-06, epsr: float = 0.001, target_q_r: float = 0.9, target_q_ar: float = 0.95, convergence: LowOrderConsistencyConvergence | None = None, nuclide_compare: List[str] = ['u235', 'pu239'], nuclide_scaled_difference_min_abs_ylim: float | None = None, _model: Dict[str, any] = None, _env: Dict[str, any] = None, _type: Literal['scale.olm.check:LowOrderConsistency'] = None, _dry_run: bool = False)[source]

Check that we are consistent with the original calculation.

The ORIGEN library approach can be viewed as a high-order/low-order methodology where the ORIGEN library interpolation represents a low-order method which should agree with the high-order method.

This check assumes that we already have high-order (e.g. TRITON) nuclide inventory results available. We use each of the libraries in the interpolation space in a new low-order (ORIGAMI) calculation. Consistent inputs are automatically constructed from available data. We then compare all nuclide inventory differences in the same way as for the GridGradient method, instead of relative and absolute gradients, we have relative and absolute differences in nuclide inventory.

A number of plots are produced as side effects, referenced in the dictionary returned from the run() method.

Parameters:
  • name – Name of the test.

  • template – Template file to use for the low-order calculation.

  • metric – Primary inventory metric to use for quality scores.

  • nuclide_compare – List of nuclide identifiers for the detailed error plots.

  • convergence – Optional convergence study settings. Omit this block to run one low-order calculation with nlib=1 and nburn=1.

  • eps0 – The minimum value used in the relative difference calculation.

  • epsa – The limit for the absolute difference.

  • epsr – The limit for the relative difference.

  • target_q_r – The target for the q_r (relative only) score.

  • target_q_ar – The target for the q_ar (weighted relative and absolute) score.

  • nuclide_scaled_difference_min_abs_ylim – Minimum absolute y-axis limit for nuclide scaled-difference plots, as a fraction. Omit this to use epsr.

info()[source]

Recalculate test statistics.

static make_convergence_quality_plot(image, convergence_history, target_q_r, target_q_ar)[source]

Make the minimum q_r/q_ar convergence plot.

static make_scaled_difference_plot(identifier, image, time, min_scaled_difference, max_scaled_difference, max_abs_scaled_difference, perms, min_abs_ylim=0.0)[source]

Make the scaled-difference plot.

static make_time_quality_plot(image, time, q_r, q_ar, target_q_r, target_q_ar, convergence_history=None)[source]

Make the q_r/q_ar-by-time plot.

run(reactor_library)[source]

Run a consistent set of LOW order calculations which also produce an f71–typically ORIGAMI.

sequencer(sequence: List[dict], _model: Dict[str, any], _env: Dict[str, any], dry_run: bool = False, _type: Literal['scale.olm.check:sequencer'] = None)[source]

Run a sequence of checks.

Parameters:
  • sequence – List of checks to run by name.

  • _model – Reference model data

  • _env – Environment data.