Skip to content

Commit

Permalink
SHFScope timeout error message to show specified timeout value (#169)
Browse files Browse the repository at this point in the history
* SHFScope to show specified timeout value when TimeoutError is raised
  • Loading branch information
markheik authored Aug 19, 2022
1 parent 604034f commit 46b4506
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
devices connected to the data server. (`#134`)
* Bugfix: Nodes with nameless options don't raise an exception when their enum attribute is called (`#165`).
* Bugfix: Values of enumerated nodes can now be pickled (`#129`).
* Bugfix: `SHFScope` `run()` and `stop()` shows specified timeout value when `TimeoutError` is raised.

## Version 0.3.5
* Adapt AWG Waveform upload (`write_to_waveform_memory`) to append to existing transactions.
Expand Down
6 changes: 4 additions & 2 deletions src/zhinst/toolkit/driver/nodes/shfqa_scope.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ def run(
self.enable.wait_for_state_change(1, timeout=timeout, sleep_time=sleep_time)
except TimeoutError as error:
raise TimeoutError(
"Scope could not been started within the specified timeout({timeout})s."
"Scope could not been started within "
f"the specified timeout ({timeout})s"
) from error

def stop(self, *, timeout: float = 10, sleep_time: float = 0.005) -> None:
Expand All @@ -76,7 +77,8 @@ def stop(self, *, timeout: float = 10, sleep_time: float = 0.005) -> None:
self.enable.wait_for_state_change(0, timeout=timeout, sleep_time=sleep_time)
except TimeoutError as error:
raise TimeoutError(
"Scope could not been stopped within the specified timeout({timeout})s."
"Scope could not been stopped within "
f"the specified timeout ({timeout})s"
) from error

def wait_done(self, *, timeout: float = 10, sleep_time: float = 0.005) -> None:
Expand Down

0 comments on commit 46b4506

Please sign in to comment.