exceptions#
Special exceptions raised by Core in certain situations.
Exceptions#
Exception type that indicates a validation error in a Domain. |
|
Exception type raised when two or more domains should match, but don’t. |
|
Exception type that indicates that a given domain is not supported. |
|
Exception type that indicates that a key is not in the given domain. |
|
Exception type for when a column is not in the given domain’s schema. |
|
Exception raised when a given metric is not supported. |
|
Exception raised when two or more metrics should match, but don’t. |
|
Raised when a given combination of values is not supported. |
|
Error raised when a given measure is not supported. |
|
Error raised when two or more measures should match, but don’t. |
|
Error raised when the given noise mechanism is not supported. |
|
Error raised when trying to use an unsupported Sympy expression. |
- exception OutOfDomainError(domain, value, msg)#
Bases:
Exception
Exception type that indicates a validation error in a Domain.
- Parameters
domain (tmlt.core.domains.base.Domain) –
value (Any) –
msg (str) –
- domain#
The ~tmlt.core.domains.base.Domain on which the exception was raised.
- value#
The value that is not in the domain.
- exception DomainMismatchError(domains, msg)#
Bases:
ValueError
Exception type raised when two or more domains should match, but don’t.
- Parameters
domains (Iterable[tmlt.core.domains.base.Domain]) –
msg (str) –
- domains#
An Iterable of all the ~tmlt.core.domains.base.Domain that should match, but do not.
- exception UnsupportedDomainError(domain, msg)#
Bases:
TypeError
Exception type that indicates that a given domain is not supported.
- Parameters
domain (tmlt.core.domains.base.Domain) –
msg (str) –
- domain#
The ~tmlt.core.domains.base.Domain that is not supported.
- exception DomainKeyError(domain, key, msg)#
Bases:
Exception
Exception type that indicates that a key is not in the given domain.
- Parameters
domain (tmlt.core.domains.base.Domain) –
key (Any) –
msg (str) –
- domain#
The ~tmlt.core.domains.base.Domain on which this error was raised.
- key#
The key that was not in the domain, or a collection of keys that are not in the domain.
- exception DomainColumnError(domain, column, msg)#
Bases:
Exception
Exception type for when a column is not in the given domain’s schema.
- Parameters
domain (tmlt.core.domains.base.Domain) –
msg (str) –
- exception UnsupportedMetricError(metric, msg)#
Bases:
ValueError
Exception raised when a given metric is not supported.
- Parameters
metric (tmlt.core.metrics.Metric) –
msg (str) –
- metric#
The metric that is not supported.
- exception MetricMismatchError(metrics, msg)#
Bases:
ValueError
Exception raised when two or more metrics should match, but don’t.
- Parameters
metrics (Iterable[tmlt.core.metrics.Metric]) –
msg (str) –
- metrics#
The metrics that should match, but do not.
- exception UnsupportedCombinationError(combination, msg)#
Bases:
ValueError
Raised when a given combination of values is not supported.
If this exception is raised, any of the values used may be individually valid, but they are not valid in this particular combination.
For example, when a metric does not support a given domain, this is the error that is raised.
- Parameters
combination (Iterable[Any]) –
msg (str) –
- combination#
The combination of values that are not supported.
- exception UnsupportedMeasureError(measure, msg)#
Bases:
ValueError
Error raised when a given measure is not supported.
- Parameters
measure (tmlt.core.measures.Measure) –
msg (str) –
- measure#
The ~tmlt.core.measures.Measure that is not supported.
- exception MeasureMismatchError(measures, msg)#
Bases:
ValueError
Error raised when two or more measures should match, but don’t.
- Parameters
measures (Iterable[tmlt.core.measures.Measure]) –
msg (str) –
- measures#
An ~Iterable with multiple ~tmlt.core.measures.Measure that should match, but don’t.
- exception UnsupportedNoiseMechanismError(noise_mechanism, msg)#
Bases:
ValueError
Error raised when the given noise mechanism is not supported.
- Parameters
noise_mechanism (tmlt.core.measurements.aggregations.NoiseMechanism) –
msg (str) –
- noise_mechanism#
The ~tmlt.core.measurements.aggregations.NoiseMechanism that is not supported.
- exception UnsupportedSympyExprError(expr, msg)#
Bases:
ValueError
Error raised when trying to use an unsupported Sympy expression.
This error is raised when an ~tmlt.core.utils.exact_number.ExactNumber cannot be created from a given SymPy expression. This might be raised because the expression corresponds to an imaginary number, because the expression has a free variable, or because the expression is a kind of Sympy expression that ExactNumber does not support (such as sums).
- Parameters
expr (sympy.Expr) –
msg (str) –
- expr#
the invalid Sympy expression.