Skip to content

Commit

Permalink
fix mypy errors and avoid copy
Browse files Browse the repository at this point in the history
  • Loading branch information
ap-- committed Sep 5, 2024
1 parent 5c660f5 commit c393d58
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/seabreeze/pyseabreeze/features/spectrometer.py
Original file line number Diff line number Diff line change
Expand Up @@ -745,12 +745,12 @@ class SeaBreezeSpectrometerFeatureHR4(SeaBreezeSpectrometerFeatureOBP2):


class SeaBreezeSpectrometerFeatureFX(SeaBreezeSpectrometerFeatureOBP):
def _get_spectrum_raw(self):
def _get_spectrum_raw(self) -> NDArray[np.uint8]:
timeout = int(
self._integration_time_max * 1e-3
+ self.protocol.transport.default_timeout_ms
)
# the message type is different than the default defined in the protocol,
# requires addition of a new message type in protocol to work
datastring = self.protocol.query(0x00101000, timeout_ms=timeout)
return numpy.fromstring(datastring, dtype=numpy.uint8)
return numpy.frombuffer(datastring, dtype=numpy.uint8)

0 comments on commit c393d58

Please sign in to comment.