Emit warning when current/voltage limits are near zero #76
Loading…
Reference in New Issue
No description provided.
Delete Branch "esavkin/thermostat:72-warning-on-zeroed-limits"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #72
@ -11,0 +17,4 @@
pwm_report = self.get_pwm()
for pwm_channel in pwm_report:
for limit in LIMITS:
if isclose(pwm_channel[limit]["value"], 0.0, rel_tol=1e-6):
rel_tol
is not the correct one to use here. Please read the Python manual carefully or just write the formula explicitly, I don't think there's much of a point tomath.isclose
.Did you even test this?
6c601f8423
to1735e6c030
@ -11,0 +17,4 @@
pwm_report = self.get_pwm()
for pwm_channel in pwm_report:
for limit in LIMITS:
if isclose(pwm_channel[limit]["value"], 0.0, abs_tol=1e-6):
Isn't just
== 0.0
sufficient for the purpose explained in the Issue?Looks like it's quite safe to do so
1735e6c030
tof9f526d7fe
@ -11,0 +17,4 @@
for pwm_channel in pwm_report:
for limit in LIMITS:
if pwm_channel[limit]["value"] == 0.0:
logging.warning("`{}` limit is set to zero at channel {}".format(limit, pwm_channel["channel"]))
on channel
f9f526d7fe
to7b35932d36
7b35932d36
toe3e3237d2f