Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MNT: Silence a bunch of warnings about np.fromstring() #249

Merged
merged 1 commit into from
Sep 24, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions siphon/cdmr/ncstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ def unpack_variable(var):
data = var.data
else:
# Always sent big endian
data = np.fromstring(var.data, dtype=dt.newbyteorder('>'))
data = np.frombuffer(var.data, dtype=dt.newbyteorder('>'))
else:
data = None

Expand All @@ -381,10 +381,10 @@ def unpack_attribute(att):
elif att.dataType == stream.STRING: # Then look for new datatype string
val = att.sdata
elif att.dataType: # Then a non-zero new data type
val = np.fromstring(att.data,
val = np.frombuffer(att.data,
dtype='>' + _dtypeLookup[att.dataType], count=att.len)
elif att.type: # Then non-zero old-data type0
val = np.fromstring(att.data,
val = np.frombuffer(att.data,
dtype=_attrConverters[att.type], count=att.len)
elif att.sdata: # This leaves both 0, try old string
val = att.sdata
Expand Down