atomiq.heros ============ .. py:module:: atomiq.heros Attributes ---------- .. autoapisummary:: atomiq.heros.heros atomiq.heros.LocalHERO Classes ------- .. autoapisummary:: atomiq.heros.AtomiqHERO Functions --------- .. autoapisummary:: atomiq.heros.get_heros atomiq.heros.stringify_component Module Contents --------------- .. py:function:: get_heros() 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. .. py:data:: heros .. py:data:: LocalHERO .. py:function:: stringify_component(component) 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. .. py:class:: AtomiqHERO(experiment) Bases: :py:obj:`LocalHERO` Base class for objects exposed through HEROS. Any object that should be able to be accessed remotely must be based off this class. :param name: name/identifier under which the object is available. Make sure this name is unique in the realm. :param realm: realm the HERO should exist in. default is "heros" :param implements: list of interfaces that are implemented by the hero :param tags: list of tags to identify and classify the hero .. py:attribute:: name :type: str :value: '' .. py:attribute:: rid :type: int :value: -1 .. py:attribute:: chunksize :value: -1 .. py:attribute:: components :type: tuple[str] :value: () .. py:attribute:: blocks :type: tuple[str] :value: () .. py:attribute:: default_arguments :type: dict[dict] | None :value: None .. py:attribute:: experiment .. py:property:: step_counter .. py:property:: identifier .. py: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. .. py:method:: terminate() .. py:method:: emit_data(data)