Skip to content

limits

Limit sets: the regulatory tables a material is measured against.

limits

Limit sets: the regulatory tables a material is measured against.

Every limit set is data, compiled into the extension from the JSON in crates/radiological-material-clearance-finder/data/limits. Adding a jurisdiction means adding a file and a build script, never a branch in the calculation. Only two things in these regulations cannot be expressed as a table, and both are named explicitly rather than worked around:

  • limits given per gram of material (the NRC's nCi/g transuranic entries), which need the material's density before they can be compared against Ci/m3, and
  • limits that depend on the material's own nuclides (the NRC Class A rule that anything with a half-life under five years takes a 700 Ci/m3 limit), named in DYNAMIC_RULES.

Classes:

  • LimitSet –

    A named table of per-nuclide activity limits.

Functions:

Attributes:

DYNAMIC_RULES module-attribute

DYNAMIC_RULES: tuple[str, ...] = ('nrc_short_lived_class_a',)

Built-in immutable sequence.

If no argument is given, the constructor returns an empty tuple. If iterable is specified the tuple is initialized from iterable's items.

If the argument is a tuple, the return value is the same object.

LimitSet

A named table of per-nuclide activity limits.

Every nuclide name is canonicalised on construction, so a hand-written "Co-60" behaves exactly like a loaded "Co60", and values that cannot mean anything (a zero, negative or infinite limit, unknown units, a non-positive threshold) raise ValueError.

Parameters:

  • name

    (str) –

    Stable identifier, such as UK_EPR16_out_of_scope.

  • label

    (str) –

    Human readable description for reports.

  • units

    (str) –

    Activity units the limits are in: Bq/g, Ci/m3, or Bq for a total activity limit, which needs the material's mass.

  • limits

    (Mapping[str, float]) –

    Limit per nuclide name. A whole chain "sec" value goes under a _sec key, such as U238_sec.

  • jurisdiction

    (str, default: '' ) –

    Issuing authority, such as UK or Germany.

  • default_limit

    (float | None, default: None ) –

    Limit applied to a nuclide absent from limits, or None where the regulation has no catch-all. Three UK sets define one: 0.01 Bq/g for UK_EPR16_out_of_scope and UK_IRR17_notification, and 0.1 Bq/g for UK_IRR17_registration.

  • unlimited

    (Sequence[str], default: () ) –

    Nuclides the source explicitly places no limit on. They are covered, and contribute nothing, which is different from being absent.

  • secular_equilibrium

    (Mapping[str, Sequence[str]], default: ... ) –

    Parent to the daughters whose contribution the parent's limit already includes, the "+" rows.

  • secular_equilibrium_sec

    (Mapping[str, Sequence[str]], default: ... ) –

    Parent to the daughters covered by its whole chain "sec" value, usually a much longer list with a much stricter limit. UK EPR 2016 gives U-238 three progeny at 1 Bq/g under "U-238+" and fourteen at 0.01 Bq/g under "U-238sec".

  • limits_secular_equilibrium

    (Mapping[str, float], default: ... ) –

    The limit for a parent listed twice, plain and marked "+", when its daughters are actually present. StrlSchV gives Th-232 as 10 Bq/g plain and 0.01 Bq/g marked.

  • metal_overrides

    (Mapping[str, float], default: ... ) –

    Limits replacing or adding to limits when the material is activated metal.

  • limits_per_gram

    (Mapping[str, float], default: ... ) –

    Limits in nCi/g, converted using the material density.

  • limits_upper

    (Mapping[str, float], default: ... ) –

    Upper end of a limit given as a range in the source, kept for reference. limits holds the conservative lower end.

  • dynamic_rule

    (str | None, default: None ) –

    Name of a rule that depends on the material's own nuclides, one of DYNAMIC_RULES.

  • min_half_life_scope

    (float | None, default: None ) –

    Half-life in seconds below which, if every radionuclide present falls under it, the material is outside the regulation altogether. A whole-material test, not a per-nuclide filter.

  • threshold

    (float, default: 1.0 ) –

    Index value at or above which the material fails, normally 1.

  • source

    (str, default: '' ) –

    The regulation the set is taken from.

  • url

    (str, default: '' ) –

    Where the source was retrieved from.

  • retrieved

    (str, default: '' ) –

    When it was retrieved.

  • notes

    (str, default: '' ) –

    Anything else worth knowing.

Methods:

  • __eq__ –

    Return self==value.

  • __ge__ –

    Return self>=value.

  • __gt__ –

    Return self>value.

  • __hash__ –

    Return hash(self).

  • __le__ –

    Return self<=value.

  • __len__ –

    Return len(self).

  • __lt__ –

    Return self<value.

  • __ne__ –

    Return self!=value.

  • __new__ –

    Create and return a new object. See help(type) for accurate signature.

  • __repr__ –

    Return repr(self).

  • daughters_of –

    Daughters whose activity this set's limit for parent already covers.

Attributes:

__doc__ class-attribute

__doc__ = 'A named table of per-nuclide activity limits.\n\nEvery nuclide name is canonicalised on construction, so a hand-written\n``"Co-60"`` behaves exactly like a loaded ``"Co60"``, and values that cannot\nmean anything (a zero, negative or infinite limit, unknown units, a\nnon-positive threshold) raise ValueError.\n\nArgs:\n    name: Stable identifier, such as ``UK_EPR16_out_of_scope``.\n    label: Human readable description for reports.\n    units: Activity units the limits are in: ``Bq/g``, ``Ci/m3``, or ``Bq``\n        for a total activity limit, which needs the material\'s mass.\n    limits: Limit per nuclide name. A whole chain "sec" value goes under a\n        ``_sec`` key, such as ``U238_sec``.\n    jurisdiction: Issuing authority, such as ``UK`` or ``Germany``.\n    default_limit: Limit applied to a nuclide absent from ``limits``, or\n        ``None`` where the regulation has no catch-all. Three UK sets define\n        one: 0.01 Bq/g for ``UK_EPR16_out_of_scope`` and\n        ``UK_IRR17_notification``, and 0.1 Bq/g for\n        ``UK_IRR17_registration``.\n    unlimited: Nuclides the source explicitly places no limit on. They are\n        covered, and contribute nothing, which is different from being\n        absent.\n    secular_equilibrium: Parent to the daughters whose contribution the\n        parent\'s limit already includes, the "+" rows.\n    secular_equilibrium_sec: Parent to the daughters covered by its whole\n        chain "sec" value, usually a much longer list with a much stricter\n        limit. UK EPR 2016 gives U-238 three progeny at 1 Bq/g under\n        "U-238+" and fourteen at 0.01 Bq/g under "U-238sec".\n    limits_secular_equilibrium: The limit for a parent listed twice, plain\n        and marked "+", when its daughters are actually present. StrlSchV\n        gives Th-232 as 10 Bq/g plain and 0.01 Bq/g marked.\n    metal_overrides: Limits replacing or adding to ``limits`` when the\n        material is activated metal.\n    limits_per_gram: Limits in nCi/g, converted using the material density.\n    limits_upper: Upper end of a limit given as a range in the source, kept\n        for reference. ``limits`` holds the conservative lower end.\n    dynamic_rule: Name of a rule that depends on the material\'s own\n        nuclides, one of `DYNAMIC_RULES`.\n    min_half_life_scope: Half-life in seconds below which, if *every*\n        radionuclide present falls under it, the material is outside the\n        regulation altogether. A whole-material test, not a per-nuclide\n        filter.\n    threshold: Index value at or above which the material fails, normally 1.\n    source: The regulation the set is taken from.\n    url: Where the source was retrieved from.\n    retrieved: When it was retrieved.\n    notes: Anything else worth knowing.'

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

__module__ = 'radiological_material_clearance_finder._core'

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'.

covered_nuclides property

covered_nuclides: frozenset[str]

Every nuclide this set names, whether limited or explicitly unlimited.

The _sec keys are whole chain variants of a nuclide already counted, not nuclides of their own, so they are not included.

default_limit property

default_limit: float | None

The catch-all limit for unlisted nuclides, or None.

dynamic_rule property

dynamic_rule: str | None

Name of the rule that depends on the material's own nuclides, or None.

jurisdiction property

jurisdiction: str

Issuing authority.

label property

label: str

Human readable description for reports.

limits property

limits: dict[str, float]

Limit per canonical nuclide name, with whole chain values under _sec.

limits_per_gram property

limits_per_gram: dict[str, float]

Limits in nCi/g.

limits_secular_equilibrium property

limits_secular_equilibrium: dict[str, float]

The limit for a parent listed twice, applied when its daughters are present.

limits_upper property

limits_upper: dict[str, float]

Upper end of limits the source gives as a range.

metal_overrides property

metal_overrides: dict[str, float]

Limits replacing or adding to limits for activated metal.

min_half_life_scope property

min_half_life_scope: float | None

The whole-material short half-life scope test, in seconds, or None.

name property

name: str

Stable identifier, such as UK_EPR16_out_of_scope.

notes property

notes: str

Anything else worth knowing about the set.

retrieved property

retrieved: str

When the source was retrieved.

secular_equilibrium property

secular_equilibrium: dict[str, tuple[str, ...]]

The "+" rows: parent to the daughters its limit covers.

secular_equilibrium_sec property

secular_equilibrium_sec: dict[str, tuple[str, ...]]

The "sec" rows: parent to the daughters its whole chain value covers.

source property

source: str

The regulation this set is taken from.

threshold property

threshold: float

The index value at or above which a material fails.

units property

units: str

Activity units the limits are in.

unlimited property

unlimited: tuple[str, ...]

Nuclides the source explicitly places no limit on.

url property

url: str

Where the source was retrieved from.

__eq__ method descriptor

__eq__(value)

Return self==value.

__ge__ method descriptor

__ge__(value)

Return self>=value.

__gt__ method descriptor

__gt__(value)

Return self>value.

__hash__ method descriptor

__hash__() -> int

Return hash(self).

__le__ method descriptor

__le__(value)

Return self<=value.

__len__ method descriptor

__len__() -> int

Return len(self).

__lt__ method descriptor

__lt__(value)

Return self<value.

__ne__ method descriptor

__ne__(value)

Return self!=value.

__new__ builtin

__new__(*args, **kwargs)

Create and return a new object. See help(type) for accurate signature.

__repr__ method descriptor

__repr__()

Return repr(self).

daughters_of method descriptor

daughters_of(parent: str) -> tuple[str, ...]

Daughters whose activity this set's limit for parent already covers.

get_limit_set builtin

get_limit_set(name: str | LimitSet) -> LimitSet

Look up a limit set by name.

Parameters:

  • name

    (str | LimitSet) –

    A registered name, or an already built LimitSet, which is returned as is.

Raises:

  • KeyError –

    If no such set is registered, listing the ones that are.

limit_sets builtin

limit_sets(jurisdiction: str | None = None) -> tuple[str, ...]

Names of the available limit sets, sorted.

Parameters:

  • jurisdiction

    (str | None, default: None ) –

    Restrict to one issuing authority, such as UK.

register_limit_set builtin

register_limit_set(limit_set: LimitSet) -> None

Add a limit set at runtime, for a site-specific or draft table.

Parameters:

  • limit_set

    (LimitSet) –

    The set to register. Replaces any set of the same name, warning first if that name came from the shipped regulatory data, since shadowing a published table by accident would be hard to spot in a result that only records the name.