mirror of
https://github.com/FAUSheppy/ths-datenlogger
synced 2025-12-06 12:11:35 +01:00
allow missing values (-) in external data
This commit is contained in:
@@ -143,8 +143,13 @@ def processExternalData(datapoints, plotNameKey, fromTime, toTime, dtype):
|
|||||||
try:
|
try:
|
||||||
timeStr, value = l.split(";")
|
timeStr, value = l.split(";")
|
||||||
timestamp = timeutils.time_from_csv(timeStr, CFG("nff_input_timeformat"))
|
timestamp = timeutils.time_from_csv(timeStr, CFG("nff_input_timeformat"))
|
||||||
|
cleanFloat = value.replace(",",".")
|
||||||
|
|
||||||
datapoints[plotNameKey].data += [float(value.replace(",","."))]
|
# - means the value is missing in the external data set, this is common #
|
||||||
|
if cleanFloat.strip() == "-" or cleanFloat.strip() == "+":
|
||||||
|
continue
|
||||||
|
|
||||||
|
datapoints[plotNameKey].data += [float(cleanFloat)]
|
||||||
datapoints[plotNameKey].times += [timestamp]
|
datapoints[plotNameKey].times += [timestamp]
|
||||||
except ValueError as e:
|
except ValueError as e:
|
||||||
print(l)
|
print(l)
|
||||||
|
|||||||
Reference in New Issue
Block a user