Repository navigation
Parse two-digit EnergyPlus major versions in .eso files - #33
Merged
Merged
Conversation
get_eso_file_version sliced five characters and stripped the dots, so '25.2.0' became 252, below the 890 threshold for the sixth standard dictionary item. Every EnergyPlus 10.0+ file was read as pre-8.9: the annual dictionary line landed in the header under frequency '', so DBEsoFile.frequencies raised KeyError, and files with annual outputs failed to parse. The version is now a (major, minor, patch) tuple compared against (8, 9, 0). With annual rows parsed, design-day environments (which declare annual variables but report no annual rows) exposed two empty-list bugs in update_start_dates and find_num_of_days_annual; both now handle the empty case. Adds an EnergyPlus 26.2 .eso fixture with annual outputs, generated from resources/252_1ZoneUncontrolledAnnualOutputs.idf (transitioned to 26.2), plus version, frequencies and annual tests. Fixes #32 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #32.
Problem
get_eso_file_versiontook a fixed five-character slice and stripped the dots, so25.2.0became252. That is below the890thresholdread_fileuses to decide whether the file has a sixth standard dictionary item (annual), so every EnergyPlus 10.0+.esowas read as a pre-8.9 file:6,1,Calendar Year of Simulation[] ! When Annual Report Variables Requestedline was parsed as a variable under frequency'', soDBEsoFile.frequenciesraisedKeyError: '';!Annualoutputs failed to parse (KeyError: 6).Changes
get_eso_file_versionnow returns a(major, minor, patch)tuple (e.g.(25, 2, 0)) and compares against(8, 9, 0). It raisesInvalidLineSyntaxif the version can't be parsed. This changes the return type of this function and of the version fromprocess_statement_line, frominttotuple. Both are used only inside the reader.update_start_datesraisedIndexErrorandfind_num_of_days_annualraisedZeroDivisionError. Both now handle the empty case, and the design-day environments getn_days[A] == [].DBEsoFile.frequenciestolerate unknown keys. With the root cause fixed, aKeyErrorthere would point to a real parsing bug, and hiding it seemed worse.Tests
frequenciesfor every versioned fixture (231, 251, 252).tests/test_files/262_1ZoneUncontrolledAnnualOutputs.eso, run with EnergyPlus 26.2 fromresources/252_1ZoneUncontrolledAnnualOutputs.idf(transitioned 25.2 → 26.2, which only changes theVersionobject) and the Chicago TMY3 file inresources/. It covers annual results across a 2018–2019 run period and the two design days with no annual rows. It is force-added because.gitignoreexcludes*.eso, as with the other fixtures.pytest: 226 passed (213 before).ruff check,ruff format --checkandpylint(10.00) are clean.🤖 Generated with Claude Code