Opinions solicited on best way to add this particular new functionality

53 views
Skip to first unread message

jpb...@gmail.com

unread,
Jan 1, 2021, 10:57:58 AM1/1/21
to weewx-development
I wish to add the Chandler Burning Index (CBI) to WeeWX.

The CBI is completely a derived number. In this way, it is the same type of thing as 'dewpoint' - calculated based on temperature and relative humidity with a formula.

My goals are as follows:

1) Report the value in the current page, as well as min/max values in weekly, monthly, yearly totals.
2) Graph this as a new graph (I can't combine it with temperature as dewpoint does as the Y-axis label is different.)
3) Provide a mechanism to one-time retroactively compute the CBI values to all historic records someone has stored.

I believe (3) requires new code no matter what - I am not familiar with any existing code that will add in new values for a derived calculation to match prior observations. So, (3) can be actually put to the side for the moment.

The question is - what's the best way to do (1) and (2)? Two possible approaches are:

a) Implement a new 'cbi' extension, with its own database.
b) Add CBI to the core existing code-base, pretty much exactly where dewpoint iis calculated for (1) (and database schemas defined, etc.) - and simply adding in a new graph for the CBI.

In the briefest terms, should I implement this as an extension or as additions to the existing code? Obviously, either approach would be 'given back' to be used - but what is the preferred way to implement this?

Vince Skahan

unread,
Jan 1, 2021, 1:33:24 PM1/1/21
to weewx-development
I think I'd lean toward adding an extension, at least initially, since CBI is not in the default schema and anything you patch into weewx will get lost when you do version updates if you try to patch the core outside of the 'user' tree, but there's likely no wrong answer.

Tom Keffer

unread,
Jan 1, 2021, 5:15:08 PM1/1/21
to jpb...@gmail.com, weewx-development
Perfect application for an xtypes extension

--
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 weewx-developm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-development/41c4df89-3c00-4468-932d-d4d399fbe9a7n%40googlegroups.com.

Joel Bion

unread,
Jan 1, 2021, 5:27:25 PM1/1/21
to Tom Keffer, weewx-development
Wow - this fits perfectly. Xtypes extension it is then! 

-Joel

On Jan 1, 2021, at 2:15 PM, Tom Keffer <tke...@gmail.com> wrote:



Vince Skahan

unread,
Jan 1, 2021, 5:40:56 PM1/1/21
to weewx-development
One ask here - if you have the time+inclination, it would be great to have a full-up end-to-end example that is installable via wee_extension.   It's always helpful to have a full working example to start with when we try to leverage all the sweat equity from the folks who battled through figuring it out the first time.  Sometimes the internals snippets in the docs and code can get a bit hard to connect up mentally into a working whole.

CBI seems pretty interesting from a quick google search.  Cool stuff !
Reply all
Reply to author
Forward
0 new messages