Versions¶
Constants and utilities for working with EnergyPlus version numbers. idfkit bundles schemas for every release from v8.9 through v26.1.
EnergyPlus version registry.
Defines all supported EnergyPlus versions since v8.9 (the first to publish epJSON schema) and provides utilities for version manipulation.
ENERGYPLUS_VERSIONS = ((8, 9, 0), (9, 0, 1), (9, 1, 0), (9, 2, 0), (9, 3, 0), (9, 4, 0), (9, 5, 0), (9, 6, 0), (22, 1, 0), (22, 2, 0), (23, 1, 0), (23, 2, 0), (24, 1, 0), (24, 2, 0), (25, 1, 0), (25, 2, 0), (26, 1, 0), (26, 2, 0))
module-attribute
¶
LATEST_VERSION = ENERGYPLUS_VERSIONS[-1]
module-attribute
¶
MINIMUM_VERSION = ENERGYPLUS_VERSIONS[0]
module-attribute
¶
find_closest_version(version)
¶
Find the supported version to use for a version read from a file.
A release line is matched before a version number is. An IDF file writes its
version with two components, Version, 9.0;, which arrives here as
(9, 0, 0), so an exact match fails on the patch component for any release
whose patch is not zero. Matching on major and minor first, and taking the
highest patch in that line, is what makes a two-component header resolve to
the release it names.
Crossing a minor boundary is not a fallback, it is a different EnergyPlus
release. Ten object types reorder their fields between 8.9.0 and 9.0.1 alone,
RunPeriod and GlazedDoor among them, and IDF is positional: reading a
9.0 file against the 8.9.0 schema does not fail, it loads begin_year into
end_month and succeeds against a corrupted model. Only a version newer
than every supported release degrades to the newest one, which is a forward
tolerance the compatibility checker relies on and which never silently
reinterprets a release that exists.
Returns:
| Type | Description |
|---|---|
tuple[int, int, int] | None
|
The supported version to use, or None if no suitable version exists. |
Examples:
>>> find_closest_version((24, 1, 5))
(24, 1, 0)
>>> find_closest_version((9, 0, 0))
(9, 0, 1)
>>> find_closest_version((1, 0, 0)) is None
True
>>> find_closest_version((10, 0, 0)) is None
True
Source code in idfkit/versions.py
github_release_tag(version)
¶
Return the GitHub release tag for a version.
Examples:
Source code in idfkit/versions.py
is_supported_version(version)
¶
version_dirname(version)
¶
Return the schema directory name for a version.
Examples:
Source code in idfkit/versions.py
version_string(version)
¶
Format a version tuple as a human-readable string.
Examples: