Click or drag to resize

DatedBreakdownAllowPartialLatest Property

Returns true if the latest day range can be partially filled (i.e. incomplete); false otherwise (the default case).

Namespace: DegreeDays.Api.Data
Assembly: DegreeDays (in DegreeDays.dll) Version: 1.4
Syntax
public bool AllowPartialLatest { get; }

Property Value

Boolean
Remarks

When specifying time-series data (like hourly temperature data), you can specify a breakdown with this AllowPartialLatest property set to true, to tell the API to include values for the current day so far. For example:

TimeSeriesDataSpec hourlyTempsIncludingToday = DataSpec.TimeSeries(
    TimeSeriesCalculation.HourlyTemperature(TemperatureUnit.Celsius),
    DatedBreakdown.Daily(Period.LatestValues(31))
        .WithAllowPartialLatest(true));

If you requested the above-specified hourly temperature data at, say, 11:42 on any given day, you could expect it to include values for 00:00, 01:00, 02:00 through to 11:00 on that day (bearing in mind that some stations are slower to report than others so you won't always get the absolute latest figures).

Please note that the most recent time-series data can be a little volatile, as weather stations sometimes send multiple reports for the same time, some delayed, and some marked as corrections for reports they sent earlier. Our system generates time-series data using all the relevant reports that each weather station has sent, but the generated figures may change if delayed or corrected reports come through later. If you are storing partial-latest time-series data we suggest you overwrite it later with figures generated after the day has completed and any delayed/corrected reports have had time to filter through.

This AllowPartialLatest property exists mainly for time-series data, but you can also set it to true on a breakdown for degree days, to specify that the data can include a value for the latest partial week/month/year. For example:

DatedDataSpec monthlyHddIncludingPartialLatest = DataSpec.Dated(
    Calculation.HeatingDegreeDays(Temperature.Fahrenheit(65)),
    DatedBreakdown.Monthly(Period.LatestValues(12))
        .WithAllowPartialLatest(true));

If you requested the above-specified monthly degree-day data on, say, June 22nd, you could expect the last of the 12 values returned to cover from the start of June 1st through to the end of June 21st (assuming a good weather station with frequent reporting and minimal delays). If you left AllowPartialLatest with its default value of false, the last of the 12 values returned would be for the full month of May (i.e. from the start of May 1st to the end of May 31st), as the monthly figure for June wouldn't become available until June ended.

Unlike for time-series data, this property will never cause degree days to be calculated for partial days. So for degree days this property will only make a difference on weekly, monthly, yearly, and custom breakdowns with day ranges covering multiple days.

Any partial-latest day range will always start on the usual day (i.e. it will never be cut short at the start), it's only the end that can be cut short. This is true for both degree days and time-series data.

To create a DatedBreakdown with this AllowPartialLatest property set to true, use the WithAllowPartialLatest methods listed below under "See Also".

Version History
VersionDescription
1.3 This was added in version 1.3.
See Also