Skip to content

Read .eso files whose run period starts on a holiday - #37

Merged
btokarzewskidb merged 1 commit into
mainfrom
fix/holiday-start-day
Nov 17, 2026
Merged

btokarzewskidb merged 1 commit into
mainfrom
fix/holiday-start-day

Conversation

@btokarzewskidb

Copy link
Copy Markdown
Contributor

Fixes #36.

Problem

EnergyPlus writes each step's day type, so a run period that starts on a holiday or special day reports Holiday, SpecialDay1, CustomDay2 and so on instead of a weekday. convert_raw_date_data took the year from the first step's day type alone. Such files therefore raised ValueError: Failed to automatically find year ... day='Holiday', or StartDayMismatch when year= was given. Reference buildings that start on New Year's Day failed this way.

Fix

first_calendar_day() in processing/esofile_time.py returns the first step whose day type is a weekday or a design day, looking only at steps before the first year boundary so the date belongs to the data's first year. Both the seek_year path and the validate_year path use it. If there is no such step (a run made only of special days), the year defaults to 2002, as it already does for monthly-only data. Files that start on a normal weekday behave exactly as before. The new code is plain Python 2.7-compatible, for IronPython.

Tests

  • tests/test_esofile_time.py::TestRunPeriodStartingOnSpecialDay:
    • a holiday start;
    • several special days in a row;
    • a correct explicit year;
    • a wrong explicit year, which still raises StartDayMismatch;
    • a run made only of special days.
  • tests/test_eso_versions.py::TestHolidayStart: a real EnergyPlus 26.2 file, tests/test_files/262_1ZoneUncontrolledHolidayStart.eso (592 KB). It comes from the new resources/262_1ZoneUncontrolledHolidayStart.idf, which is 252_1ZoneUncontrolled with a 1–7 January run period and a New Years Day RunPeriodControl:SpecialDays. The file loads, the run period starts on Tuesday 1 January, and it has 168 hourly steps. *.eso is git-ignored, so the fixture is force-added like the existing ones.

What I ran

What I did not run

  • I didn't test under IronPython 2.7.
  • I didn't run the tests on Python 3.11–3.13; CI does.
5 files changed, 31529 insertions(+), 4 deletions(-)

Most of the added lines are the .eso fixture.

🤖 Generated with Claude Code

EnergyPlus writes each step's day type, so a run period that starts on a
holiday or special day reports 'Holiday', 'SpecialDay1', 'CustomDay2' and
so on instead of a weekday. The year was worked out from the first step
alone, so such files raised ValueError ("Failed to automatically find
year ... day='Holiday'"), or StartDayMismatch with an explicit year. Many
reference buildings start on New Year's Day and failed this way.

first_calendar_day() now picks the first step with a weekday (or design
day) before the first year boundary, and both seek_year and validate_year
use it. With no such step (a run of special days only), the year defaults
to 2002 as for monthly-only data.

Adds unit tests and a 1-7 January EnergyPlus 26.2 fixture that starts on
a New Years Day holiday, with its IDF in resources/.

Fixes #36

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@btokarzewskidb
btokarzewskidb merged commit 27f36ef into main Nov 17, 2026
5 checks passed
@btokarzewskidb
btokarzewskidb deleted the fix/holiday-start-day branch November 17, 2026 13:05
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.

ValueError loading an .eso whose run period starts on a holiday (e.g. reference buildings)

1 participant