From 55f9cb3bea5df87516559f3778387b73e2aaf9f2 Mon Sep 17 00:00:00 2001 From: "tkeffer@gmail.com" Date: Fri, 6 Dec 2019 07:26:18 -0700 Subject: [PATCH] Reverted wview schema to use "old-style" schema. --- TODO.md | 5 ++ bin/schemas/wview.py | 118 ++++++++++++++++++++----------------------- 2 files changed, 61 insertions(+), 62 deletions(-) diff --git a/TODO.md b/TODO.md index 42d351d8..01380123 100644 --- a/TODO.md +++ b/TODO.md @@ -1,4 +1,9 @@ +### Test +Run test suite on Mac. + ### Install +Check install on Mac. + Note in the docs that doing: ```shell script python3 setup.py install diff --git a/bin/schemas/wview.py b/bin/schemas/wview.py index 7292f92a..db05f24b 100644 --- a/bin/schemas/wview.py +++ b/bin/schemas/wview.py @@ -16,65 +16,59 @@ # result in saving as much space as you may think --- most of the space is # taken up by the primary key indexes (type "dateTime"). # ============================================================================= -table = [('dateTime', 'INTEGER NOT NULL UNIQUE PRIMARY KEY'), - ('usUnits', 'INTEGER NOT NULL'), - ('interval', 'INTEGER NOT NULL'), - ('barometer', 'REAL'), - ('pressure', 'REAL'), - ('altimeter', 'REAL'), - ('inTemp', 'REAL'), - ('outTemp', 'REAL'), - ('inHumidity', 'REAL'), - ('outHumidity', 'REAL'), - ('windSpeed', 'REAL'), - ('windDir', 'REAL'), - ('windGust', 'REAL'), - ('windGustDir', 'REAL'), - ('rainRate', 'REAL'), - ('rain', 'REAL'), - ('dewpoint', 'REAL'), - ('windchill', 'REAL'), - ('heatindex', 'REAL'), - ('ET', 'REAL'), - ('radiation', 'REAL'), - ('UV', 'REAL'), - ('extraTemp1', 'REAL'), - ('extraTemp2', 'REAL'), - ('extraTemp3', 'REAL'), - ('soilTemp1', 'REAL'), - ('soilTemp2', 'REAL'), - ('soilTemp3', 'REAL'), - ('soilTemp4', 'REAL'), - ('leafTemp1', 'REAL'), - ('leafTemp2', 'REAL'), - ('extraHumid1', 'REAL'), - ('extraHumid2', 'REAL'), - ('soilMoist1', 'REAL'), - ('soilMoist2', 'REAL'), - ('soilMoist3', 'REAL'), - ('soilMoist4', 'REAL'), - ('leafWet1', 'REAL'), - ('leafWet2', 'REAL'), - ('rxCheckPercent', 'REAL'), - ('txBatteryStatus', 'REAL'), - ('consBatteryVoltage', 'REAL'), - ('hail', 'REAL'), - ('hailRate', 'REAL'), - ('heatingTemp', 'REAL'), - ('heatingVoltage', 'REAL'), - ('supplyVoltage', 'REAL'), - ('referenceVoltage', 'REAL'), - ('windBatteryStatus', 'REAL'), - ('rainBatteryStatus', 'REAL'), - ('outTempBatteryStatus', 'REAL'), - ('inTempBatteryStatus', 'REAL')] - -# Schema to be used for the daily summaries. The default is to include all the observation types in the table as -# 'scalar' types, plus one for 'wind' as a vector type. -day_summaries = [(e[0], 'SCALAR') for e in table if e[0] not in ('dateTime', 'usUnits', 'interval')]\ - + [('wind', 'VECTOR')] - -schema = { - 'table': table, - 'day_summaries' : day_summaries -} +# NB: This schema is specified using the WeeWX V3 "old-style" schema. Starting +# with V4, a new style was added, which allows schema for the daily summaries +# to be expressed explicitly. +# ============================================================================= +schema = [('dateTime', 'INTEGER NOT NULL UNIQUE PRIMARY KEY'), + ('usUnits', 'INTEGER NOT NULL'), + ('interval', 'INTEGER NOT NULL'), + ('barometer', 'REAL'), + ('pressure', 'REAL'), + ('altimeter', 'REAL'), + ('inTemp', 'REAL'), + ('outTemp', 'REAL'), + ('inHumidity', 'REAL'), + ('outHumidity', 'REAL'), + ('windSpeed', 'REAL'), + ('windDir', 'REAL'), + ('windGust', 'REAL'), + ('windGustDir', 'REAL'), + ('rainRate', 'REAL'), + ('rain', 'REAL'), + ('dewpoint', 'REAL'), + ('windchill', 'REAL'), + ('heatindex', 'REAL'), + ('ET', 'REAL'), + ('radiation', 'REAL'), + ('UV', 'REAL'), + ('extraTemp1', 'REAL'), + ('extraTemp2', 'REAL'), + ('extraTemp3', 'REAL'), + ('soilTemp1', 'REAL'), + ('soilTemp2', 'REAL'), + ('soilTemp3', 'REAL'), + ('soilTemp4', 'REAL'), + ('leafTemp1', 'REAL'), + ('leafTemp2', 'REAL'), + ('extraHumid1', 'REAL'), + ('extraHumid2', 'REAL'), + ('soilMoist1', 'REAL'), + ('soilMoist2', 'REAL'), + ('soilMoist3', 'REAL'), + ('soilMoist4', 'REAL'), + ('leafWet1', 'REAL'), + ('leafWet2', 'REAL'), + ('rxCheckPercent', 'REAL'), + ('txBatteryStatus', 'REAL'), + ('consBatteryVoltage', 'REAL'), + ('hail', 'REAL'), + ('hailRate', 'REAL'), + ('heatingTemp', 'REAL'), + ('heatingVoltage', 'REAL'), + ('supplyVoltage', 'REAL'), + ('referenceVoltage', 'REAL'), + ('windBatteryStatus', 'REAL'), + ('rainBatteryStatus', 'REAL'), + ('outTempBatteryStatus', 'REAL'), + ('inTempBatteryStatus', 'REAL')]