twVolc / PyCamPermanent

Permanent PiCam (SO2) installation project software
GNU General Public License v3.0
1 stars 2 forks source link

Unreachable else conditions in `corr_light_dilution` #79

Closed ubdbra001 closed 8 months ago

ubdbra001 commented 8 months ago

https://github.com/twVolc/PyCamPermanent/blob/d2c5b7ebbe755fc8c63127714d30148ad0502e99/pycam/so2_camera_processor.py#L1448-L1454

Just been mucking about with a static code analyser (looking for dead code) and it highlighted that the else conditions for the above statement are unreachable. This is because in the if statement the 'ON' gets interpreted as True and so the first part of it will always execute (even if band is set to a different value.

Likely not the biggest issue but I thought I'd document it.

twVolc commented 8 months ago

Nice spot! This would definitely be important if trying to correctly apply the correction. I guess it should be: if band.upper() in ['A' , 'ON']: and the same for the off-band?

ubdbra001 commented 8 months ago

Yep, that'd fix it. I'll fix it an put in a pull request now.