atomiq.heros

Attributes

Classes

AtomiqHERO

Base class for objects exposed through HEROS.

Functions

get_heros()

To import heros, we have to play tricks here. Since the artiq worker calls our code

stringify_component(component)

Get a stringified version of the component.

Module Contents

atomiq.heros.get_heros()[source]

To import heros, we have to play tricks here. Since the artiq worker calls our code in the artiq.master.worker_impl.examine function and afterwards removes the imported modules from sys.modules. The PyO3 used for the python zenoh bindings does not like this since then every subsequent import heros will reinitialize the PyO3 rust extension, leading to the error

PyO3 modules compiled for CPython 3.8 or older may only be initialized once per interpreter process

To work around this, we save a reference to the heros module in the sys module and use this reference if it exists. We use the sys module since it should always exist.

atomiq.heros.heros
atomiq.heros.LocalHERO[source]
atomiq.heros.stringify_component(component)[source]

Get a stringified version of the component. If just a component is supplied, we return the name, if it is a tuple or list, we assume the first key to be the name and the second one to be the type.

class atomiq.heros.AtomiqHERO(experiment)[source]

Bases: LocalHERO

Base class for objects exposed through HEROS. Any object that should be able to be accessed remotely must be based off this class.

Parameters:
  • name -- name/identifier under which the object is available. Make sure this name is unique in the realm.

  • realm -- realm the HERO should exist in. default is "heros"

  • implements -- list of interfaces that are implemented by the hero

  • tags -- list of tags to identify and classify the hero

name: str = ''
rid: int = -1
chunksize = -1
components: tuple[str] = ()
blocks: tuple[str] = ()
default_arguments: dict[dict] | None = None
experiment
property step_counter
property identifier
property steps_total

Return the total number of steps. Since this is only available after the prepare stage of the experiment, the method returns -1 if the prepare was not yet run.

terminate()[source]
emit_data(data)