Skip to content
Open
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
4 changes: 3 additions & 1 deletion src/seabreeze/spectrometers.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ def __init__(self, device: SeaBreezeDevice) -> None:
a SeaBreezeDevice as returned from `list_devices`
"""
if not isinstance(device, self._backend.SeaBreezeDevice):
raise TypeError("device has to be a `SeaBreezeDevice`")
raise TypeError(
f"`device` has to be a `SeaBreezeDevice` instance, got {device!r}"
)
self._dev = device
self.open() # always open the device here to allow caching values

Expand Down