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_q1: float = 0.5, target_q2: 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 first quality score, q1=1-fr where fr is the failed fraction. The test passes quality check 1 if the q1<=target_q1.

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 q2 takes this into account by considering the fraction of points which fail the pure relative test, q1, 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 fa and the combined score for q2=1-0.9*fa-0.1*fr. 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 second test passes if q2<=target_q2.

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

  • epsa – The limit for the absolute gradient.

  • target_q1 – The target for the q1 (relative only) score.

  • target_g2 – The target for the q2 (weighted relative and absolute) score.

  • eps0 – The minimum gradient to care about.

info()[source]

Recalculate and return the score information.

run(archive)[source]

Run the calculation and return post-processed results

class LowOrderConsistency(name: str = '', template: str = '', eps0: float = 1e-12, epsa: float = 1e-06, epsr: float = 0.001, target_q1: float = 0.9, target_q2: float = 0.95, nuclide_compare: List[str] = ['u235', 'pu239'], _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.

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

  • eprs – The limit for the relative gradient.

  • epsa – The limit for the absolute gradient.

  • target_q1 – The target for the q1 (relative only) score.

  • target_g2 – The target for the q2 (weighted relative and absolute) score.

  • eps0 – The minimum gradient to care about.

info()[source]

Recalculate test statistics.

static make_diff_plot(identifier, image, time, min_diff, max_diff, max_diff0, perms)[source]

Make the difference plot.

run(archive)[source]

Run a consistent set of LOWER fidelity 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.