hmf.core.domain¶
Model domains and the domain policy (issue #390).
Each model will carry two domains, as class variables:
valid_domainWhere the model’s formula is mathematically defined or sensible (e.g. sigma > 0). Outside it, evaluation always raises.
calibration_domainWhere the model was calibrated against simulations. Outside it, results are extrapolations, handled according to the user’s
DomainPolicy.
This module provides the Domain type describing either, and
apply_domain_policy(), which applies a policy to a result.
Bounds are given in the canonical units of hmf.core.units.CANONICAL_UNITS.
A bound on a dimensional variable is a Quantity; the values
checked against it must then be Quantities too.
Classes
|
A region of the space of a model's input variables: one interval per variable. |
|
A closed interval |
Functions
|
Apply a domain policy to a result computed (partly) outside a domain. |
Exceptions
|
Inputs are outside a model's domain, and the policy forbids that. |