Base#

class SequenceBaseBlock(system_specs, name, snap_to_raster=False)[source]#

Bases: SimpleNamespace

Base class for all building blocks, defining the abstract interface for generic interaction with blocks.

All subclases must implent the abstract methods, and all general methods on blocks must only access the implemented methods when no sub-class type check is performed.

Furthermore, all subclasses must call the base-class constructor.

Parameters:
  • system_specs (SystemSpec) –

  • name (str) –

  • snap_to_raster (bool) –

Methods:

copy()

Returns a deep copied building block object

flip([time_flip])

Flips block around specified time point

shift(time_shift)

Shifts block in time

snap_to_raster(system_specs)

rtype:

None

validate(system_specs)

Should raise a ValueError if subclass logic is not met by definition :type system_specs: SystemSpec :param system_specs: :rtype: None :return:

Attributes:

duration

name

tmax

Calculates the largest time occuring in all contained definitions.

tmin

Calculates the smallest time occuring in all contained definitions.

copy()[source]#

Returns a deep copied building block object

Return type:

SequenceBaseBlock

abstract flip(time_flip=None)[source]#

Flips block around specified time point

Parameters:

time_flip (Quantity | None) –

abstract shift(time_shift)[source]#

Shifts block in time

Return type:

None

Parameters:

time_shift (Quantity) –

abstract snap_to_raster(system_specs)[source]#
Return type:

None

Parameters:

system_specs (SystemSpec) –

abstract validate(system_specs)[source]#

Should raise a ValueError if subclass logic is not met by definition :type system_specs: SystemSpec :param system_specs: :rtype: None :return:

Parameters:

system_specs (SystemSpec) –

Return type:

None

property duration: Quantity#
name: str#
property tmax: Quantity#

Calculates the largest time occuring in all contained definitions. :return: Quantity[time]

property tmin: Quantity#

Calculates the smallest time occuring in all contained definitions. :return: Quantity[time]