QuTech-Delft / QMI

Quantum Measurement Infrastructure
Other
14 stars 4 forks source link

ContextManager for CONEX-CC configuration state #79

Closed rbudhrani closed 3 months ago

rbudhrani commented 4 months ago

Description =========== To view and edit configuration parameters, the CONEX-CC driver needs to enter and exit its configuration state. This can be done with a context manager, e.g.:

from contextlib import contextmanager
...
    @contextmanager
    def configuration_state(self):
        try:
            yield self._enter_configuration_state()
        finally:
            self._exit_configuration_state()

and this can be the called by the other methods in the same class with

    with self.configuration_state():
        ....

Affected components


QMI

Modules to be created


n/a

Modules to be modified


Tests to be created/updated


Documentation to be updated


n/a

Hardware