# BioSimSpace.Types.Time¶

class BioSimSpace.Types.Time(*args)

A time type.

__init__(*args)

Constructor.

*args can be a value and unit, or a string representation of the time, e.g. “0.2 fs”.

Parameters
• value (float) – The value.

• unit (str) – The unit.

• string (str) – A string representation of the time.

Examples

Create an object representing a time of 17.3 femtoseconds then print the time in nanoseconds.

>>> import BioSimSpace as BSS
>>> time = BSS.Types.Time(17.3, "fs")
>>> print(time.nanoseconds())


The same as above, except passing a string representation of the time to the constructor.

>>> import BioSimSpace as BSS
>>> time = BSS.Types.Time("17.3 fs")
>>> print(time.nanoseconds())


The string matching is extremeley flexible, so all of the following would be valid arguments: “17.3 fs”, “17.3 femtoseconds”, “1.73e1 fs”.

Methods

 __init__(*args) Constructor. Return the power in the ‘angle’ dimension. Return the power in the ‘charge’ dimension. Return the time in days. Return the dimensions of this type. Return the time in femtoseconds. Return the time in hours. Return the power in the ‘length’ dimension. Return the power in the ‘mass’ dimension. Return the time in milliseconds. Return the time in minutes. Return the time in nanoseconds. Return the time in picoseconds. Return the power in the ‘quantity’ dimension. Return the time in seconds. Return the power in the ‘temperature’ dimension. Return the power in the ‘time’ dimension. Return the unit. Return the value.
classmethod angle()

Return the power in the ‘angle’ dimension.

Returns

angle – The power in the ‘angle’ dimension.

Return type

int

classmethod charge()

Return the power in the ‘charge’ dimension.

Returns

charge – The power in the ‘charge’ dimension.

Return type

int

days()

Return the time in days.

Returns

time – The time in days.

Return type

Time

classmethod dimensions()

Return the dimensions of this type. This is a tuple containing the power in each dimension.

Returns(int, int, int, int, int, int)

The power in each dimension: ‘angle’, ‘charge’, ‘length’, ‘mass’, ‘quantity’, ‘temperature’, and ‘time’.

femtoseconds()

Return the time in femtoseconds.

Returns

time – The time in femtoseconds.

Return type

Time

hours()

Return the time in hours.

Returns

time – The time in hours.

Return type

Time

classmethod length()

Return the power in the ‘length’ dimension.

Returns

length – The power in the ‘length’ dimension.

Return type

int

classmethod mass()

Return the power in the ‘mass’ dimension.

Returns

mass – The power in the ‘mass’ dimension.

Return type

int

milliseconds()

Return the time in milliseconds.

Returns

time – The time in milliseconds.

Return type

Time

minutes()

Return the time in minutes.

Returns

time – The time in minutes.

Return type

Time

nanoseconds()

Return the time in nanoseconds.

Returns

time – The time in nanoseconds.

Return type

Time

picoseconds()

Return the time in picoseconds.

Returns

time – The time in picoseconds.

Return type

Time

classmethod quantity()

Return the power in the ‘quantity’ dimension.

Returns

quantity – The power in the ‘quantity’ dimension.

Return type

int

seconds()

Return the time in seconds.

Returns

time – The time in seconds.

Return type

Time

classmethod temperature()

Return the power in the ‘temperature’ dimension.

Returns

temperature – The power in the ‘temperature’ dimension.

Return type

int

classmethod time()

Return the power in the ‘time’ dimension.

Returns

time – The power the ‘time’ dimension.

Return type

int

unit()

Return the unit.

Returns

unit – The unit of the type.

Return type

str

value()

Return the value.

Returns

value – The value of the type.

Return type

float