On Sat, Mar 2, 2024 at 9:38 AM Karen K <[email protected]> wrote:
> > First is the ArchiveTable class. It calls the general get_aggregate > function and thus also your XType. If you want ArchiveTable handle > get_series aggregations for your XType, you have to insert your XType after > ArchiveTable. But if you implemented aggregations and do not want > XTypeTable handle those aggregations, then you need to insert your XTypes > before XTypeTable. That is, between ArchiveTable and XTypeTable. > I guess I'm not seeing that. If ArchiveTable.get_series() calls xtypes.get_aggregate(), it will run down the list of xtypes. It won't use the one in ArchiveTable because it doesn't know about your new type. It keeps going until it gets to your xtype extension. > If your users want to speed up something and include your XTypes into the > database, they surely want the DailySummaries class handle aggregations. > But that does not mean that you want XTypeTable handle the aggegations of > your XType in the other case. You may have provided your own implementation > of the aggregations. That means you have to insert your XType after > DailySummaries but before XTypeTable. > If the XType is in the database, it will be handled like any other type. There is no longer anything special about it. There is no reason for XTypeTable to come into play. I also don't know why you'd want your own implementation of get_aggregate() if the type is in the database. So I guess if you want your XType to behave in an intuitive way and you > have implemented the aggregations, then you will have to insert it after > ArchiveTable and DailySummaries, but before XTypeTable. > Respectively disagree. New XTypes can be appended or prepended to the list --- the only time it matters is a straight optimization of get_aggregate(). Then it must appear at the beginning of the list so it appears before XTypeTable.get_aggregate(). See the new wiki article on xtypes performance <https://github.com/weewx/weewx/wiki/XTypes-performance>. It explains some of this. -tk -- 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/CAPq0zEA8h_DYLP6%2BrTB4VeEo46%2B9ySXsfasExohbptVuk8peSw%40mail.gmail.com.
