BioSimSpace.Gateway.Temperature

class BioSimSpace.Gateway.Temperature(help=None, default=None, unit=None, minimum=None, maximum=None, allowed=None)

A temperature requirement.

Examples

Create a temperature requirement with a default of 300 kelvin.

>>> import BioSimSpace as BSS
>>> my_temperature = BSS.Gateway.Temperature(help="A temperature requirement", default=300, unit="kelvin")

The same, but explicitly passing a Temperature for the default.

>>> import BioSimSpace as BSS
>>> my_temperature = BSS.Gateway.Temperature(help="A temperature requirement", default=300*BSS.Units.Temperature.kelvin)

Create a temperature requirement with a default of 300 Kelvin and a maximum of 100 Celsius. Note that the unit is taken from the default value.

>>> import BioSimSpace as BSS
>>> my_temperature = BSS.Gateway.Temperature(help="A temperature requirement",
...                                          default=300*BSS.Units.Temperature.kelvin,
...                                          maximum=100*BSS.Units.Temperature.celsius)
__init__(help=None, default=None, unit=None, minimum=None, maximum=None, allowed=None)

Constructor.

Parameters
  • help (str) – The help string.

  • default (Temperature) – The default value.

  • unit (str) – The unit.

  • minimum (Temperature) – The minimum allowed value.

  • maximum (Temperature) – The maximum allowed value.

  • allowed ([Temperature]) – A list of allowed values.

Methods

__delattr__(name, /)

Implement delattr(self, name).

__dir__()

Default dir() implementation.

__eq__(value, /)

Return self==value.

__format__(format_spec, /)

Default object formatter.

__ge__(value, /)

Return self>=value.

__getattribute__(name, /)

Return getattr(self, name).

__gt__(value, /)

Return self>value.

__hash__()

Return hash(self).

__init__([help, default, unit, minimum, …])

Constructor.

__init_subclass__

This method is called when a class is subclassed.

__le__(value, /)

Return self<=value.

__lt__(value, /)

Return self<value.

__ne__(value, /)

Return self!=value.

__new__(**kwargs)

Create and return a new object.

__reduce__()

Helper for pickle.

__reduce_ex__(protocol, /)

Helper for pickle.

__repr__()

Return repr(self).

__setattr__(name, value, /)

Implement setattr(self, name, value).

__sizeof__()

Size of object in memory, in bytes.

__str__()

Return str(self).

__subclasshook__

Abstract classes can override this to customize issubclass().

_validate(value)

Validate that the value is of the correct type.

_validate_default()

Validate the default value.

getAllowedValues()

Return the allowed values.

getArgType()

The command-line argument type.

getDefault()

Return the default value.

getHelp()

Return the documentation string.

getMax()

Return the maximum allowed value.

getMin()

Return the minimum allowed value.

getUnit()

Return the unit.

getValue()

Return the value.

isMulti()

Whether the requirement has multiple values.

isOptional()

Whether the requirement is optional.

setValue(value[, name])

Validate and set the value.

Attributes

__dict__

__doc__

__module__

__weakref__

list of weak references to the object (if defined)

_is_multi