An estimated day baseline took its scale from the newest sample, so use from the web lowered the budget while today stayed within it. It now takes the scale from the first sample at or after the day start (D7). The stale sample warning moves into the "used" caption, so tiles of one kind keep the same rows (D8). Both answer the first review of #15. Refs #13
This commit is contained in:
@@ -66,7 +66,7 @@ public static partial class LimitAnalysis
|
||||
if (length > TimeSpan.FromDays(1))
|
||||
{
|
||||
var today = current.Days.FirstOrDefault(d => d.IsToday);
|
||||
days = PlanDays(window, current, past.FirstOrDefault(), today, observations, now, zone);
|
||||
days = PlanDays(window, current, past.FirstOrDefault(), today, observations, weighted, now, zone);
|
||||
}
|
||||
return new(current, past, days);
|
||||
|
||||
@@ -75,9 +75,7 @@ public static partial class LimitAnalysis
|
||||
{
|
||||
double Weight(DateTimeOffset from, DateTimeOffset to)
|
||||
{
|
||||
var hour = Hour(from < start ? start : from);
|
||||
var exclusiveEnd = Hour(end);
|
||||
return weighted.Where(p => p.Time >= hour && p.Time < to && p.Time < exclusiveEnd).Sum(p => p.Weight);
|
||||
return WeightedTokens(weighted, start, end, from, to);
|
||||
}
|
||||
var measured = Instance(anchor, observations).Where(s => s.SampleTime >= start - TimeSpan.FromMinutes(15) && s.SampleTime <= until)
|
||||
.GroupBy(s => s.SampleTime).Select(g => g.Last()).OrderBy(s => s.SampleTime).ToArray();
|
||||
|
||||
Reference in New Issue
Block a user