Skip to content

Commit

Permalink
Improve ensure_machine access level handling.
Browse files Browse the repository at this point in the history
  • Loading branch information
cgevans committed Mar 9, 2022
1 parent 2968995 commit dc9c35d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/qslib/experiment.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,9 @@ def _ensure_machine(
) -> Machine:
if isinstance(machine, Machine):
self.machine = machine
self.machine.max_access_level = max(
self.machine.max_access_level, needed_level
)
return machine
elif isinstance(machine, str):
self.machine = Machine(
Expand All @@ -478,6 +481,7 @@ def _ensure_machine(
)
return self.machine
elif hasattr(self, "machine") and (c := self.machine):
c.max_access_level = max(c.max_access_level, needed_level)
return c
else:
raise ValueError(
Expand Down

0 comments on commit dc9c35d

Please sign in to comment.