lspestrip / striptease

Strip TEst Analysis for System Evaluation
MIT License
4 stars 3 forks source link

Add methods to set detector offsets to StripConnection #86

Closed teozec closed 1 year ago

teozec commented 1 year ago

This PR adds two methods to the StripConnection class (in file striptease/stripconn.py): set_offset and set_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:

Please let me know if I should change or add something (perhaps a test?). Thanks!

ziotom78 commented 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.

teozec commented 1 year ago

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!