serpentTools.XSPlotReader¶
-
class
serpentTools.
XSPlotReader
(filePath)¶ Parser responsible for reading and working with xsplot output files. These files can be generated using:
http://serpent.vtt.fi/mediawiki/index.php/Input_syntax_manual#set_xsplot
- Parameters
filePath (str) – path to the xsplot result file
-
xsections
¶ Contains
XSData
objects with keys given by their names. There should be one XSData instance for each isotope and material present in the problem.- Type
-
energies
¶ Array of energy grids, shared across all XSData instances
- Type
-
majorant
¶ L-inf norm among all macroscopic cross sections used in the problem.
- Type
-
metadata
¶ Alias for accessing
energies
andmajorant
. Attribute-based access is prefered, as this property will likely be removed in the future- Type
-
__len__
()¶ Number of xsdata objects stored
-
compare
(other, lower=0, upper=10, sigma=2, verbosity=None)¶ Compare the results of this reader to another.
For values without uncertainties, the upper and lower arguments control what passes and what messages get raised. If a quantity in
other
is less thanlower
percent different that the same quantity on this object, consider this allowable and make no messages. Quantities that are greater thanupper
percent different will have a error messages printed and the comparison will returnFalse
, but continue. Quantities with difference between these ranges will have warning messages printed.- Parameters
other – Other reader instance against which to compare. Must be a similar class as this one.
lower (float or int) – Lower limit for relative tolerances in percent Differences below this will be considered allowable
upper (float or int) – Upper limit for relative tolerances in percent. Differences above this will be considered failure and errors messages will be raised
sigma (int) – Size of confidence interval to apply to quantities with uncertainties. Quantities that do not have overlapping confidence intervals will fail
verbosity (None or str) – If given, update the verbosity just for this comparison.
- Returns
True
if the objects are in agreement with each other according to the parameters specified- Return type
- Raises
TypeError – If
other
is not of the same class as this class nor a subclass of this classValueError – If upper > lower, If sigma, lower, or upper are negative
-
read
()¶ The main method for reading that not only parses data, but also runs pre and post checks.