mpylab.limits.limit module¶
Common callable contract for emission limit profiles.
- class mpylab.limits.limit.Limit
Bases:
objectBase for emission profiles with a compatible
limitlinecallable.Notes
The stored
limitlineentry retains the original bound curve method, including when reading legacy pickles. Public access validates frequencies, preserves array shape and returns a float for a scalar frequency.- assess_frequency(frequency)
Assess a single emission frequency without implying a pass.
- Parameters:
frequency (float) – Finite positive emission frequency in Hz.
- Returns:
statusis applicable, exempt, unresolved or out_of_range;valueis the numerical limit or None,unitis the profile unit, andreasonexplains unavailable values. Exempt does not establish overall equipment compliance.- Return type:
dict
- Raises:
ValueError – If frequency is invalid or is not a scalar.
- property limitline
Return the validated curve callable, or None before selection.
- Returns:
Function accepting finite positive Hz values. Returns a float for a scalar and an ndarray of matching shape for arrays. Out-of-range frequencies return NaN; invalid frequencies raise ValueError.
- Return type:
callable or None
- no_limit(f)
Return NaN for each valid frequency without implying applicability.
- Parameters:
f (float or array_like) – Finite positive frequencies in Hz.
- Returns:
NaN values with the same shape as the input.
- Return type:
float or numpy.ndarray
- Raises:
ValueError – If any frequency is nonpositive or nonfinite.
- property variant_status
Return implemented, unresolved or explicitly not_applicable.
An implemented profile has a selected curve; this does not certify its normative edition or applicability. Missing definitions are unresolved, never automatically interpreted as absence of a normative limit.
- Returns:
implemented,unresolvedornot_applicable. The last status requires an explicit, evidenced subclass declaration.- Return type:
str
- mpylab.limits.limit.log_linear(f1, v1, f2, v2)
Return a line interpolated logarithmically in frequency.
- Parameters:
f1 (float) – Positive endpoint frequencies in Hz.
f2 (float) – Positive endpoint frequencies in Hz.
v1 (float) – Endpoint levels in the profile’s logarithmic unit.
v2 (float) – Endpoint levels in the profile’s logarithmic unit.
- Returns:
Function evaluating the interpolated level.
- Return type:
callable