The methods that bring data in, for the callers: extraction/pumping.py (tracked stations, pump.sh, its state), weather/meteoswiss.py (from aimsight-app, with hourly())
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
088484c376
commit
b1790fc422
6 files changed
+302
-5
No files matched your search
+3
-2
@@ -42,8 +42,9 @@ import pandas as pd
|
||||
from sqlalchemy import create_engine, text
|
||||
from sqlalchemy.engine import URL
|
||||
|
||||
import pumping # the tracked stations (stations.txt), next to this script
|
||||
|
||||
UTC = timezone.utc
|
||||
STATIONS = Path(__file__).resolve().parent / "stations.txt" # the tracked stations, one per line: "SERIAL [position]"
|
||||
NEW_STATION_DAYS = 30 # without --from, a station with no pumped displacements: the last 30 days
|
||||
DB_NAMES = ["AIMSIGHT_DATABASE_USER", "AIMSIGHT_DATABASE_PSWD", "AIMSIGHT_DATABASE_TURL", "AIMSIGHT_DATABASE_NAME"]
|
||||
TYPES = {"images": "OPTICAL_SHIFT-IRON", "images_diff": "OPTICAL_SHIFT-DIFF"} # folder -> measurement type
|
||||
@@ -361,7 +362,7 @@ def main():
|
||||
tomorrow = datetime.now(UTC).date() + timedelta(days=1)
|
||||
start = datetime.strptime(a.start, "%Y-%m-%d").date() if a.start else None
|
||||
end = min(datetime.strptime(a.end, "%Y-%m-%d").date(), tomorrow) if a.end else tomorrow # no day to come
|
||||
stations = a.stations or list(dict.fromkeys(l.split()[0] for l in STATIONS.read_text().splitlines() if l.strip()))
|
||||
stations = a.stations or list(pumping.tracked())
|
||||
|
||||
missing = [n for n in DB_NAMES if not os.environ.get(n)]
|
||||
if missing:
|
||||
|
||||
Reference in new issue
Block a user