Thanks Tom, that looks like exactly what I need.  Doing some testing this 
morning, I get an error on 
trend=trend_dict,

NameError: global name 'trend_dict' is not defined

Where does this dictionary originate?

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


On Saturday, June 24, 2017 at 8:25:07 PM UTC-6, Tom Keffer wrote:
>
> Not a simple question at all! 
>
> Generally, yes, you can use something similar to the tags in your code by 
> following the same path through the objects. For example,
>
> $day.outTemp.latest
>
> can be obtained by using 
>
>         stats = weewx.tags.TimeBinder(
>             db_lookup,
>             timespan.stop,
>             formatter=self.generator.formatter,
>             converter=self.generator.converter,
>             week_start=self.generator.stn_info.week_start,
>             rain_year_start=self.generator.stn_info.rain_year_start,
>             trend=trend_dict,
>             skin_dict=self.generator.skin_dict)
>
>             latest = stats.day.outTemp.latest
>
> This is basically all Cheetah is doing!
>
> Hope this helps.
>
> -tk
>
>
> On Sat, Jun 24, 2017 at 8:39 AM, Thomas Carlin <[email protected] 
> <javascript:>> wrote:
>
>> Good morning everyone,
>>
>> I have a custom search list extension that I am working on to do some 
>> analysis on my collected data, and I have it to the point that I am pulling 
>> the data out, and can manipulate it, but to do so, I had to define my own 
>> timespan/binder inside my script.  (The historygenerator extension does the 
>> same thing).
>>
>> Is there any way to use the weewx defined 'latest'  or 'current' timespan 
>> inside my python extension?  Please forgive me if this is a simple 
>> question, the only programing experience that I have is self-inflicted, and 
>> far from complete.
>>
>> Thank you!
>>
>> -- 
>> 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] <javascript:>.
>> 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.

Reply via email to