cooling¶
Finding the cooling time at which a material becomes clearable.
cooling
¶
Finding when a material becomes clearable.
This package computes no decay of its own. The caller supplies a series of materials at increasing cooling times, which is what a depletion calculation already produces, and this finds where the clearance index crosses the threshold.
Classes:
-
IngrowthError–Raised when the index climbs back above the threshold after clearing.
Functions:
-
index_series–Evaluate the clearance index at each cooling time.
-
time_to_clear–Find the cooling time at which a material first meets a set of limits.
IngrowthError
¶
Bases: builtins.ValueError
Raised when the index climbs back above the threshold after clearing.
An index that rises with cooling time means a daughter is growing in faster than its parent decays, so a material can meet the limits at one time and fail them later. Reporting only the first crossing would be actively misleading, so this is raised instead.
Attributes:
-
__doc__–str(object='') -> str
-
__module__–str(object='') -> str
-
__weakref__–list of weak references to the object
__doc__
class-attribute
¶
__doc__ = 'Raised when the index climbs back above the threshold after clearing.\n\nAn index that rises with cooling time means a daughter is growing in faster than its parent decays, so a material can meet the limits at one time and fail them later. Reporting only the first crossing would be actively misleading, so this is raised instead.'
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'.
index_series
builtin
¶
index_series(series: Mapping[float, Material], limit_set: str | LimitSet, *, metal: bool = False, apply_default_limit: bool = True, exclude_daughters: bool = True) -> dict[float, float]
Evaluate the clearance index at each cooling time.
Parameters:
-
(series¶Mapping[float, Material]) –Cooling time in seconds to the material at that time.
-
(limit_set¶str | LimitSet) –A registered limit set name, or a
LimitSet. -
(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:
time_to_clear
builtin
¶
time_to_clear(series: Mapping[float, Material], limit_set: str | LimitSet, *, allow_ingrowth: bool = False, metal: bool = False, apply_default_limit: bool = True, exclude_daughters: bool = True) -> float | None
Find the cooling time at which a material first meets a set of limits.
The index falls roughly exponentially with cooling time, so this interpolates logarithmically in the index between the two samples that bracket the threshold. Interpolating linearly instead would place the crossing systematically late, by a factor that grows with the spacing of the samples.
Parameters:
-
(series¶Mapping[float, Material]) –Cooling time in seconds to the material at that time. Times need not be sorted or evenly spaced.
-
(limit_set¶str | LimitSet) –A registered limit set name, or a
LimitSet. -
(allow_ingrowth¶bool, default:False) –Return the first crossing even when the index later climbs back above the threshold, rather than raising
IngrowthError. -
(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:
-
float | None–The cooling time in seconds at which the index first falls below the
-
float | None–threshold. If the earliest sample already meets it, that sample's time
-
float | None–is returned rather than zero, since the series says nothing about
-
float | None–anything earlier.
Noneif the series never meets it.
Raises:
-
ValueError–If fewer than two times are given.
-
IngrowthError–If the index climbs back above the threshold at a later time, so the material does not stay clear.