Open dshanske opened 7 months ago
This may be related to the fact my AQI sensor got so soaked in a rainstorm it shorted out, so no data is available, and the has_data issue previously raised.
The replacement parts are en route.
In python the min (and max) cannot have ’None’ in the list. The lists returned from get_series will need to be processed to remove these items.
How?
Sorry, that comment was meant for me. I did some initial triage and didn't want to lose it. Once I finish migrating to WeeWX I'll get on this.
Tell me if there is anything on this or your other project I can test.
The new air quality sensor's arrival from the manufacturer is imminent.
Latest commit removes any ‘None’ values prior to calculating NowCast AQI. Could you try it against real data?
Also, just curious, did this just start with upgrade to WeeWX V5? If so, any chance you also upgraded python?
Thanks
Sensor installed. No luck...keeps crashing with the error.
I’ll add some debug logging so we can see what the data really looks like.
Additional debug logging in latest commit. It will show the inputs to the NowCast calculations.
Also, did this just start with upgrade to WeeWX V5? If so, any chance you also upgraded python?
I'm not sure because of the gap caused by the hardware failure, but I never noticed it before the upgrade.
No recent python version changes...
Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: Evaluation of template /etc/weewx/skins/Seasons/index.html.tmpl failed with exception '<class 'weewx.CannotCalculate'>' Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: Ignoring template /etc/weewx/skins/Seasons/index.html.tmpl Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: Reason: pm2_5_aqi Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: Traceback (most recent call last): Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: File "/usr/share/weewx/weewx/cheetahgenerator.py", line 334, in generate Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: unicode_string = compiled_template.respond() Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: File "_etc_weewx_skins_Seasons_index_html_tmpl.py", line 219, in respond Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1708, in _handleCheetahInclude Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: self._CHEETAH__cheetahIncludes[_includeID].respond(trans) Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: File "_etc_weewx_skins_Seasons_current_inc.py", line 197, in respond Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: File "/usr/lib/python3/dist-packages/Cheetah/Template.py", line 1446, in getVar Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: return valueFromSearchList( Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: ^^^^^^^^^^^^^^^^^^^^ Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: File "/usr/lib/python3/dist-packages/Cheetah/NameMapper.py", line 291, in valueFromSearchList Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: return _valueForName(namespace, name, Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: File "/usr/lib/python3/dist-packages/Cheetah/NameMapper.py", line 231, in _valueForName Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: nextObj = getattr(obj, key) Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: ^^^^^^^^^^^^^^^^^ Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: File "/usr/share/weewx/weewx/tags.py", line 389, in has_data Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: val = weewx.xtypes.has_data(self.obs_type, self.timespan, db_manager) Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: File "/usr/share/weewx/weewx/xtypes.py", line 156, in has_data Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: vt = xtype.get_aggregate(obs_type, timespan, 'not_null', db_manager) Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: File "/usr/share/weewx/weewx/xtypes.py", line 942, in get_aggregate Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: value = get_scalar(obs_type, record, db_manager)[0] Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: File "/usr/share/weewx/weewx/xtypes.py", line 86, in get_scalar Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: return xtype.get_scalar(obs_type, record, db_manager, option_dict) Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: ** ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: File "/etc/weewx/bin/user/aqitype.py", line 342, in get_scalar Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: raise weewx.CannotCalculate(obs_type) Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: weewx.CannotCalculate: pm2_5_aqi Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: Evaluation of template /etc/weewx/skins/Seasons/rss.xml.tmpl failed. Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: Ignoring template /etc/weewx/skins/Seasons/rss.xml.tmpl Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: Reason: cannot find 'dateTime' Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: To debug, try inserting '#errorCatcher Echo' at top of template
Thanks
I am...and just added the types to observation stats.
Interesting, I’m seeing a blank line at
Feb 03 22:38:16 ozonepark weewxd[2499406]: ERROR weewx.cheetahgenerator: **** File "/etc/weewx/bin/user/aqitype.py", line 342, in get_scalar
At this time, since debug =1 is broken in v5 it doesn’t really matter. I’m trying to determine if it is base WeeWX or this xtype. I’ll let you know when I know more.
an 15 19:58:21 weewxd[1195199]: CRITICAL main: Traceback (most recent call last): Jan 15 19:58:21 weewxd[1195199]: CRITICAL main: File "/usr/share/weewx/weewx/xtypes.py", line 86, in get_scalar Jan 15 19:58:21 weewxd[1195199]: CRITICAL main: ** return xtype.get_scalar(obs_type, record, db_manager, option_dict) Jan 15 19:58:21 weewxd[1195199]: CRITICAL main: File "/etc/weewx/bin/user/aqitype.py", line 347, in get_scalar Jan 15 19:58:21 weewxd[1195199]: CRITICAL main: aqi = self.aqi_fields[obs_type]['calculator'].calculate(db_manager, record['dateTime'], record[dependent_field], aqi_type) Jan 15 19:58:21 weewxd[1195199]: CRITICAL main: File "/etc/weewx/bin/user/aqitype.py", line 168, in calculate Jan 15 19:58:21 weewxd[1195199]: CRITICAL main: concentration = self.calculate_concentration(db_manager, time_stamp) Jan 15 19:58:21 weewxd[1195199]: CRITICAL main: File "/etc/weewx/bin/user/aqitype.py", line 139, in calculate_concentration Jan 15 19:58:21 weewxd[1195199]: CRITICAL main: min_value = min(data[0]) Jan 15 19:58:21 weewxd[1195199]: CRITICAL main: TypeError: '<' not supported between instances of 'NoneType' and 'NoneType' Jan 15 19:58:21 weewxd[1195199]: CRITICAL main: