obspy.core.event.base.QuantityError

class QuantityError(uncertainty=None, lower_uncertainty=None, upper_uncertainty=None, confidence_level=None)[source]

Bases: AttribDict

Uncertainty information for a physical quantity.

Parameters:
  • uncertainty (float) – Uncertainty as the absolute value of symmetric deviation from the main value.

  • lower_uncertainty (float) – Uncertainty as the absolute value of deviation from the main value towards smaller values.

  • upper_uncertainty (float) – Uncertainty as the absolute value of deviation from the main value towards larger values.

  • confidence_level (float) – Confidence level of the uncertainty, given in percent (0-100).

Attributes

defaults

do_not_warn_on

readonly

warn_on_non_default_key

Public Methods

clear

copy

get

items

keys

pop

If key is not found, d is returned if given, otherwise KeyError is raised.

popitem

as a 2-tuple; but raise KeyError if D is empty.

setdefault

update

values

Private Methods

Warning

Private methods are mainly for internal/developer use and their API might change without notice.

QuantityError._cast_type(key, value)

Cast type of value to type required in _types dict.

Parameters:
  • key (str) – The key from __setattr__.

  • value – The value being set to key.

Returns:

value cast to correct type.

QuantityError._pretty_str(priorized_keys=[], min_label_length=16)

Return better readable string representation of AttribDict object.

Parameters:
  • priorized_keys (list[str], optional) – Keywords of current AttribDict which will be shown before all other keywords. Those keywords must exists otherwise an exception will be raised. Defaults to empty list.

  • min_label_length (int, optional) – Minimum label length for keywords. Defaults to 16.

Returns:

String representation of current AttribDict object.

Special Methods

QuantityError.__bool__()[source]

Boolean testing for QuantityError.

QuantityError evaluates True if any of the default fields is not None. Setting non default fields raises also an UserWarning which is the reason we have to skip those lines in the doctest below.

>>> err = QuantityError()
>>> bool(err)
False
>>> err.custom_field = "spam"  
>>> bool(err)
False
>>> err.uncertainty = 0.05
>>> bool(err)
True
>>> del err.custom_field  
>>> bool(err)
True
classmethod QuantityError.__class_getitem__()

Represent a PEP 585 generic type

E.g. for t = list[int], t.__origin__ is list and t.__args__ is (int,).

QuantityError.__contains__(key)
QuantityError.__delattr__(name)
QuantityError.__delitem__(name)
QuantityError.__dir__()

Default dir() implementation.

QuantityError.__eq__(other)[source]
QuantityError.__format__(format_spec, /)

Default object formatter.

QuantityError.__ge__(value, /)

Return self>=value.

QuantityError.__getattr__(name, default=None)

Py3k hasattr() expects an AttributeError no KeyError to be raised if the attribute is not found.

QuantityError.__getattribute__(name, /)

Return getattr(self, name).

QuantityError.__getitem__(name, default=None)
QuantityError.__gt__(value, /)

Return self>value.

QuantityError.__init__(uncertainty=None, lower_uncertainty=None, upper_uncertainty=None, confidence_level=None)[source]
QuantityError.__init_subclass__()

This method is called when a class is subclassed.

The default implementation does nothing. It may be overridden to extend subclasses.

QuantityError.__iter__()
QuantityError.__le__(value, /)

Return self<=value.

QuantityError.__len__()
QuantityError.__lt__(value, /)

Return self<value.

QuantityError.__ne__(value, /)

Return self!=value.

QuantityError.__new__(**kwargs)
QuantityError.__reduce__()

Helper for pickle.

QuantityError.__reduce_ex__(protocol, /)

Helper for pickle.

QuantityError.__repr__()
QuantityError.__setattr__(key, value)
QuantityError.__setitem__(key, value)
QuantityError.__sizeof__()

Size of object in memory, in bytes.

QuantityError.__str__()

Return str(self).

classmethod QuantityError.__subclasshook__(C)