What you are seeing is some subtly different behaviour brought about by the 
introduction of xtypes in WeeWX v4. One of the things that xtypes did was 
replace the manager.getSqlVectors() method; it now uses xtypes.get_series() 
(getSqlVectors() still exists and continues to be supported in v4 for 
backwards compatibility, it just calls xtypes.get_series()). 

If the old getSqlVectors() was called with no aggregate, SqlVectors() 
simply queried the archive for data in the timespan concerrned and this 
query only returned records that currently exist in the archive (ie nothing 
in the future unless for some reason you had future dated data in your 
database). The number of data points returned by a non-aggregate call for 
current day, week, month, year spans was equal to the number of records 
from the start of the timespan to the current time. If an aggregate was 
included then the aggregate was calculated for all aggregate periods in the 
timespan (including future dated aggregate periods). Of course the 
aggregate for future dated aggregate periods is None/nothing and 
getSqlVectors() ignored these None/nothing rows. The number of data points 
returned by an aggregate call for current day, week, month, year spans was 
equal to the number of aggregate periods from the start of the timespan to 
the current time.

Now under xtypes.get_series(), the vectors returned when there is no 
aggregate follow the old getSqlVecrtors() approach; the archive is queried 
and only the data that is returned from the query is returned in the 
vectors (ie nothing future dated because no future date records exist) and 
again the number of data points returned by a non-aggregate call for 
current day, week, month, year spans was equal to the number of records 
from the start of the timespan to the current time. However, when an 
aggregate is specified xtypes.get_series() uses the same query as was used 
by getSqlVectors() but future dated aggregate results are now included. The 
number of data points returned by an aggregate call for current day, week, 
month, year spans was equal to the number of aggregate periods in the 
timespan.

So considering your examples, under the old getSqlVectors() I would expect 
your 'day span' call would return somewhere from 0 to 288 data points 
depending on time of day it was called. Your 'year span' call would return 
somewhere from 0 to 366 data points depending on the day it was called. 
Under the new v4 xtypes.get_series() I would expect your 'day span' call 
would return somewhere from 0 to 288 data points depending on time of day 
it was called. Your 'year span' call will always return 366 data points but 
of those 366 data points the last x data points will be None where x = 366 
- day number of the year the call was made.

I am not sure whether the changed behaviour was a deliberate choice on 
Tom's behalf or not, I suspect not, best left for Tom when he is back in 
contact in a week or so. I will raise an issue on this so it is not lost.

Gary

On Monday, 15 June 2020 07:07:04 UTC+10, Pat wrote:
>
> Coming up with a loss on this one. Both the "today" and the "year" charts 
> are the full time spans generated by weewx for their time period, and both 
> go through the same SQL function. Yet the year query results is populated 
> 366 times (once a day), but the day query results is only populated for 
> midnight to "now", not midnight to midnight like the timespan suggests. 
>
> Anyone else have any insight on why:
>
> The day span below does not return 288 results? (based on a 5 minute 
> archive interval)
>
> archive.getSqlVectors(TimeSpan(1592107200, 1592193600), outTemp, None, 
> None)
>
>
>
>
> However, this one return 366 results (based on the full year span)
>
> archive.getSqlVectors(TimeSpan(1577854800, 1609477200), outTemp, max, 
> 86400)
>
>
> Thoughts? Tom? Matthew? Gary?
>
>
> On Sunday, June 14, 2020 at 3:51:15 PM UTC-4, Pat wrote:
>>
>> haha i know what you meant! hope to look into it soon though
>>
>> On Sunday, June 14, 2020 at 3:12:25 PM UTC-4, Manfred Maier wrote:
>>>
>>> My post didn't want to say that you have to look into it NOW. 
>>> I just wanted to give a '+1' for this feature request ;)
>>>
>>> ... perhaps it's even something that is not possible at all with weewx 
>>> 4.0. 
>>>
>>

-- 
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].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/weewx-user/80facffa-0c6e-410a-bcae-26e777c80d76o%40googlegroups.com.

Reply via email to