pywws.livelog:math domain error

51 views
Skip to first unread message

JAMES COOPER

unread,
May 23, 2022, 5:29:01 PM5/23/22
to pywws
Hi all.  Something happened just after 9am today which caused a recurring error which is preventing uploads to Twitter, etc.  Recurring log posted below.  Clearly there's an erroneous value somewhere, but I can't find it.  Raw data looks fine from when the error started.

2022-05-23 12:59:45:pywws.logger:pywws version 21.4.0, build 1690 (dbede59)
2022-05-23 13:00:20:pywws.weatherstation:status {'rain_overflow': False, 'lost_connection': False}
2022-05-23 13:00:37:pywws.livelog:math domain error
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/pywws/livelog.py", line 89, in live_log
    tasks.do_tasks()
  File "/usr/local/lib/python2.7/dist-packages/pywws/regulartasks.py", line 213, in do_tasks
    self._do_common(now, sections)
  File "/usr/local/lib/python2.7/dist-packages/pywws/regulartasks.py", line 147, in _do_common
    self.services[name].upload(live_data=live_data, options=options)
  File "/usr/local/lib/python2.7/dist-packages/pywws/service/__init__.py", line 340, in upload
    if self.queue_data(timestamp, data):
  File "/usr/local/lib/python2.7/dist-packages/pywws/service/__init__.py", line 307, in queue_data
    OK = super(CatchupDataService, self).queue_data(timestamp, data)
  File "/usr/local/lib/python2.7/dist-packages/pywws/service/__init__.py", line 281, in queue_data
    prepared_data = self.prepare_data(data)
  File "/usr/local/lib/python2.7/dist-packages/pywws/service/__init__.py", line 290, in prepare_data
    data_str = self.templater.make_text(self.template_file, data)
  File "/usr/local/lib/python2.7/dist-packages/pywws/template.py", line 580, in make_text
    for text in self.process(live_data, template_file):
  File "/usr/local/lib/python2.7/dist-packages/pywws/template.py", line 462, in process
    x = eval(command[1])
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/pywws/conversions.py", line 199, in dew_point
    gamma = ((a * temp) / (b + temp)) + math.log(float(hum) / 100.0)
ValueError: math domain error

I think what happend just after 9am may be relevant, and I'd post the log, but it's overwritten itself now.  All I have is a screen grab I took from VNC whilst I was at work, which is attached.WhatsApp Image 2022-05-23 at 4.16.05 PM.jpeg.  You'll note the "unexpected ptr change", then it changes back to the original hex, then gives "list index out of range".  

Can anyone help point me towards the issue here?  Raw data is still recording, but the recurring math domain error seems to be stopping things.

James

Jim Easterbrook

unread,
May 24, 2022, 3:11:38 AM5/24/22
to py...@googlegroups.com
> took from VNC whilst I was at work, which is attached.WhatsApp Image
> 2022-05-23 at 4.16.05 PM.jpeg.  You'll note the "unexpected ptr change",
> then it changes back to the original hex, then gives "list index out of
> range".

You do have some corrupt data, you just need to find it. The problem
happens when processing one of your text templates that includes dew
point, so it could be anywhere in the time range covered by your
templates. Note that zero is not a valid humidity value.

--
Jim Easterbrook <http://www.jim-easterbrook.me.uk/>

JAMES COOPER

unread,
May 24, 2022, 7:50:30 AM5/24/22
to pywws
Thanks, Jim. 

You were right.  I eventually found the below nugget of nonsense in the calibrated data and artificially changed it (and raw data) to realistic values.
Are the weather data in GMT time format, and the log records in BST (when appropriate)?  
WhatsApp Image 2022-05-24 at 11.21.53 AM.jpeg

Jim Easterbrook

unread,
May 24, 2022, 8:03:58 AM5/24/22
to py...@googlegroups.com
On 24/05/2022 12:50, 'JAMES COOPER' via pywws wrote:
>
> You were right.  I eventually found the below nugget of nonsense in the
> calibrated data and artificially changed it (and raw data) to realistic
> values.

It's safe to delete the nonsense line rather than invent values.

> Are the weather data in GMT time format, and the log records in BST
> (when appropriate)?

Yes.
Reply all
Reply to author
Forward
0 new messages