I just tried your snippet on my machine and it worked fine:

{ "month": -3.8°C },
{ "month": -3.7°C },
{ "month": -4.9°C },
{ "month": 5.9°C },
{ "month": 9.2°C },
{ "month": 8.5°C },
{ "month": 5.7°C },
{ "month": 0.5°C },
{ "month": -1.2°C },
{ "month": -4.0°C },
{ "month": -4.0°C },
{ "month": -7.7°C },

What is the template /etc/weewx/skins/Seasons/curves_json.tmpl? It's not
part of WeeWX. Check it for errors.

-tk

On Sun, Apr 3, 2022 at 11:13 AM Warren Gill <[email protected]> wrote:

> If I add the month aggregation to my templates, Cheetah chokes.
>
> #for $m in $range(12)
> { "month": $month($months_ago=$m).outTemp.min },
> #end for
>
> Produces the following error:
>
> Apr 03 13:07:04 weather python2[21603]: wee_reports[21603] ERROR
> weewx.cheetahgenerator: Evaluation of template
> /etc/weewx/skins/Seasons/curves.json.tmpl failed with exception '<type
> 'exceptions.TypeError'>'
> Apr 03 13:07:04 weather python2[21603]: wee_reports[21603] ERROR
> weewx.cheetahgenerator: **** Ignoring template
> /etc/weewx/skins/Seasons/curves.json.tmpl
> Apr 03 13:07:04 weather python2[21603]: wee_reports[21603] ERROR
> weewx.cheetahgenerator: **** Reason: __call__() got an unexpected keyword
> argument 'months_ago'
> Apr 03 13:07:04 weather python2[21603]: wee_reports[21603] ERROR
> weewx.cheetahgenerator: **** Traceback (most recent call last):
> Apr 03 13:07:04 weather python2[21603]: wee_reports[21603] ERROR
> weewx.cheetahgenerator: **** File
> "/usr/share/weewx/weewx/cheetahgenerator.py", line 348, in generate
> Apr 03 13:07:04 weather python2[21603]: wee_reports[21603] ERROR
> weewx.cheetahgenerator: **** unicode_string = compiled_template.respond()
> Apr 03 13:07:04 weather python2[21603]: wee_reports[21603] ERROR
> weewx.cheetahgenerator: **** File
> "_etc_weewx_skins_Seasons_curves_json_tmpl.py", line 109, in respond
> Apr 03 13:07:04 weather python2[21603]: wee_reports[21603] ERROR
> weewx.cheetahgenerator: **** TypeError: __call__() got an unexpected
> keyword argument 'months_ago'
>
> However, other aggregations (days, weeks, years) work fine:
>
> #for $m in $range(12)
> { "month": $year($years_ago=$m).outTemp.min },
> #end for
>
> No errors produced, output is as expected.
>
> What am I doing wrong?
>
> --
> 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/16b67157-78d9-4af4-8241-4746023cdb66n%40googlegroups.com
> <https://groups.google.com/d/msgid/weewx-user/16b67157-78d9-4af4-8241-4746023cdb66n%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/CAPq0zECgsxgTB7UPNZ2g-EwKn4kjyS7zF2N6_fD7x8BmOW9n4g%40mail.gmail.com.

Reply via email to