Skip to content

Cut every response to a closed request period - #42

Merged
jravani merged 2 commits into
enerplanetfrom
feat/occupancy-only-period
Oct 13, 2026
Merged

jravani merged 2 commits into
enerplanetfrom
feat/occupancy-only-period

Conversation

@jravani

@jravani jravani commented Oct 13, 2026

Copy link
Copy Markdown
Member

Every /api/process response now covers the period properties.start_time to properties.end_time instead of the whole weather year.

Behaviour

  • start_time and end_time are both inclusive. A full year is 1 January 00:00 to 31 December 23:00; 2018-01-01T00:00:00Z to 2018-01-07T23:00:00Z returns 168 hourly values.
  • The thermal series (heating, cooling) and the occupancy series (electricity, hot water, kitchen) are cut to the period, and so is every summary value: totals, peaks and energy intensity. The response's start_time and end_time are the first and last returned stamps.
  • The thermal model still solves the whole year of start_time, so a season's heating equals those hours of an annual run.
  • A period reaching outside the simulated year is rejected with an error naming the requested and the simulated bounds. A request ending at 1 January 00:00 of the next year is now one hour too long.
  • Each stamp counts as the hour it starts in, so a weather index on hh:30 keeps every hour of the period. A timestamp without a zone is read as UTC.

Changes

  • geojson_processor.py: GeoJsonProcessor._window cuts the series on both the thermal and the occupancy-only path before the profile and summary are built.
  • The dummy building fixtures, request_format.rst and the CHANGELOG move to the closed full year.
  • tests/test_period_window.py covers a one-week occupancy-only run, a one-week thermal run (series, total and peak), rejection outside the year, an hh:30 index over a full year, and zoneless stamps. Tests whose inline weather covers only a few hours now request those hours.

Testing

pytest -q -m "not slow": 351 passed, 29 skipped.

An occupancy-only request returned the whole weather year whatever
properties.start_time and end_time said; the dates only reached the
response metadata. The series are now cut to that period, start
inclusive and end exclusive, so a period of (end - start) / resolution
steps returns exactly that many values, and a period outside the
simulated year is rejected. A thermal run still returns the whole
year.
start_time and end_time are both inclusive, so a full year is
1 January 00:00 to 31 December 23:00 and a season or a week returns
exactly its hours. The cut now applies to thermal runs as well: the
model still solves the whole year, and the series and summary report
only the requested period. Each stamp counts as the hour it starts
in, so an hh:30 weather index keeps all hours. The dummy fixtures and
docs move to the closed full year; tests whose inline weather covers
a few hours request those hours.
@jravani
jravani merged commit e6819d0 into enerplanet Oct 13, 2026
1 check passed
@jravani
jravani deleted the feat/occupancy-only-period branch October 13, 2026 20:25
@jravani jravani added this to the v6.10.0 milestone Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant