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
epsris the first quality score,q1=1-frwherefris the failed fraction. The test passes quality check 1 if theq1<=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
q2takes 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 exceedepsrand the absolute gradient must exceedepsa. The failed fraction isfaand the combined score forq2=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 ifq2<=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.
- 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
GridGradientmethod, 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.