index¶
The clearance index itself, and the result it returns.
index
¶
The clearance index itself: a sum of activity-to-limit ratios.
Every regulation here uses the same arithmetic. Each radionuclide's activity is divided by its tabulated limit and the ratios are summed; a total below one means the material meets the limits. The German regulation calls it the Summenformel, the UK calls it the summation rule, the NRC calls it the sum of fractions rule and Fetter calls the result a waste disposal rating. This module implements it once.
What differs between regulations, and what ClearanceResult therefore
records, is what happens to a nuclide that is not simply looked up: one whose
parent already accounts for it, one the table does not list, and one the
regulation places outside its scope entirely.
Classes:
-
ClearanceResult–The outcome of assessing one material against one limit set.
Functions:
-
clearable_routes–The limit sets this material already meets, best margin first.
-
clearance_index–Assess a material against one set of clearance limits.
-
clearance_indices–Assess a material against many limit sets at once.
Attributes:
-
EQUILIBRIUM_TOLERANCE(float) –Convert a string or number to a floating-point number, if possible.
EQUILIBRIUM_TOLERANCE
module-attribute
¶
EQUILIBRIUM_TOLERANCE: float = 0.1
Convert a string or number to a floating-point number, if possible.
ClearanceResult
¶
The outcome of assessing one material against one limit set.
The per-nuclide dicts are ordered as a report reads them, largest first.
Methods:
-
__repr__–Return repr(self).
-
__str__–Return str(self).
-
assessed_activity–The activity actually charged against the limit for one nuclide.
-
dominant–The nuclides contributing most to the index.
-
to_dict–A JSON-serialisable copy of the result.
Attributes:
-
__doc__–str(object='') -> str
-
__module__–str(object='') -> str
-
activities(dict[str, float]) –Each nuclide's activity in
units, largest first. -
by_nuclide(dict[str, float]) –Each nuclide's contribution to the index, largest first.
-
clearable(bool) –Whether the material meets this set's limits.
-
credited(dict[str, float]) –Nuclide to the activity a parent accounted for, where the parent could
-
defaulted(tuple[str, ...]) –Nuclides that took the set's catch-all limit because the table does not
-
excluded(dict[str, str]) –Nuclide to the reason its activity was left out, which is always that a
-
index(float) –The sum of activity-to-limit ratios.
-
limit_set(str) –Name of the set assessed against.
-
limits_used(dict[str, float]) –The limit applied to each nuclide, after any metal, per-gram, dynamic or
-
material_name(str) –The material's label, carried through for reporting.
-
out_of_scope(bool) –Whether the regulation excludes this material outright, which for the UK
-
threshold(float) –The value the index must stay below, normally 1.
-
uncovered(dict[str, float]) –Activity present with no limit and no catch-all, so absent from the
-
uncovered_activity(float) –Total activity with no limit, in this result's units.
-
uncovered_fraction(float) –Share of total activity that falls outside the sum, from 0 to 1.
-
units(str) –Activity units the comparison was made in.
-
unlimited(tuple[str, ...]) –Nuclides the source explicitly places no limit on.
__doc__
class-attribute
¶
__doc__ = 'The outcome of assessing one material against one limit set.\n\nThe per-nuclide dicts are ordered as a report reads them, largest first.'
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
__module__
class-attribute
¶
str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str
Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'.
by_nuclide
property
¶
Each nuclide's contribution to the index, largest first.
credited
property
¶
Nuclide to the activity a parent accounted for, where the parent could
only support part of it. The remainder was assessed against the
nuclide's own limit, so for these the ratio in by_nuclide is computed
from activities[name] - credited[name]. assessed_activity returns
that residual directly.
defaulted
property
¶
Nuclides that took the set's catch-all limit because the table does not list them.
excluded
property
¶
Nuclide to the reason its activity was left out, which is always that a parent's limit already accounts for it in full.
limits_used
property
¶
The limit applied to each nuclide, after any metal, per-gram, dynamic or secular equilibrium adjustment.
out_of_scope
property
¶
out_of_scope: bool
Whether the regulation excludes this material outright, which for the UK sets means every radionuclide present is shorter lived than 100 seconds.
uncovered
property
¶
Activity present with no limit and no catch-all, so absent from the index entirely. The number to check before trusting a comfortable index.
uncovered_activity
property
¶
uncovered_activity: float
Total activity with no limit, in this result's units.
uncovered_fraction
property
¶
uncovered_fraction: float
Share of total activity that falls outside the sum, from 0 to 1.
A large value means the index understates the inventory: activity is present that no limit in this set applies to. Zero means every radionuclide present was either limited or explicitly unlimited.
assessed_activity
method descriptor
¶
dominant
method descriptor
¶
clearable_routes
builtin
¶
clearable_routes(material: Material, names: Sequence[str] | None = None, *, metal: bool = False, apply_default_limit: bool = True, exclude_daughters: bool = True) -> list[str]
The limit sets this material already meets, best margin first.
Parameters:
-
(material¶Material) –The inventory to assess.
-
(names¶Sequence[str] | None, default:None) –Limit set names, defaulting to every registered set.
-
(metal¶bool, default:False) –As for
clearance_index. -
(apply_default_limit¶bool, default:True) –As for
clearance_index. -
(exclude_daughters¶bool, default:True) –As for
clearance_index.
Returns:
clearance_index
builtin
¶
clearance_index(material: Material, limit_set: str | LimitSet, *, metal: bool = False, apply_default_limit: bool = True, exclude_daughters: bool = True) -> ClearanceResult
Assess a material against one set of clearance limits.
Parameters:
-
(material¶Material) –The inventory to assess.
-
(limit_set¶str | LimitSet) –A registered limit set name, or a
LimitSet. -
(metal¶bool, default:False) –Whether the material is activated metal, which changes some NRC limits and adds others.
-
(apply_default_limit¶bool, default:True) –Whether to apply the set's catch-all limit to nuclides the table does not list. The UK regulations define one, so leaving this on is what the regulation says; turning it off shows what the listed nuclides alone contribute.
-
(exclude_daughters¶bool, default:True) –Whether to leave out daughters whose parent's limit already covers them, per the regulation's own table. Turning this off double counts them, which is conservative but not what the regulation intends.
Returns:
-
ClearanceResult–A
ClearanceResultcarrying the index and everything needed to judge -
ClearanceResult–it, including any activity that fell outside the sum.
Raises:
-
KeyError–If the limit set name is not registered.
-
InsufficientDataError–If a volumetric set is used and the material has no density.
clearance_indices
builtin
¶
clearance_indices(material: Material, names: Sequence[str] | None = None, *, metal: bool = False, apply_default_limit: bool = True, exclude_daughters: bool = True) -> dict[str, ClearanceResult]
Assess a material against many limit sets at once.
Sets whose units the material cannot supply, such as a volumetric set for a material with no density, are skipped rather than raising, so one missing density does not hide every result that does not need it.
Parameters:
-
(material¶Material) –The inventory to assess.
-
(names¶Sequence[str] | None, default:None) –Limit set names, defaulting to every registered set.
-
(metal¶bool, default:False) –As for
clearance_index. -
(apply_default_limit¶bool, default:True) –As for
clearance_index. -
(exclude_daughters¶bool, default:True) –As for
clearance_index.
Returns:
-
dict[str, ClearanceResult]–Results keyed by limit set name.