Say you have two SLEs. The first one defines foo, the second bar. Furthermore, say we have a template containing
$bar.outTemp $bar.barometer $bar.whiz As Cheetah evaluates these, it will try the "foo" extension first (because it's first in the list). But, because foo doesn't define bar, it moves on to the next extension in the list. The "bar" extension does define it, so it gets a hit. Cheetah then tries to evaluate the attributes 'outTemp', 'barometer', 'whiz' on the results. So, the foo extension did get probed, but not far enough to do the full evaluation. Because the standard weewx extensions use lazy evaluation, that means the database never actually gets queried. I'm not sure I'm being very clear here and I'm not sure I addressed your point. If not, and I'm missing something, I'd sure like to know! -tk On Sun, Jun 25, 2017 at 5:02 PM, gjr80 <[email protected]> wrote: > On Monday, 26 June 2017 02:49:32 UTC+10, Thomas Carlin wrote: > > >> Unrelated to the original question, I noticed that my extension runs >> several times (7 i think) for each report generation. It's trivial to >> write a catch in so it only runs once, but i'm curious why this is. Could >> you shed any light on this? >> >> -Thomas >> > > I appreciate this thread has moved on from this question, but I wonder if > what is being observed is the phenomenon whereby a Search List Extension > (SLE) included in a given skin is called once for each report within the > skin, irrespective of whether or not the SLE is used by each report. This > has certainly been my experience with skins/SLE that I have put > together/modified. Calling the SLE multiple times is probably not an issue > in most cases, as the time taken to 'execute' the SLE is usually minimal; > however, some complex SLEs I have written take a number of seconds to > execute and this multiplied by the number of reports in the skin can be > significant. If this is a problem the only real thing you can do is > refactor your skin/reports to maybe have reports that call the 'problem' > SLE in their own skin so as to avoid unnecessary calls to the SLE. > Definitely had to do this with weeWX-WD. > > Gary > > -- > 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]. > For more options, visit https://groups.google.com/d/optout. > -- 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]. For more options, visit https://groups.google.com/d/optout.
