From 8b607101b63313a14846aab8dce979d02599ab4f Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 17 Oct 2023 17:10:35 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- socs/agents/vantagepro2/drivers.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/socs/agents/vantagepro2/drivers.py b/socs/agents/vantagepro2/drivers.py index a06262070..ce75ac959 100644 --- a/socs/agents/vantagepro2/drivers.py +++ b/socs/agents/vantagepro2/drivers.py @@ -1,8 +1,8 @@ import array as arr import struct import time -import numpy as np +import numpy as np from serial import Serial # some commands require a CRC code (cyclic redundancy check) - @@ -52,11 +52,13 @@ def calc_crc(data): crc = crc % 65536 return crc + def F_to_C(temp): """Function to convert fahrenheit measurement to celsius""" return (temp - 32) * (5 / 9) + def wind_chill(temp, wind): """Function to calculate wind chill temperature. Only valid if temp < 50F. Taken from https://www.calculator.net/wind-chill-calculator.html @@ -66,9 +68,10 @@ def wind_chill(temp, wind): wind: Speed in miles per hour """ - chill = 35.75 + 0.6215*temp - 35.75*np.power(wind,0.16) + 0.4275*temp*np.power(wind,0.16) + chill = 35.75 + 0.6215 * temp - 35.75 * np.power(wind, 0.16) + 0.4275 * temp * np.power(wind, 0.16) return chill + class VantagePro2: """Allows communication to Vantage Pro 2 Weather Monitor Module. Contains commands to be issued and member variables that store