It's up to the implementation of get_scalar() to decide whether to use the "current" record, or to retrieve a type from the database. Obviously, if it's not in the record, it should get the necessary ingredients for the xtypes calculation from either the record, or from the database.
What observation type are you trying to calculate? That is, what implementation of get_scalar() are you referring to? -tk On Sun, Jul 2, 2023 at 6:02 AM [email protected] <[email protected]> wrote: > I’m using $current.obs where obs is an xtype. > > The xtype is not in the current record, so a record is retrieved from the > db. But then the current record is passed into the xtype system. But, the > necessary values to calculate the xtype are not in the current record. So > calculating the xtype fails. > So maybe if the xtype fails with the current record, it needs to try with > the record from the db? That sounds a bit messy… > > Here is a link to the line in question. > > https://github.com/weewx/weewx/blob/548bf5eccc5bba35eeefe482fe4fd1b95f364f06/bin/weewx/tags.py#L599 > > A reasonable workaround for me is to $latest. > Thanks! > rich > > -- > You received this message because you are subscribed to the Google Groups > "weewx-development" 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-development/3d6dfa2a-8cb9-40ae-8631-7981210bc041n%40googlegroups.com > <https://groups.google.com/d/msgid/weewx-development/3d6dfa2a-8cb9-40ae-8631-7981210bc041n%40googlegroups.com?utm_medium=email&utm_source=footer> > . > -- You received this message because you are subscribed to the Google Groups "weewx-development" 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-development/CAPq0zECRug-o8nZ-NkssTQbzmch9bF0bjpUAx0hmc6cBX-1obQ%40mail.gmail.com.
