I've done that, and at the same time more errors have popped up!

On Tuesday, 24 December 2024 at 14:04:16 UTC Tom Keffer wrote:

> I've included a version of xtypes.py that will tell us the value of 
> "direction" when an exception occurs. Could you substitute it for your copy?
>
>
>
> On Tue, Dec 24, 2024 at 12:31 AM Auchtermuchty Weather <[email protected]> 
> wrote:
>
>> OK ran some SQL and captured the output:
>>
>> WindDir.csv:|null|9
>> WindDir.csv:|text|428413
>> WindGust.csv:|text|2021
>> WindGustDir.csv:|null|6
>> WindGustDir.csv:|text|371698
>>
>> However when I looked at the timestamps for the few rows with NULL,  they 
>> were all in December this year, and from well after the problem started.
>>
>> I've had a look at the data - no over or under values in my view:
>>
>> sqlite> select min(windGustDir), max(windGustDir) from archive  where 
>> windGustDir <> "" ;      
>> 0.0|359.0
>> sqlite> select min(windDir), max(windDir) from archive  where windDir <> 
>> "" ;
>> 0.0|360.0
>>
>> So nothing strange there either.
>>
>> On Tuesday, 24 December 2024 at 07:53:58 UTC Auchtermuchty Weather wrote:
>>
>>> SQLite. I was wondering that, but as "0" <> 0, selecting windGust, 
>>> count(*) should bring back separate rows for each.
>>>
>>> On Monday, 23 December 2024 at 22:49:54 UTC Tom Keffer wrote:
>>>
>>>> I would guess that one of the fields in your database that you think 
>>>> holds a number, actually holds a string. It could be a string for value 
>>>> zero ('0'), instead of the actual value zero (0).
>>>>
>>>> The error occurred on a line that is doing queries in the main archive 
>>>> table (not the daily summaries) using columns 'windDir' or 'windGustDir'. 
>>>>
>>>> One more thing: what kind of database? Sqlite?
>>>>
>>>>
>>>>
>>>> On Mon, Dec 23, 2024 at 10:55 AM Auchtermuchty Weather <
>>>> [email protected]> wrote:
>>>>
>>>>> Sorry truncated the error report. I used cut to remove the stuff at 
>>>>> the start of each line and put the output into a file, then used 'set 
>>>>> number' in my text editor to make sure I pasted all the lines.,
>>>>>
>>>>>       1 Caught unrecoverable exception in generator 
>>>>> 'weewx.imagegenerator.ImageGenerator'
>>>>>       2         ****  unsupported operand type(s) for -: 'float' and 
>>>>> 'str'
>>>>>       3         ****  Traceback (most recent call last):
>>>>>       4         ****    File "/usr/share/weewx/weewx/xtypes.py", line 
>>>>> 109, in get_series
>>>>>       5         ****      return xtype.get_series(obs_type, timespan, 
>>>>> db_manager, aggregate_type,
>>>>>       6         ****             
>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>       7         ****    File "/usr/share/weewx/weewx/xtypes.py", line 
>>>>> 1040, in get_series
>>>>>       8         ****      return ArchiveTable.get_series(obs_type, 
>>>>> timespan, db_manager, aggregate_type,
>>>>>       9         ****             
>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>      10         ****    File "/usr/share/weewx/weewx/xtypes.py", line 
>>>>> 210, in get_series
>>>>>      11         ****      agg_vt = get_aggregate(obs_type, stamp, 
>>>>> do_aggregate, db_manager,
>>>>>      12         ****               
>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>      13         ****    File "/usr/share/weewx/weewx/xtypes.py", line 
>>>>> 136, in get_aggregate
>>>>>      14         ****      return xtype.get_aggregate(obs_type, 
>>>>> timespan, aggregate_type, db_manager,
>>>>>      15         ****             
>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>      16         ****    File "/usr/share/weewx/weewx/xtypes.py", line 
>>>>> 1168, in get_aggregate
>>>>>      17         ****      xsum += mag * math.cos(math.radians(90.0 - 
>>>>> direction))
>>>>>      18         ****                                         
>>>>>  ~~~~~^~~~~~~~~~~
>>>>>      19         ****  TypeError: unsupported operand type(s) for -: 
>>>>> 'float' and 'str'
>>>>>      20         ****
>>>>>      21         ****  During handling of the above exception, another 
>>>>> exception occurred:
>>>>>      22         ****
>>>>>      23         ****  Traceback (most recent call last):
>>>>>      24         ****    File "/usr/share/weewx/weewx/reportengine.py", 
>>>>> line 248, in run
>>>>>      25         ****      obj.start()
>>>>>      26         ****    File "/usr/share/weewx/weewx/reportengine.py", 
>>>>> line 465, in start
>>>>>      27         ****      self.run()
>>>>>      28         ****    File 
>>>>> "/usr/share/weewx/weewx/imagegenerator.py", line 37, in run
>>>>>      29         ****      self.gen_images(self.gen_ts)
>>>>>      30         ****    File 
>>>>> "/usr/share/weewx/weewx/imagegenerator.py", line 100, in gen_images
>>>>>      31         ****      plot = self.gen_plot(plotgen_ts,
>>>>>      32         ****             ^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>      33         ****    File 
>>>>> "/usr/share/weewx/weewx/imagegenerator.py", line 236, in gen_plot
>>>>>      34         ****      start_vec_t, stop_vec_t, data_vec_t = 
>>>>> weewx.xtypes.get_series(
>>>>>      35         ****                                           
>>>>>  ^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>      36         ****    File "/usr/share/weewx/weewx/xtypes.py", line 
>>>>> 114, in get_series
>>>>>      37         ****      return xtype.get_series(obs_type, timespan, 
>>>>> db_manager, aggregate_type,
>>>>>      38         ****             
>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>      39         ****    File "/usr/share/weewx/weewx/xtypes.py", line 
>>>>> 1040, in get_series
>>>>>      40         ****      return ArchiveTable.get_series(obs_type, 
>>>>> timespan, db_manager, aggregate_type,
>>>>>      41         ****             
>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>      42         ****    File "/usr/share/weewx/weewx/xtypes.py", line 
>>>>> 210, in get_series
>>>>>      43         ****      agg_vt = get_aggregate(obs_type, stamp, 
>>>>> do_aggregate, db_manager,
>>>>>      44         ****               
>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>      45         ****    File "/usr/share/weewx/weewx/xtypes.py", line 
>>>>> 136, in get_aggregate
>>>>>      46         ****      return xtype.get_aggregate(obs_type, 
>>>>> timespan, aggregate_type, db_manager,
>>>>>      47         ****             
>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>      48         ****    File "/usr/share/weewx/weewx/xtypes.py", line 
>>>>> 1168, in get_aggregate
>>>>>      49         ****      xsum += mag * math.cos(math.radians(90.0 - 
>>>>> direction))
>>>>>      50         ****                                         
>>>>>  ~~~~~^~~~~~~~~~~
>>>>>      51         ****  TypeError: unsupported operand type(s) for -: 
>>>>> 'float' and 'str'
>>>>>      52         ****  Generator terminated
>>>>>      53 rand type(s) for -: 'float' and 'str'
>>>>>      54 rand type(s) for -: 'float' and 'str'
>>>>>
>>>>> On Monday, 23 December 2024 at 18:53:18 UTC Auchtermuchty Weather 
>>>>> wrote:
>>>>>
>>>>>> I was getting errors. Process of elimination showed it was the 
>>>>>> monthwindvec image causing them, though not the day, week or year 
>>>>>> versions 
>>>>>> of that images.
>>>>>>
>>>>>> I suspect data is at the bottom of this, but what data? Nothing odd 
>>>>>> in archive.windGust or windGustDir.
>>>>>>
>>>>>> This is the latest WeeWx running on a Debian 12 virtual machine, and 
>>>>>> the database has the extended schema.
>>>>>>
>>>>>> Turning on debugging didn't bring any extra information.
>>>>>>
>>>>>> Caught unrecoverable exception in generator 
>>>>>> 'weewx.imagegenerator.ImageGenerator'
>>>>>>         ****  unsupported operand type(s) for -: 'float' and 'str'
>>>>>>         ****  Traceback (most recent call last):
>>>>>>         ****    File "/usr/share/weewx/weewx/xtypes.py", line 109, in 
>>>>>> get_series
>>>>>>         ****      return xtype.get_series(obs_type, timespan, 
>>>>>> db_manager, aggregate_type,
>>>>>>         ****             
>>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>>         ****    File "/usr/share/weewx/weewx/xtypes.py", line 1040, 
>>>>>> in get_series
>>>>>>         ****      return ArchiveTable.get_series(obs_type, timespan, 
>>>>>> db_manager, aggregate_type,
>>>>>>         ****             
>>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>>         ****    File "/usr/share/weewx/weewx/xtypes.py", line 210, in 
>>>>>> get_series
>>>>>>         ****      agg_vt = get_aggregate(obs_type, stamp, 
>>>>>> do_aggregate, db_manager,
>>>>>>         ****               
>>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>>         ****    File "/usr/share/weewx/weewx/xtypes.py", line 136, in 
>>>>>> get_aggregate
>>>>>>         ****      return xtype.get_aggregate(obs_type, timespan, 
>>>>>> aggregate_type, db_manager,
>>>>>>         ****             
>>>>>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
>>>>>>         ****    File "/usr/share/weewx/weewx/xtypes.py", line 1168, 
>>>>>> in get_aggregate
>>>>>>         ****      xsum += mag * math.cos(math.radians(90.0 - 
>>>>>> direction))
>>>>>>         ****                                          ~~~~~^~~~~~~~~~~
>>>>>>         ****  TypeError: unsupported operand type(s) for -: 'float' 
>>>>>> and 'str'
>>>>>>         ****
>>>>>>         ****  During handling of the above exception, another 
>>>>>> exception occurred:
>>>>>>         ****
>>>>>>         ****  Traceback (most recent call last):
>>>>>>         ****    File "/usr/share/weewx/weewx/reportengine.py", line 
>>>>>> 248, in run
>>>>>>         ****      obj.start()
>>>>>>         ****    File "/usr/share/weewx/weewx/reportengine.py", line 
>>>>>> 465, in start
>>>>>>
>>>>> -- 
>>>>> You received this message because you are subscribed to the Google 
>>>>> Groups "weewx-user" group.
>>>>> To unsubscribe from this group and stop receiving emails from it, send 
>>>>> an email to [email protected].
>>>>> To view this discussion visit 
>>>>> https://groups.google.com/d/msgid/weewx-user/e8d2f679-c9e7-46a2-9588-652cf0852a90n%40googlegroups.com
>>>>>  
>>>>> <https://groups.google.com/d/msgid/weewx-user/e8d2f679-c9e7-46a2-9588-652cf0852a90n%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "weewx-user" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>>
> To view this discussion visit 
>> https://groups.google.com/d/msgid/weewx-user/456aeb45-2d77-4136-bea2-22b0ecfb2004n%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/weewx-user/456aeb45-2d77-4136-bea2-22b0ecfb2004n%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/weewx-user/863b352f-18cd-47c5-9e7b-000a8f8c1755n%40googlegroups.com.
 Caught unrecoverable exception in generator 
'weewx.imagegenerator.ImageGenerator'
         ****  '<' not supported between instances of 'float' and 'str'
         ****  Traceback (most recent call last):
         ****    File "/usr/share/weewx/weewx/reportengine.py", line 248, in run
         ****      obj.start()
         ****    File "/usr/share/weewx/weewx/reportengine.py", line 465, in 
start
         ****      self.run()
         ****    File "/usr/share/weewx/weewx/imagegenerator.py", line 37, in 
run
         ****      self.gen_images(self.gen_ts)
         ****    File "/usr/share/weewx/weewx/imagegenerator.py", line 107, in 
gen_images
         ****      image = plot.render()
         ****              ^^^^^^^^^^^^^
         ****    File "/usr/share/weewx/weeplot/genplot.py", line 212, in render
         ****      self._calcYScaling()
         ****    File "/usr/share/weewx/weeplot/genplot.py", line 557, in 
_calcYScaling
         ****      yline_min = min_with_none(line.y)
         ****                  ^^^^^^^^^^^^^^^^^^^^^
         ****    File "/usr/share/weewx/weeutil/weeutil.py", line 1667, in 
min_with_none
         ****      xmin = min(x, xmin)
         ****             ^^^^^^^^^^^^
         ****  TypeError: '<' not supported between instances of 'float' and 
'str'
         ****  Generator terminated
ted between instances of 'float' and 'str'
 Caught unrecoverable exception in generator 
'user.polarwindplot.PolarWindPlotGenerator'
         ****  can only concatenate str (not "float") to str
         ****  Traceback (most recent call last):
         ****    File "/usr/share/weewx/weewx/reportengine.py", line 248, in run
         ****      obj.start()
         ****    File "/usr/share/weewx/weewx/reportengine.py", line 465, in 
start
         ****      self.run()
         ****    File "/etc/weewx/bin/user/polarwindplot.py", line 184, in run
         ****      self.genPlots(self.gen_ts)
         ****    File "/etc/weewx/bin/user/polarwindplot.py", line 305, in 
genPlots
         ****      image = plot_obj.render(title)
         ****              ^^^^^^^^^^^^^^^^^^^^^^
         ****    File "/etc/weewx/bin/user/polarwindplot.py", line 1302, in 
render
         ****      self.set_plot()
         ****    File "/etc/weewx/bin/user/polarwindplot.py", line 1338, in 
set_plot
         ****      bin = int((this_dir_vec + (180.0 / self.petals)) / (360.0 / 
self.petals)) % self.petals
         ****                 ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
         ****  TypeError: can only concatenate str (not "float") to str
         ****  Generator terminated
tenate str (not "float") to str
 Caught unrecoverable exception in generator 'user.jsonengine.JSONGenerator'
         ****  could not convert string to float: ''
         ****  Traceback (most recent call last):
         ****    File "/usr/share/weewx/weewx/reportengine.py", line 248, in run
         ****      obj.start()
         ****    File "/usr/share/weewx/weewx/reportengine.py", line 465, in 
start
         ****      self.run()
         ****    File "/etc/weewx/bin/user/jsonengine.py", line 59, in run
         ****      self.gen_data()
         ****    File "/etc/weewx/bin/user/jsonengine.py", line 132, in gen_data
         ****      ret, category_history, daily_highlow_values = 
self.gen_history_data(category, category_config, 
self.chart_dict[chart][category].get('data_binding'))
         ****                                                    
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         ****    File "/etc/weewx/bin/user/jsonengine.py", line 226, in 
gen_history_data
         ****      combined_series, processed_highlow_values = 
self.combine_series(series, daily_highlow_values, item_config, target_unit)
         ****                                                  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         ****    File "/etc/weewx/bin/user/jsonengine.py", line 276, in 
combine_series
         ****      value = self.convert_value(value, decimals, series[2].unit, 
series[2].group, target_unit)
         ****              
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         ****    File "/etc/weewx/bin/user/jsonengine.py", line 296, in 
convert_value
         ****      return round(float(value), decimals + 1)
         ****                   ^^^^^^^^^^^^
         ****  ValueError: could not convert string to float: ''
         ****  Generator terminated
vert string to float: ''
 Caught unrecoverable exception in generator 
'weewx.imagegenerator.ImageGenerator'
         ****  '<' not supported between instances of 'float' and 'str'
         ****  Traceback (most recent call last):
         ****    File "/usr/share/weewx/weewx/reportengine.py", line 248, in run
         ****      obj.start()
         ****    File "/usr/share/weewx/weewx/reportengine.py", line 465, in 
start
         ****      self.run()
         ****    File "/usr/share/weewx/weewx/imagegenerator.py", line 37, in 
run
         ****      self.gen_images(self.gen_ts)
         ****    File "/usr/share/weewx/weewx/imagegenerator.py", line 107, in 
gen_images
         ****      image = plot.render()
         ****              ^^^^^^^^^^^^^
         ****    File "/usr/share/weewx/weeplot/genplot.py", line 212, in render
         ****      self._calcYScaling()
         ****    File "/usr/share/weewx/weeplot/genplot.py", line 557, in 
_calcYScaling
         ****      yline_min = min_with_none(line.y)
         ****                  ^^^^^^^^^^^^^^^^^^^^^
         ****    File "/usr/share/weewx/weeutil/weeutil.py", line 1667, in 
min_with_none
         ****      xmin = min(x, xmin)
         ****             ^^^^^^^^^^^^
         ****  TypeError: '<' not supported between instances of 'float' and 
'str'
         ****  Generator terminated
ted between instances of 'float' and 'str'

Reply via email to