pytomography.io.PET.prd.yardl_types#

Module Contents#

Classes#

OutOfRangeEnum

Enum that allows values outside of the its defined values.

DateTime

A basic datetime with nanosecond precision, always in UTC.

Time

A basic time of day with nanosecond precision. It is not timezone-aware and is meant

UnionCase

Helper class that provides a standard way to create an ABC using

Functions#

structural_equal(a, b)

Attributes#

Int8

UInt8

Int16

UInt16

Int32

UInt32

Int64

UInt64

Size

Float32

Float64

ComplexFloat

ComplexDouble

_T

exception pytomography.io.PET.prd.yardl_types.ProtocolError[source]#

Bases: Exception

Raised when the contract of a protocol is not respected.

class pytomography.io.PET.prd.yardl_types.OutOfRangeEnum[source]#

Bases: enum.Enum

Enum that allows values outside of the its defined values.

classmethod _missing_(value)[source]#
Parameters:

value (object) –

__eq__(other)[source]#

Return self==value.

Parameters:

other (object) –

__hash__()[source]#

Return hash(self).

Return type:

int

__str__()[source]#

Return str(self).

Return type:

str

__repr__()[source]#

Return repr(self).

Return type:

str

class pytomography.io.PET.prd.yardl_types.DateTime(nanoseconds_from_epoch=0)[source]#

A basic datetime with nanosecond precision, always in UTC.

Parameters:

nanoseconds_from_epoch (Union[int, numpy.datetime64]) –

property numpy_value: numpy.datetime64[source]#
Return type:

numpy.datetime64

to_datetime()[source]#
Return type:

datetime.datetime

static from_components(year, month, day, hour=0, minute=0, second=0, nanosecond=0)[source]#
Parameters:
  • year (int) –

  • month (int) –

  • day (int) –

  • hour (int) –

  • minute (int) –

  • second (int) –

  • nanosecond (int) –

Return type:

DateTime

static from_datetime(dt)[source]#
Parameters:

dt (datetime.datetime) –

Return type:

DateTime

static parse(s)[source]#
Parameters:

s (str) –

Return type:

DateTime

static now()[source]#
Return type:

DateTime

__str__()[source]#

Return str(self).

Return type:

str

__repr__()[source]#

Return repr(self).

Return type:

str

__eq__(other)[source]#

Return self==value.

Parameters:

other (object) –

Return type:

bool

__hash__()[source]#

Return hash(self).

Return type:

int

class pytomography.io.PET.prd.yardl_types.Time(nanoseconds_since_midnight=0)[source]#

A basic time of day with nanosecond precision. It is not timezone-aware and is meant to represent a wall clock time.

Parameters:

nanoseconds_since_midnight (Union[int, numpy.timedelta64]) –

property numpy_value: numpy.timedelta64[source]#
Return type:

numpy.timedelta64

_NANOSECONDS_PER_DAY[source]#
static from_components(hour, minute, second=0, nanosecond=0)[source]#
Parameters:
  • hour (int) –

  • minute (int) –

  • second (int) –

  • nanosecond (int) –

Return type:

Time

static from_time(t)[source]#
Parameters:

t (datetime.time) –

Return type:

Time

static parse(s)[source]#
Parameters:

s (str) –

Return type:

Time

__str__()[source]#

Return str(self).

Return type:

str

__repr__()[source]#

Return repr(self).

Return type:

str

__eq__(other)[source]#

Return self==value.

Parameters:

other (object) –

Return type:

bool

pytomography.io.PET.prd.yardl_types.Int8[source]#
pytomography.io.PET.prd.yardl_types.UInt8[source]#
pytomography.io.PET.prd.yardl_types.Int16[source]#
pytomography.io.PET.prd.yardl_types.UInt16[source]#
pytomography.io.PET.prd.yardl_types.Int32[source]#
pytomography.io.PET.prd.yardl_types.UInt32[source]#
pytomography.io.PET.prd.yardl_types.Int64[source]#
pytomography.io.PET.prd.yardl_types.UInt64[source]#
pytomography.io.PET.prd.yardl_types.Size[source]#
pytomography.io.PET.prd.yardl_types.Float32[source]#
pytomography.io.PET.prd.yardl_types.Float64[source]#
pytomography.io.PET.prd.yardl_types.ComplexFloat[source]#
pytomography.io.PET.prd.yardl_types.ComplexDouble[source]#
pytomography.io.PET.prd.yardl_types.structural_equal(a, b)[source]#
Parameters:
  • a (object) –

  • b (object) –

Return type:

bool

pytomography.io.PET.prd.yardl_types._T[source]#
class pytomography.io.PET.prd.yardl_types.UnionCase(value)[source]#

Bases: abc.ABC, Generic[_T]

Helper class that provides a standard way to create an ABC using inheritance.

Parameters:

value (_T) –

index: int[source]#
tag: str[source]#
__str__()[source]#

Return str(self).

Return type:

str

__repr__()[source]#

Return repr(self).

Return type:

str

__eq__(other)[source]#

Return self==value.

Parameters:

other (object) –

Return type:

bool