Skip to content

Commit

Permalink
Added deprecation to measurement.reset(), improved some docstrings.
Browse files Browse the repository at this point in the history
  • Loading branch information
THuckemann committed Jan 18, 2024
1 parent faa8d89 commit ea4b5bb
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/qumada/measurement/measurement.py
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,10 @@ def initialize(self, dyn_ramp_to_val=False, inactive_dyn_channels: list | None =
Relevant kwargs:
dyn_ramp_to_val: Bool [False]: If true, dynamic parameters are
ramped to their value, before their sweep, else they are ramped
to their first setpoint
inactive_dyn_channels: List of dynamic channels that are to be
to their first setpoint.
inactive_dyn_channels: List|None [None]: List of dynamic channels that are to be
treated as static for this initialization. They are always
ramped to their value instead of their sweeps starting point.)
ramped to their value instead of their sweeps starting point.
"""
# TODO: Is there a more elegant way?
# TODO: Put Sweep-Generation somewhere else?
Expand Down Expand Up @@ -517,7 +517,12 @@ def run(self) -> list:
def reset(self) -> None:
"""
Resets all static/dynamic parameters to their value/start value.
TODO: Remove! Since initialize() does only create lists one, there is no advantage of using reset().
"""
logger.warning(
"The reset() method is deprecated and will be removed in a future release! \
It is recommended to replace all calls of reset() with initialize()"
)

Check warning on line 525 in src/qumada/measurement/measurement.py

View check run for this annotation

Codecov / codecov/patch

src/qumada/measurement/measurement.py#L525

Added line #L525 was not covered by tests
ramp_rate = self.settings.get("ramp_rate", 0.3)
setpoint_intervall = self.settings.get("setpoint_intervall", 0.1)
for gate, parameters in self.gate_parameters.items():
Expand Down Expand Up @@ -555,7 +560,9 @@ def reset(self) -> None:

def clean_up(self, additional_actions: list[Callable] | None = None, **kwargs) -> None:
"""
Things to do after the measurement is complete.
Things to do after the measurement is complete. Cleans up subscribed paramteres for
buffered measurements by default.
TODO: Hook into measurement.run()
Args:
additional_actions (list[Callable], optional):
Expand Down

0 comments on commit ea4b5bb

Please sign in to comment.