Skip to content

Commit

Permalink
Fix warnings with numpy enabled (#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
scasagrande committed Apr 1, 2022
1 parent e93b739 commit 278543a
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 10 deletions.
4 changes: 1 addition & 3 deletions src/instruments/tektronix/tekdpo4104.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,7 @@ def read_waveform(self, bin_format=True):
raw = self._tek.query("CURVE?")
raw = raw.split(",") # Break up comma delimited string
if numpy:
raw = numpy.array(
raw, dtype=numpy.float
) # Convert to numpy array
raw = numpy.array(raw, dtype=float) # Convert to numpy array
else:
raw = map(float, raw)
else:
Expand Down
2 changes: 1 addition & 1 deletion src/instruments/tektronix/tektds224.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def read_waveform(self, bin_format=True):
raw = self._tek.query("CURVE?")
raw = raw.split(",") # Break up comma delimited string
if numpy:
raw = numpy.array(raw, dtype=numpy.float) # Convert to ndarray
raw = numpy.array(raw, dtype=float) # Convert to ndarray
else:
raw = tuple(map(float, raw))
else:
Expand Down
4 changes: 1 addition & 3 deletions src/instruments/tektronix/tektds5xx.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,7 @@ def read_waveform(self, bin_format=True):
raw = self._parent.query("CURVE?")
raw = raw.split(",") # Break up comma delimited string
if numpy:
raw = numpy.array(
raw, dtype=numpy.float
) # Convert to numpy array
raw = numpy.array(raw, dtype=float) # Convert to numpy array
else:
raw = map(float, raw)
else:
Expand Down
2 changes: 1 addition & 1 deletion src/instruments/teledyne/maui.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def read_waveform(self, bin_format=False, single=True):
# format the string to appropriate data
retval = retval.replace('"', "").split()
if numpy:
dat_val = numpy.array(retval, dtype=numpy.float) # Convert to ndarray
dat_val = numpy.array(retval, dtype=float) # Convert to ndarray
else:
dat_val = tuple(map(float, retval))

Expand Down
2 changes: 1 addition & 1 deletion tests/test_tektronix/test_tekdpo4104.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def test_data_source_read_waveform_ascii(values, ymult, yzero, xzero, xincr):

# manually calculate the values
if numpy:
raw = numpy.array(values_str.split(","), dtype=numpy.float)
raw = numpy.array(values_str.split(","), dtype=float)
x_calc = numpy.arange(ptcnt) * xincr + xzero
y_calc = (raw - yoffs) * ymult + yzero
else:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,5 +137,5 @@ def test_iterable_eq_passes_two_numpy_array_quantities():
"""
values = [1, 2, 3]
a = numpy.array(values) * u.V
b = numpy.array(a) * u.V
b = numpy.array(values) * u.V
iterable_eq(a, b)

0 comments on commit 278543a

Please sign in to comment.