Tom Keffer <[email protected]> writes:

> Very useful data, Cameron.
>
> Right now, if you want one year's worth of say, windchill, and it's not in
> the database, it is calculated one record at a time. For a 5 minute archive
> interval, that's 100k+ database accesses. It's a general algorithm, but
> it's slow.
>
> Alternatively, one could write a specialized algorithm for windchill. The
> sensible thing to do would be to read a year's worth of temperature and
> wind speed, all in one go --- one database access. Then use the results to
> calculate the year's worth of windchill. The downside is that it's not
> general at all: it would only know how to calculate windchill. The upside
> is that the existing xtypes API can be used right now to do this. You'd
> have to write extensions for all of your missing synthesized types.

I wonder if this could be organized into

  a database accessor to get multiple columns, that results in a stream
  of N values

  functions that accept N values to compute something else
  (e.g. windchill from temp/wind).

  a function that takes a computing function and a stream

so that most of the code that is the same can be only once.  I gather
there are pythonic idioms for the stream.

That may be saying the same thing, but not having a clue about the weewx
details, just a CS back bencher kind of comment :-)

-- 
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/rmi4jg25u57.fsf%40s1.lexort.com.

Reply via email to