Closed teozec closed 1 year ago
Hi @teozec, thanks for the PR! Regarding DET*_OFFS
, I verified that they are DAQ
commands.
Regarding set_offsets
, I would not bother providing the exact type for the parameter: just specify it as Union[int, List]
, as numpy.array
can be converted from and to List
(but the conversion never happens, those type hints are just hints). We use type hints mostly for documentation, and this should be enough.
Perfect, thanks! So I think the code is OK as it it, since set_offsets
expects a List
and set_offset
expects a int
. Let me know if I should make any changes!
This PR adds two methods to the
StripConnection
class (in file striptease/stripconn.py):set_offset
andset_offsets
: they send a SLO command to set the offsets of one detector or of all detectors on a polarimeter.Before merging, two things need to be checked:
DET{detector}_OFFS
command aBIAS
or aDAQ
kind command?set_offsets
also accept numpy arrays? This is already possible thanks to the cast in the call toslo_command
, but the type hint needs to be changed (meaning that numpy.ndarray has to be imported or a general "Indexable" type needs to be used - I do not know if such a type exist).Please let me know if I should change or add something (perhaps a test?). Thanks!