I am not surprised that $year_delta=1 does not work on leap day. There is
no 29 February 2023.

This is issue #436 <https://github.com/weewx/weewx/issues/436>.


On Thu, Feb 29, 2024 at 9:45 AM František Slimařík <xslim...@gmail.com>
wrote:

> Hi Tom,
>
> actually I found another for cycle which caused the issue. When I changed
> delta from "$year_delta=1" into "$day_delta=365" it works again.
> Interesting it worked without any issue till yesterday :)
>
> ##for $A in $span($year_delta=1).months
>          $A.dateTime.format("%OB %Y");$A.rain.sum.format(add_label=False)
> #end for
>
>
> čt 29. 2. 2024 v 15:49 odesílatel Tom Keffer <tkef...@gmail.com> napsal:
>
>> I just tried this and it worked fine:
>>
>> 28. February 2023;33.4
>> 1. March 2023;36.1
>> 2. March 2023;38.0
>> 3. March 2023;37.1
>> ...
>> 26. February 2024;37.3
>> 27. February 2024;38.5
>> 28. February 2024;41.3
>>
>>
>> On Wed, Feb 28, 2024 at 8:57 PM František Slimařík <xslim...@gmail.com>
>> wrote:
>>
>>> Yes, right
>>>
>>> #for $i in $span($day_delta=365).days
>>> #set fDate = $i.dateTime.format("%-d. %B %Y")
>>> $fDate;$i.outTemp.avg.format(add_label=False)
>>> #end for
>>>
>>> čt 29. 2. 2024 v 1:49 odesílatel Tom Keffer <tkef...@gmail.com> napsal:
>>>
>>>> I don't know. How are you using the $span() tags? In a loop, I assume?
>>>>
>>>> On Wed, Feb 28, 2024 at 3:25 PM František Slimařík <xslim...@gmail.com>
>>>> wrote:
>>>>
>>>>> Hello,
>>>>>
>>>>> is it possible that leap year causes issue in span tag? I am using
>>>>> these:
>>>>>
>>>>> $span($day_delta=365).days
>>>>> $span($year_delta=1).months
>>>>>
>>>>> Feb 29 00:10:43 rocky-weather-machine weewxd[405028]: ERROR
>>>>> weewx.cheetahgenerator: Evaluation of template
>>>>> /etc/weewx/skins/neowx/year.html.tmpl failed with exception '<class
>>>>> 'ValueError'>'
>>>>> Feb 29 00:10:43 rocky-weather-machine weewxd[405028]: ERROR
>>>>> weewx.cheetahgenerator: **** Ignoring template
>>>>> /etc/weewx/skins/neowx/year.html.tmpl
>>>>> Feb 29 00:10:43 rocky-weather-machine weewxd[405028]: ERROR
>>>>> weewx.cheetahgenerator: **** Reason: day is out of range for month
>>>>> Feb 29 00:10:43 rocky-weather-machine weewxd[405028]: ERROR
>>>>> weewx.cheetahgenerator: ****  Traceback (most recent call last):
>>>>> Feb 29 00:10:43 rocky-weather-machine weewxd[405028]: ERROR
>>>>> weewx.cheetahgenerator: ****    File
>>>>> "/usr/share/weewx/weewx/cheetahgenerator.py", line 334, in generate
>>>>> Feb 29 00:10:43 rocky-weather-machine weewxd[405028]: ERROR
>>>>> weewx.cheetahgenerator: ****      unicode_string =
>>>>> compiled_template.respond()
>>>>> Feb 29 00:10:43 rocky-weather-machine weewxd[405028]: ERROR
>>>>> weewx.cheetahgenerator: ****    File
>>>>> "_etc_weewx_skins_neowx_year_html_tmpl.py", line 1380, in respond
>>>>> Feb 29 00:10:43 rocky-weather-machine weewxd[405028]: ERROR
>>>>> weewx.cheetahgenerator: ****    File "/usr/share/weewx/weewx/tags.py", 
>>>>> line
>>>>> 132, in span
>>>>> Feb 29 00:10:43 rocky-weather-machine weewxd[405028]: ERROR
>>>>> weewx.cheetahgenerator: ****      year_delta=year_delta, 
>>>>> boundary=boundary),
>>>>> Feb 29 00:10:43 rocky-weather-machine weewxd[405028]: ERROR
>>>>> weewx.cheetahgenerator: ****    File 
>>>>> "/usr/share/weewx/weeutil/weeutil.py",
>>>>> line 402, in archiveSpanSpan
>>>>> Feb 29 00:10:43 rocky-weather-machine weewxd[405028]: ERROR
>>>>> weewx.cheetahgenerator: ****      start_dt = time_dt.replace(year=year,
>>>>> month=month)
>>>>> Feb 29 00:10:43 rocky-weather-machine weewxd[405028]: ERROR
>>>>> weewx.cheetahgenerator: ****  ValueError: day is out of range for month
>>>>>
>>>>> --
>>>>> 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 weewx-user+unsubscr...@googlegroups.com.
>>>>> To view this discussion on the web visit
>>>>> https://groups.google.com/d/msgid/weewx-user/6ca52acb-9235-4154-9e01-ba5e23a9750dn%40googlegroups.com
>>>>> <https://groups.google.com/d/msgid/weewx-user/6ca52acb-9235-4154-9e01-ba5e23a9750dn%40googlegroups.com?utm_medium=email&utm_source=footer>
>>>>> .
>>>>>
>>>> --
>>>> You received this message because you are subscribed to a topic in the
>>>> Google Groups "weewx-user" group.
>>>> To unsubscribe from this topic, visit
>>>> https://groups.google.com/d/topic/weewx-user/7c8sNahwkiw/unsubscribe.
>>>> To unsubscribe from this group and all its topics, send an email to
>>>> weewx-user+unsubscr...@googlegroups.com.
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/d/msgid/weewx-user/CAPq0zECBN016YJK8gbzfY_gM4rjGFxmFUDmjpHWEdGcfTH2Tog%40mail.gmail.com
>>>> <https://groups.google.com/d/msgid/weewx-user/CAPq0zECBN016YJK8gbzfY_gM4rjGFxmFUDmjpHWEdGcfTH2Tog%40mail.gmail.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 weewx-user+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/weewx-user/CAPXATBW0bD_xgqW9m0q0yQ2JzoFB3uJmJv77ARyzM_dF-4ajOQ%40mail.gmail.com
>>> <https://groups.google.com/d/msgid/weewx-user/CAPXATBW0bD_xgqW9m0q0yQ2JzoFB3uJmJv77ARyzM_dF-4ajOQ%40mail.gmail.com?utm_medium=email&utm_source=footer>
>>> .
>>>
>> --
>> You received this message because you are subscribed to a topic in the
>> Google Groups "weewx-user" group.
>> To unsubscribe from this topic, visit
>> https://groups.google.com/d/topic/weewx-user/7c8sNahwkiw/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to
>> weewx-user+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/weewx-user/CAPq0zEABFqb9wgJyMprjwLga5%2BoiF3YvVO35VhvxoO7HT5NjjA%40mail.gmail.com
>> <https://groups.google.com/d/msgid/weewx-user/CAPq0zEABFqb9wgJyMprjwLga5%2BoiF3YvVO35VhvxoO7HT5NjjA%40mail.gmail.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 weewx-user+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/weewx-user/CAPXATBXy019RDT-S_1HN6gApoyDxhtPP8Ay_%3DuQS6R87nHjiGQ%40mail.gmail.com
> <https://groups.google.com/d/msgid/weewx-user/CAPXATBXy019RDT-S_1HN6gApoyDxhtPP8Ay_%3DuQS6R87nHjiGQ%40mail.gmail.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 weewx-user+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/CAPq0zECHQV5Y%2BdFbA_vgoYztJbQXCHN8c1QngP3J%3DV4qRj%3Di-A%40mail.gmail.com.

Reply via email to