Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "quantaq-cli"
version = "1.0.0rc3"
version = "1.0.0rc4"
description = "The QuantAQ Python Toolkit and CLI"
authors = ["David H Hagan <david.hagan@quant-aq.com>"]
license = "Apache-2.0"
Expand Down
5 changes: 5 additions & 0 deletions quantaq_cli/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@
"opcn3_pm1": "opc_pm1",
"opcn3_pm25": "opc_pm25",
"opcn3_pm10": "opc_pm10",
"opcn3_temp": "opc_temp",
"opcn3_rh": "opc_rh",
"sample_period": "opc_sample_period",
"sample_flow": "opc_sample_flow",
"laser_status": "opc_laser_status",
Expand All @@ -151,6 +153,9 @@
# --- RHT columns ---
"temp": "sample_temp",
"rh": "sample_rh",

# --- Device / metadata columns ---
"operating_state": "dd_operating_state"
}

# Prefixes for unstandardized column names
Expand Down
7 changes: 4 additions & 3 deletions quantaq_cli/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ def infer_data_source(df, tscol=None):

dominant_tdiff = tdiff_counts.idxmax()

mostly_1min = dominant_tdiff == 60.0
mostly_5sec = dominant_tdiff == 5.0
mostly_10sec = dominant_tdiff == 10.0
tolerance = 2.0
mostly_1min = abs(dominant_tdiff - 60.0) <= tolerance
mostly_5sec = abs(dominant_tdiff - 5.0) <= tolerance
mostly_10sec = abs(dominant_tdiff - 10.0) <= tolerance

if mostly_1min:
logger.info(f"Reading mostly {dominant_tdiff}s data --> inferring database")
Expand Down
Loading