Yes, it should be possible. Unfortunately, there's not much documentation
about aggregations taking a value, and what little there is, is wrong!

On Mon, Sep 28, 2020 at 10:35 PM Chris Davies-Barnard <
[email protected]> wrote:

> Thanks Tom.
>
> Should I have been able to glean this from the documentation?
>
> If not, could the documentation be updated to show the inputs required?
> Something in keeping with or similar to the main Python documentation.
>
> Thanks again for the excellent support.
>
> Chris
>
> On Monday, September 28, 2020 at 11:07:14 PM UTC+1 [email protected] wrote:
>
>> The aggregate type sum_ge() actually takes a ValueTuple as an argument,
>> not a single float. As a convenience, for some types, it can be shortened
>> to a 2-way tuple. So, you want
>>
>> $month.rain.sum_ge((1.0, 'mm'))
>>
>> -tk
>>
>>
>>
>> On Mon, Sep 28, 2020 at 12:07 PM Chris Davies-Barnard <
>> [email protected]> wrote:
>>
>>> Evening all,
>>>
>>> From the http://www.weewx.com/docs/customizing.htm#aggregation_types
>>> page I believe the following should work for months with equivalents
>>> working for weeks and years.
>>>
>>> $month.rain.sum_ge(1.0)
>>>
>>> and thus provide me with a value comparable to the MET Office Climate
>>> Averages.
>>>
>>> https://www.metoffice.gov.uk/research/climate/maps-and-data
>>>
>>> but at the moment I'll getting an error:
>>>
>>> Sep 28 20:05:44 pecan-ubuntu wee_reports[30045] ERROR
>>> weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/tags.py", line
>>> 326, in sum_ge
>>> Sep 28 20:05:44 pecan-ubuntu wee_reports[30045] ERROR
>>> weewx.cheetahgenerator: ****      return self._do_query('sum_ge', val=val)
>>> Sep 28 20:05:44 pecan-ubuntu wee_reports[30045] ERROR
>>> weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/tags.py", line
>>> 364, in _do_query
>>> Sep 28 20:05:44 pecan-ubuntu wee_reports[30045] ERROR
>>> weewx.cheetahgenerator: ****      db_manager, val=val, **self.option_dict)
>>> Sep 28 20:05:44 pecan-ubuntu wee_reports[30045] ERROR
>>> weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/xtypes.py",
>>> line 102, in get_aggregate
>>> Sep 28 20:05:44 pecan-ubuntu wee_reports[30045] ERROR
>>> weewx.cheetahgenerator: ****      **option_dict)
>>> Sep 28 20:05:44 pecan-ubuntu wee_reports[30045] ERROR
>>> weewx.cheetahgenerator: ****    File "/home/weewx/bin/weewx/xtypes.py",
>>> line 422, in get_aggregate
>>> Sep 28 20:05:44 pecan-ubuntu wee_reports[30045] ERROR
>>> weewx.cheetahgenerator: ****      if len(val) == 2:
>>> Sep 28 20:05:44 pecan-ubuntu wee_reports[30045] ERROR
>>> weewx.cheetahgenerator: ****  TypeError: object of type 'float' has no len()
>>>
>>> and a different error if I wrap 1.0 in quotes.
>>>
>>> How am I getting this wrong?
>>>
>>> Chris
>>>
>>> --
>>> 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 on the web visit
>>> https://groups.google.com/d/msgid/weewx-user/13789d5f-eb48-4309-89f8-3af3e8759adbn%40googlegroups.com
>>> <https://groups.google.com/d/msgid/weewx-user/13789d5f-eb48-4309-89f8-3af3e8759adbn%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 on the web visit
> https://groups.google.com/d/msgid/weewx-user/1bbf6d1f-bd4c-4e68-a5de-bff2a190a3f7n%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/1bbf6d1f-bd4c-4e68-a5de-bff2a190a3f7n%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 on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zEA2xPvO62vTUg8PGHkGybjWx7Fx8Wo_S%2BW_vuLYwABDfQ%40mail.gmail.com.

Reply via email to