Skip to content

Commit

Permalink
Release v0.2.8: Fix to CRC and trigger calc and minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
CAM-Gerlach committed May 16, 2020
1 parent 24b145c commit 90c0267
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 17 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# Sindri Changelog


## Version 0.2.8 (2020-05-15)

Bugfix release with the following changes:

* Fix incorrect calculation/rounding of CRC and trigger count values
* Change net charge calculation to use actual daily Ah values
* Lengthen refresh period from 5 min to 10 min for long-fuse data
* Improve compat of date parser



## Version 0.2.7 (2020-04-29)

Compat and bugfix release with the following changes:
Expand Down
2 changes: 1 addition & 1 deletion src/sindri/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Version file."""

VERSION_INFO = (0, 2, 7)
VERSION_INFO = (0, 2, 8)
__version__ = '.'.join((str(version) for version in VERSION_INFO))
14 changes: 7 additions & 7 deletions src/sindri/config/website.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

STATUS_UPDATE_INTERVAL_SECONDS = 10
STATUS_UPDATE_INTERVAL_FAST_SECONDS = 1
STATUS_UPDATE_INTERVAL_SLOW_SECONDS = 300
STATUS_UPDATE_INTERVAL_SLOW_SECONDS = 600

THEME_FG_COLOR = "white"
THEME_BG_ACCENT_COLOR = "#333333"
Expand Down Expand Up @@ -53,7 +53,7 @@
"power_out": "Charge Power",
"vb_ref": "Target Voltage",
"power_load": "Load Power",
"charge_net_24h": "Daily Net Charge",
"ahnet_daily": "Net Ah/Day",
"t_batt": "Battery Temp",
"led_state": "LED State",
"ping": "Ping Error Code",
Expand Down Expand Up @@ -83,7 +83,7 @@
"led_state": {"dtick": 5, "range": [0, 20], "suffix": ""},
"power_out": {"dtick": 75, "range": [0, 225], "suffix": " W"},
"power_load": {"dtick": 10, "range": [0, 30], "suffix": " W"},
"charge_net_24h": {"dtick": 250, "range": [-500, 500], "suffix": " Wh"},
"ahnet_daily": {"dtick": 25, "range": [-50, 50], "suffix": " Ah"},
"crc_errors": {"dtick": 25, "range": [0, 100], "suffix": ""},
"crc_errors_delta": {"dtick": 1, "range": [0, 5], "suffix": ""},
"crc_errors_hourly": {"dtick": 5, "range": [0, 10], "suffix": ""},
Expand All @@ -109,7 +109,7 @@
"led_state": STANDARD_LAYOUTS["led_state"],
"power_out": STANDARD_LAYOUTS["power_out"],
"power_load": STANDARD_LAYOUTS["power_load"],
"charge_net_24h": STANDARD_LAYOUTS["charge_net_24h"],
"ahnet_daily": STANDARD_LAYOUTS["ahnet_daily"],
"sensor_uptime": STANDARD_LAYOUTS["uptime"],
"crc_errors": STANDARD_LAYOUTS["crc_errors"],
"crc_errors_delta": STANDARD_LAYOUTS["crc_errors_delta"],
Expand Down Expand Up @@ -153,7 +153,7 @@
"power_load": [[1, 6, 9, 10, 15.5, 18, 19, 20, 24],
STANDARD_COLORS[::-1] + ["teal"] + STANDARD_COLORS[1:]],
"power_net": [[-15, -5, 0, 15], STANDARD_COLORS[::-1]],
"charge_net_24h": [[-100, -50, 0, 100], STANDARD_COLORS[::-1]],
"ahnet_daily": [[-20, -10, 0, 10], STANDARD_COLORS[::-1]],
"sensor_restarts": [[0.5, 1.5, 4.5, 24.5], STANDARD_COLORS],
"crc_errors": [[0.98, 5, 12.5, 50], STANDARD_COLORS],
"crc_errors_delta": [[0.1, 0.9, 1.5, 2.5], STANDARD_COLORS],
Expand Down Expand Up @@ -191,7 +191,7 @@
"power_out": STANDARD_COLOR_TABLES["power_out"],
"power_load": STANDARD_COLOR_TABLES["power_load"],
"power_net": STANDARD_COLOR_TABLES["power_net"],
"charge_net_24h": STANDARD_COLOR_TABLES["charge_net_24h"],
"ahnet_daily": STANDARD_COLOR_TABLES["ahnet_daily"],
"sweep_vmp": STANDARD_COLOR_TABLES["array_voltage"],
"sweep_pmax": STANDARD_COLOR_TABLES["power_out"],
"sweep_voc": STANDARD_COLOR_TABLES["array_voltage"],
Expand Down Expand Up @@ -741,7 +741,7 @@
"charge_state": {},
"power_load": {},
"load_state": {},
"charge_net_24h": {},
"ahnet_daily": {},
"t_batt": {},
"led_state": {},
"ping": {},
Expand Down
18 changes: 9 additions & 9 deletions src/sindri/process.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,37 +26,37 @@
("power_net", "power_load",
lambda full_data:
(full_data["power_out"] - full_data["power_load"] - POWER_IDLE_W)),
("charge_net_24h", "power_net",
("ahnet_daily", "ahl_daily",
lambda full_data:
full_data["power_net"].rolling("24h", min_periods=2).sum() / 60),
(full_data["ahc_daily"] - full_data["ahl_daily"])),
("sensor_uptime", "vb_max",
lambda full_data: full_data["sequence_count"] / (60 * 60)),
("crc_errors_delta", "crc_errors",
lambda full_data: full_data["crc_errors"].diff(1).clip(lower=0)),
("crc_errors_hourly", "crc_errors_delta",
lambda full_data:
full_data["crc_errors_delta"].rolling(60, min_periods=2).sum()
/ round(full_data["time"].diff(60).dt.total_seconds() / (60 * 60))),
/ (round(full_data["time"].diff(60).dt.total_seconds()) / (60 * 60))),
("crc_errors_daily", "crc_errors_hourly",
lambda full_data:
full_data["crc_errors_delta"].rolling(60 * 24, min_periods=2).sum()
/ round(full_data["time"].diff(60 * 24).dt.total_seconds()
/ (60 * 60 * 24))),
/ (round(full_data["time"].diff(60 * 24).dt.total_seconds())
/ (60 * 60 * 24))),
("trigger_delta", "valid_packets",
(lambda full_data: round(
-1e3 * full_data["bytes_remaining"].diff(1)
/ sindri.utils.misc.TRIGGER_SIZE_MB).clip(lower=0))),
("trigger_rate_1min", "trigger_delta",
lambda full_data: full_data["trigger_delta"]
/ round(full_data["time"].diff(1).dt.total_seconds() / 60)),
/ (round(full_data["time"].diff(1).dt.total_seconds()) / 60)),
("trigger_rate_5min", "trigger_rate_1min",
lambda full_data:
full_data["trigger_delta"].rolling(5, min_periods=2).mean()
/ round(full_data["time"].diff(5).dt.total_seconds() / (60 * 5))),
/ (round(full_data["time"].diff(5).dt.total_seconds()) / (60 * 5))),
("trigger_rate_1hr", "trigger_rate_5min",
lambda full_data:
full_data["trigger_delta"].rolling(60, min_periods=6).mean()
/ round(full_data["time"].diff(60).dt.total_seconds() / (60 * 60))),
/ (round(full_data["time"].diff(60).dt.total_seconds()) / (60 * 60))),
("triggers_remaining", "bytes_remaining",
lambda full_data: round(full_data["bytes_remaining"] * 1e3
/ sindri.utils.misc.TRIGGER_SIZE_MB)),
Expand Down Expand Up @@ -102,7 +102,7 @@ def preprocess_status_data(raw_status_data, decimate=None,
status_data = raw_status_data
status_data["time"] = pd.to_datetime(
status_data["time"],
format="%Y-%m-%d %H:%M:%S.%f%z").dt.tz_localize(None)
format="%Y-%m-%d %H:%M:%S.%f").dt.tz_localize(None)
status_data.set_index("time", drop=False, inplace=True)
status_data = status_data[status_data.index.notnull()]

Expand Down

0 comments on commit 90c0267

Please sign in to comment.