Thanks Manuel. Your loop code is very similar to mine. I was thinking that
I might be able to do the same using tags, but I guess not,
On Monday, August 31, 2026 at 2:19:25 PM UTC+1 Manuel Hilgert wrote:
> No extension needed. $alltime.years iterates over the years, and
> $alltime.start and $alltime.end say where the data begins and ends. That is
> enough to compare only the years you have in full:
>
> #set $wettest = None
> #set $wettest_year = None
> #set $driest = None
> #set $driest_year = None
> #for $yr in $alltime.years
> #if $yr.start.raw >= $alltime.start.raw and $yr.end.raw <=
> $alltime.end.raw
> #set $total = $yr.rain.sum
> #if $total.raw is not None
> #if $wettest is None or $total.raw > $wettest.raw
> #set $wettest = $total
> #set $wettest_year = $yr.dateTime.format("%Y")
> #end if
> #if $driest is None or $total.raw < $driest.raw
> #set $driest = $total
> #set $driest_year = $yr.dateTime.format("%Y")
> #end if
> #end if
> #end if
> #end for
> Wettest year: $wettest_year, $wettest
> Driest year: $driest_year, $driest
>
> The test on $yr.start and $yr.end is what keeps the first and the current
> year out. Without it, the driest year is the current one until December,
> and the wettest is whichever partial year is long enough.
>
> $alltime.years follows the calendar year, not rain_year_start.
>
> [email protected] schrieb am Montag, 31. August 2026 um
> 14:59:41 UTC+2:
>
>> Thanks Tom. Reviewing weewx-xaggs
>> <https://github.com/tkeffer/weewx-xaggs> it looks like the historical
>> tag can only be applied to a day unless I've missed something?
>>
>> On Monday, August 31, 2026 at 1:06:42 PM UTC+1 Tom Keffer wrote:
>>
>>> See if the extension weewx-xaggs
>>> <https://github.com/tkeffer/weewx-xaggs> does what you want.
>>>
>>> On Sun, Aug 30, 2026 at 10:46 PM [email protected] <
>>> [email protected]> wrote:
>>>
>>>> I want to report the years with the highest and lowest total rainfalls.
>>>> I can do it programmatically by looping through all the years. However I
>>>> thought it may be possible using tags. I've tried a few variants but it's
>>>> defeated me, for example alltime.rain.sum provides totals rainfall for all
>>>> years.
>>>> Thanks
>>>>
>>>> --
>>>> 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/d520fe0d-63fa-4298-ad93-517dc13c47ban%40googlegroups.com
>>>>
>>>> <https://groups.google.com/d/msgid/weewx-user/d520fe0d-63fa-4298-ad93-517dc13c47ban%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/32afb3ce-ef2b-4b4b-a4be-e9c8b22154cdn%40googlegroups.com.