limits - 1D zones#

Here we implement 1D zones, namely UpperLimit, LowerLimit and Limits

from atomsmltr.environment.zones import Limits

xlim = Limits(min=-1, max=1, axis=0, target="position", action="stop", tag="xlim")
vxlim = Limits(min=0, max=500, axis=0, target="speed", action="stop", tag="vxlim")
class atomsmltr.environment.zones.limits.Limits(min: float, max: float, axis: int = 0, target: str = 'position', action: str = 'stop', tag: str = None, in_tag: str = None, out_tag: str = None)[source]#

Bases: Zone

Defines a 1D segment, with min / max value

Parameters:
  • min (float) – minimum value

  • max (float) – maximum value

  • axis (int, optional) – axis to consider (0:x, 1:y, 2:z), by default 0

  • target (str, optional) – the target for the zone, can be “position” or “speed”, by default “position”

  • action (str, optional) – the action associated to the zone. implemented actions = [“stop”, “ignore”], default is “stop”

  • tag (str, optional) – the zone tag

  • in_tag (str, optional) – tag for an object inside the zone, by default None

  • out_tag (str, optional) – tag for an object inside the zone, by default None

Example

>>> xlim = Limits(min=-1, max=1, axis=0, target="position", action="stop", tag="xlim")
property axis: int#

the target axis

Type:

int

gen_infostring_obj()[source]#

Generates an info string object

property max: float#

the upper limit

Type:

float

property min: float#

the lower limit

Type:

float

property type#

a description of the object type

Type:

str

class atomsmltr.environment.zones.limits.LowerLimit(value: float, axis: int = 0, target: str = 'position', action: str = 'stop', tag: str = None, in_tag: str = None, out_tag: str = None)[source]#

Bases: SingleLimit

Defines a zone by its (1D) upper limit

Parameters:
  • value (float) – the lower limit

  • axis (int, optional) – axis to consider (0:x, 1:y, 2:z), by default 0

  • target (str, optional) – the target for the zone, can be “position” or “speed”, by default “position”

  • action (str, optional) – the action associated to the zone. implemented actions = [“stop”, “ignore”], default is “stop”

  • tag (str, optional) – the zone tag

  • in_tag (str, optional) – tag for an object inside the zone, by default None

  • out_tag (str, optional) – tag for an object inside the zone, by default None

Example

>>> low_x = LowerLimit(value=-5, axis=0, tag="lowx")
property type#

a description of the object type

Type:

str

class atomsmltr.environment.zones.limits.SingleLimit(value: float, axis: int = 0, *args, **kwargs)[source]#

Bases: Zone

A generic class for SingleLimits

property axis: int#

the limit target axis

Type:

int

gen_infostring_obj()[source]#

Generates an info string object

property value: float#

the limit value

Type:

float

class atomsmltr.environment.zones.limits.UpperLimit(value: float, axis: int = 0, target: str = 'position', action: str = 'stop', tag: str = None, in_tag: str = None, out_tag: str = None)[source]#

Bases: SingleLimit

Defines a zone by its (1D) upper limit

Parameters:
  • value (float) – the upper limit

  • axis (int, optional) – axis to consider (0:x, 1:y, 2:z), by default 0

  • target (str, optional) – the target for the zone, can be “position” or “speed”, by default “position”

  • action (str, optional) – the action associated to the zone. implemented actions = [“stop”, “ignore”], default is “stop”

  • tag (str, optional) – the zone tag

  • in_tag (str, optional) – tag for an object inside the zone, by default None

  • out_tag (str, optional) – tag for an object inside the zone, by default None

Example

>>> up_x = UpperLimit(value=5, axis=0, tag="upx")
property type#

a description of the object type

Type:

str