atomiq.heros¶
Attributes¶
Classes¶
Base class for objects exposed through HEROS. |
Functions¶
To import heros, we have to play tricks here. Since the artiq worker calls our code |
|
|
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.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, realm='heros')[source]¶
Bases:
LocalHEROBase 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, Ellipsis] = ()¶
- blocks: tuple[str, Ellipsis] = ()¶
- default_arguments: dict[str, 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.
- _set_dataset(*args, **kwargs)¶
Exposes the ARTIQ experiment set_dataset function.
Note, that using this function is discuraged as using native HEROS data archiving and distribution is more powerful. This function exists to provide compatibility for existing setups to migrate to atomiq more smoothly.
- _mutate_dataset(*args, **kwargs)¶
Exposes the ARTIQ experiment mutate_dataset function.
Note, that using this function is discuraged as using native HEROS data archiving and distribution is more powerful. This function exists to provide compatibility for existing setups to migrate to atomiq more smoothly.
- _append_to_dataset(*args, **kwargs)¶
Exposes the ARTIQ experiment append_to_dataset function.
Note, that using this function is discuraged as using native HEROS data archiving and distribution is more powerful. This function exists to provide compatibility for existing setups to migrate to atomiq more smoothly.
- _get_dataset(*args, **kwargs)¶
Exposes the ARTIQ experiment get_dataset function.
Note, that using this function is discuraged as using native HEROS data archiving and distribution is more powerful. This function exists to provide compatibility for existing setups to migrate to atomiq more smoothly.
- _get_dataset_metadata(*args, **kwargs)¶
Exposes the ARTIQ experiment get_dataset_metadata function.
Note, that using this function is discuraged as using native HEROS data archiving and distribution is more powerful. This function exists to provide compatibility for existing setups to migrate to atomiq more smoothly.
- emit_data(data)¶