exceptions#

Special exceptions raised by Core in certain situations.

Exceptions#

OutOfDomainError

Exception type that indicates a validation error in a Domain.

DomainMismatchError

Exception type raised when two or more domains should match, but don’t.

UnsupportedDomainError

Exception type that indicates that a given domain is not supported.

DomainKeyError

Exception type that indicates that a key is not in the given domain.

DomainColumnError

Exception type for when a column is not in the given domain’s schema.

UnsupportedMetricError

Exception raised when a given metric is not supported.

MetricMismatchError

Exception raised when two or more metrics should match, but don’t.

UnsupportedCombinationError

Raised when a given combination of values is not supported.

UnsupportedMeasureError

Error raised when a given measure is not supported.

MeasureMismatchError

Error raised when two or more measures should match, but don’t.

UnsupportedNoiseMechanismError

Error raised when the given noise mechanism is not supported.

UnsupportedSympyExprError

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#

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#

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#

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#

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
exception UnsupportedMetricError(metric, msg)#

Bases: ValueError

Exception raised when a given metric is not supported.

Parameters
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#

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#

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#

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#

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.