bennomeier / leCroyParser

A Python Module to parse LeCroy Binary Trace Files
MIT License
12 stars 8 forks source link

Update numpy decoding #6

Closed JeroenvO closed 3 years ago

JeroenvO commented 3 years ago

Hi, reading binary data with numpy fromstring is deprecated: https://numpy.org/devdocs/reference/generated/numpy.fromstring.html

It should be changed to numpy.frombuffer.

JeroenvO commented 3 years ago

Maybe use the count and offset arguments instead of trimming the input data.

JeroenvO commented 3 years ago

To be precise:

__init__.py:144: DeprecationWarning: The binary mode of fromstring is deprecated, as it behaves surprisingly on unicode inputs. Use frombuffer instead
x = np.fromstring(self.file.read(length), self.endianness + formatSpecifier)[0]
JeroenvO commented 3 years ago

Fixed in #8

bennomeier commented 3 years ago

Thanks.