Skip to content

Commit

Permalink
Replaced assert statements by throwing exceptions as requested by the…
Browse files Browse the repository at this point in the history
… Codacy quality review.
  • Loading branch information
ysalatheZI committed May 18, 2018
1 parent 93df9d4 commit 8815329
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 0 additions & 2 deletions examples/AWG8_examples/bounce_correction_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@


# Settings


fs = 2.4e9
time_start = -50e-9
time_start = np.around(time_start*fs)/fs
Expand Down
6 changes: 4 additions & 2 deletions pycqed/measurement/kernel_functions_ZI.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,8 +177,10 @@ def multipath_bounce_correction(sig, delay, amp, paths = 8, bufsize = 128):
The amplitude (amp) of the bounce is specified relative to the amplitude of the input signal.
It is constrained to be smaller than 1. The amplitude is represented as a 18-bit fixed point number on the FPGA.
"""
assert 0 <= delay < bufsize-8, "The maximulm delay is limitted to 120 (bufsize-8) samples to save hardware resources."
assert -1 <= amp < 1, "The amplitude needs to be between -1 and 1."
if not 0 <= delay < bufsize-8:
raise ValueError("The maximulm delay is limitted to 120 (bufsize-8) samples to save hardware resources.")
if not -1 <= amp < 1:
raise ValueError("The amplitude needs to be between -1 and 1.")

sigout = np.zeros(len(sig))
buffer = np.zeros(bufsize)
Expand Down

0 comments on commit 8815329

Please sign in to comment.