idfpy 25.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- idfpy-25.1.0/.github/workflows/publish-pypi.yml +33 -0
- idfpy-25.1.0/.github/workflows/release-version.yml +155 -0
- idfpy-25.1.0/.github/workflows/sync-energyplus.yml +218 -0
- idfpy-25.1.0/.gitignore +11 -0
- idfpy-25.1.0/.vscode/launch.json +58 -0
- idfpy-25.1.0/LICENSE +21 -0
- idfpy-25.1.0/PKG-INFO +261 -0
- idfpy-25.1.0/README.md +238 -0
- idfpy-25.1.0/benchmarks/bench_idf.py +273 -0
- idfpy-25.1.0/idfpy/__init__.py +23 -0
- idfpy-25.1.0/idfpy/__main__.py +3 -0
- idfpy-25.1.0/idfpy/cli.py +49 -0
- idfpy-25.1.0/idfpy/codegen/__init__.py +4 -0
- idfpy-25.1.0/idfpy/codegen/field_parser.py +264 -0
- idfpy-25.1.0/idfpy/codegen/model_generator.py +645 -0
- idfpy-25.1.0/idfpy/codegen/schema_parser.py +334 -0
- idfpy-25.1.0/idfpy/codegen/template_filters.py +711 -0
- idfpy-25.1.0/idfpy/codegen/templates/idf_model_py.jinja2 +104 -0
- idfpy-25.1.0/idfpy/codegen/templates/init_py.jinja2 +114 -0
- idfpy-25.1.0/idfpy/codegen/templates/ref_meta_py.jinja2 +48 -0
- idfpy-25.1.0/idfpy/codegen/templates/refs_py.jinja2 +49 -0
- idfpy-25.1.0/idfpy/ext/__init__.py +8 -0
- idfpy-25.1.0/idfpy/ext/geometry/__init__.py +14 -0
- idfpy-25.1.0/idfpy/ext/geometry/functions.py +189 -0
- idfpy-25.1.0/idfpy/ext/geometry/mixins.py +100 -0
- idfpy-25.1.0/idfpy/idf.py +1370 -0
- idfpy-25.1.0/idfpy/models/__init__.py +18487 -0
- idfpy-25.1.0/idfpy/models/_base.py +203 -0
- idfpy-25.1.0/idfpy/models/_errors.py +54 -0
- idfpy-25.1.0/idfpy/models/_metadata.py +116 -0
- idfpy-25.1.0/idfpy/models/_ref_meta.py +10060 -0
- idfpy-25.1.0/idfpy/models/_refs.py +982 -0
- idfpy-25.1.0/idfpy/models/advanced_construction.py +3950 -0
- idfpy-25.1.0/idfpy/models/air_distribution.py +711 -0
- idfpy-25.1.0/idfpy/models/availability_managers.py +784 -0
- idfpy-25.1.0/idfpy/models/coils.py +16932 -0
- idfpy-25.1.0/idfpy/models/condensers.py +2734 -0
- idfpy-25.1.0/idfpy/models/constructions.py +4644 -0
- idfpy-25.1.0/idfpy/models/curves.py +1147 -0
- idfpy-25.1.0/idfpy/models/daylighting.py +528 -0
- idfpy-25.1.0/idfpy/models/demand_limiting.py +507 -0
- idfpy-25.1.0/idfpy/models/economics.py +1417 -0
- idfpy-25.1.0/idfpy/models/electric_load.py +3673 -0
- idfpy-25.1.0/idfpy/models/ems.py +386 -0
- idfpy-25.1.0/idfpy/models/evap_coolers.py +562 -0
- idfpy-25.1.0/idfpy/models/external_interface.py +341 -0
- idfpy-25.1.0/idfpy/models/fans.py +905 -0
- idfpy-25.1.0/idfpy/models/faults.py +1165 -0
- idfpy-25.1.0/idfpy/models/fluids.py +1528 -0
- idfpy-25.1.0/idfpy/models/hvac_design.py +1120 -0
- idfpy-25.1.0/idfpy/models/hvac_templates.py +9841 -0
- idfpy-25.1.0/idfpy/models/internal_gains.py +3454 -0
- idfpy-25.1.0/idfpy/models/location.py +1666 -0
- idfpy-25.1.0/idfpy/models/misc.py +8223 -0
- idfpy-25.1.0/idfpy/models/node_branch.py +905 -0
- idfpy-25.1.0/idfpy/models/outputs.py +1733 -0
- idfpy-25.1.0/idfpy/models/plant_control.py +3620 -0
- idfpy-25.1.0/idfpy/models/plant_equipment.py +5276 -0
- idfpy-25.1.0/idfpy/models/pumps.py +750 -0
- idfpy-25.1.0/idfpy/models/python_plugins.py +236 -0
- idfpy-25.1.0/idfpy/models/refrigeration.py +2644 -0
- idfpy-25.1.0/idfpy/models/room_air.py +1315 -0
- idfpy-25.1.0/idfpy/models/schedules.py +594 -0
- idfpy-25.1.0/idfpy/models/setpoint_managers.py +1318 -0
- idfpy-25.1.0/idfpy/models/simulation.py +672 -0
- idfpy-25.1.0/idfpy/models/solar.py +711 -0
- idfpy-25.1.0/idfpy/models/thermal_zones.py +3445 -0
- idfpy-25.1.0/idfpy/models/unitary.py +2571 -0
- idfpy-25.1.0/idfpy/models/user_defined.py +749 -0
- idfpy-25.1.0/idfpy/models/water_heaters.py +2061 -0
- idfpy-25.1.0/idfpy/models/water_systems.py +548 -0
- idfpy-25.1.0/idfpy/models/zone_airflow.py +2030 -0
- idfpy-25.1.0/idfpy/models/zone_controls.py +1117 -0
- idfpy-25.1.0/idfpy/models/zone_equipment.py +580 -0
- idfpy-25.1.0/idfpy/models/zone_forced_air.py +4335 -0
- idfpy-25.1.0/idfpy/models/zone_radiative.py +2005 -0
- idfpy-25.1.0/idfpy/models/zone_terminals.py +2099 -0
- idfpy-25.1.0/idfpy/py.typed +0 -0
- idfpy-25.1.0/idfpy/sim/__init__.py +173 -0
- idfpy-25.1.0/idfpy/sim/_runner.py +189 -0
- idfpy-25.1.0/idfpy/sim/config.py +17 -0
- idfpy-25.1.0/idfpy/sim/result.py +81 -0
- idfpy-25.1.0/pyproject.toml +76 -0
- idfpy-25.1.0/tests/__init__.py +0 -0
- idfpy-25.1.0/tests/test.idf +3741 -0
- idfpy-25.1.0/tests/test_api_unification.py +246 -0
- idfpy-25.1.0/tests/test_epjson_doe.py +148 -0
- idfpy-25.1.0/tests/test_ext.py +565 -0
- idfpy-25.1.0/tests/test_merge_dict.py +407 -0
- idfpy-25.1.0/tests/test_metadata.py +77 -0
- idfpy-25.1.0/tests/test_models.py +428 -0
- idfpy-25.1.0/tests/test_ref_system.py +689 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
name: Publish to PyPI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
tag:
|
|
7
|
+
description: "Tag to publish (e.g. v25.2.0)"
|
|
8
|
+
required: true
|
|
9
|
+
type: string
|
|
10
|
+
|
|
11
|
+
permissions:
|
|
12
|
+
id-token: write
|
|
13
|
+
|
|
14
|
+
jobs:
|
|
15
|
+
publish:
|
|
16
|
+
runs-on: ubuntu-latest
|
|
17
|
+
environment: pypi
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
with:
|
|
21
|
+
ref: refs/tags/${{ inputs.tag }}
|
|
22
|
+
|
|
23
|
+
- uses: astral-sh/setup-uv@v4
|
|
24
|
+
|
|
25
|
+
- name: Build
|
|
26
|
+
run: |
|
|
27
|
+
VERSION="${{ inputs.tag }}"
|
|
28
|
+
VERSION="${VERSION#v}"
|
|
29
|
+
sed -i "s/^version = .*/version = \"${VERSION}\"/" pyproject.toml
|
|
30
|
+
uv build
|
|
31
|
+
|
|
32
|
+
- name: Publish
|
|
33
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
name: Release EnergyPlus Version
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
inputs:
|
|
6
|
+
ep_version:
|
|
7
|
+
description: "EnergyPlus version to target (e.g. 23.2.0)"
|
|
8
|
+
required: true
|
|
9
|
+
type: string
|
|
10
|
+
release_version:
|
|
11
|
+
description: "idfpy release version (PEP 440, e.g. 23.2.0 or 23.2.0.post1)"
|
|
12
|
+
required: true
|
|
13
|
+
type: string
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: write
|
|
17
|
+
id-token: write
|
|
18
|
+
|
|
19
|
+
jobs:
|
|
20
|
+
release:
|
|
21
|
+
runs-on: ubuntu-latest
|
|
22
|
+
environment: pypi
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v4
|
|
25
|
+
with:
|
|
26
|
+
ref: master
|
|
27
|
+
fetch-depth: 0
|
|
28
|
+
|
|
29
|
+
- name: Resolve EnergyPlus asset and target refs
|
|
30
|
+
id: ver
|
|
31
|
+
env:
|
|
32
|
+
GH_TOKEN: ${{ github.token }}
|
|
33
|
+
run: |
|
|
34
|
+
EP_VERSION="${{ inputs.ep_version }}"
|
|
35
|
+
RELEASE_VERSION="${{ inputs.release_version }}"
|
|
36
|
+
TAG="v${RELEASE_VERSION}"
|
|
37
|
+
BRANCH="release/ep-${EP_VERSION}"
|
|
38
|
+
|
|
39
|
+
RELEASE_JSON=$(gh api "repos/NREL/EnergyPlus/releases/tags/v${EP_VERSION}")
|
|
40
|
+
ASSET_URL=$(echo "$RELEASE_JSON" | jq -r '
|
|
41
|
+
.assets[]
|
|
42
|
+
| select(.name | test("Linux-Ubuntu24\\.04-x86_64\\.tar\\.gz$"))
|
|
43
|
+
| .browser_download_url
|
|
44
|
+
')
|
|
45
|
+
if [ -z "$ASSET_URL" ]; then
|
|
46
|
+
ASSET_URL=$(echo "$RELEASE_JSON" | jq -r '
|
|
47
|
+
.assets[]
|
|
48
|
+
| select(.name | test("Linux.*x86_64\\.tar\\.gz$"))
|
|
49
|
+
| .browser_download_url
|
|
50
|
+
' | head -1)
|
|
51
|
+
fi
|
|
52
|
+
if [ -z "$ASSET_URL" ]; then
|
|
53
|
+
echo "::error::No Linux x86_64 schema asset found for EnergyPlus ${EP_VERSION}"
|
|
54
|
+
exit 1
|
|
55
|
+
fi
|
|
56
|
+
|
|
57
|
+
{
|
|
58
|
+
echo "ep_version=$EP_VERSION"
|
|
59
|
+
echo "release_version=$RELEASE_VERSION"
|
|
60
|
+
echo "tag=$TAG"
|
|
61
|
+
echo "branch=$BRANCH"
|
|
62
|
+
echo "asset_url=$ASSET_URL"
|
|
63
|
+
} >> "$GITHUB_OUTPUT"
|
|
64
|
+
echo "EnergyPlus $EP_VERSION -> idfpy $TAG on $BRANCH"
|
|
65
|
+
|
|
66
|
+
- name: Inspect existing tag and PyPI release
|
|
67
|
+
id: check
|
|
68
|
+
run: |
|
|
69
|
+
TAG="${{ steps.ver.outputs.tag }}"
|
|
70
|
+
VERSION="${{ steps.ver.outputs.release_version }}"
|
|
71
|
+
|
|
72
|
+
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" \
|
|
73
|
+
"https://pypi.org/pypi/idfpy/${VERSION}/json")
|
|
74
|
+
if [ "$HTTP_CODE" = "200" ]; then
|
|
75
|
+
echo "::error::PyPI release idfpy==${VERSION} already exists; bump release_version"
|
|
76
|
+
exit 1
|
|
77
|
+
fi
|
|
78
|
+
|
|
79
|
+
TAG_EXISTS=false
|
|
80
|
+
if git ls-remote --exit-code --tags origin "refs/tags/$TAG" > /dev/null 2>&1; then
|
|
81
|
+
echo "::warning::Remote tag $TAG already exists; skipping git push, only re-publishing to PyPI"
|
|
82
|
+
TAG_EXISTS=true
|
|
83
|
+
fi
|
|
84
|
+
echo "tag_exists=$TAG_EXISTS" >> "$GITHUB_OUTPUT"
|
|
85
|
+
|
|
86
|
+
- name: Checkout existing tag for re-publish
|
|
87
|
+
if: steps.check.outputs.tag_exists == 'true'
|
|
88
|
+
run: |
|
|
89
|
+
TAG="${{ steps.ver.outputs.tag }}"
|
|
90
|
+
git fetch --tags origin "refs/tags/$TAG"
|
|
91
|
+
git checkout "tags/$TAG"
|
|
92
|
+
|
|
93
|
+
- name: Download schema
|
|
94
|
+
if: steps.check.outputs.tag_exists == 'false'
|
|
95
|
+
run: |
|
|
96
|
+
curl -fL -o ep.tar.gz "${{ steps.ver.outputs.asset_url }}"
|
|
97
|
+
tar -xzf ep.tar.gz --wildcards '*/Energy+.schema.epJSON' --strip-components=1
|
|
98
|
+
rm ep.tar.gz
|
|
99
|
+
ls -lh 'Energy+.schema.epJSON'
|
|
100
|
+
|
|
101
|
+
- uses: astral-sh/setup-uv@v4
|
|
102
|
+
|
|
103
|
+
- name: Generate models
|
|
104
|
+
if: steps.check.outputs.tag_exists == 'false'
|
|
105
|
+
run: |
|
|
106
|
+
uv sync --all-groups
|
|
107
|
+
uv run idfpy codegen --schema 'Energy+.schema.epJSON' --output idfpy/models
|
|
108
|
+
uv run ruff check --fix .
|
|
109
|
+
uv run ruff format .
|
|
110
|
+
uv run ty check .
|
|
111
|
+
rm 'Energy+.schema.epJSON'
|
|
112
|
+
|
|
113
|
+
- name: Run tests
|
|
114
|
+
if: steps.check.outputs.tag_exists == 'false'
|
|
115
|
+
run: uv run pytest tests/ -v
|
|
116
|
+
|
|
117
|
+
- name: Set package version
|
|
118
|
+
if: steps.check.outputs.tag_exists == 'false'
|
|
119
|
+
run: |
|
|
120
|
+
VERSION="${{ steps.ver.outputs.release_version }}"
|
|
121
|
+
sed -i "s/^version = .*/version = \"${VERSION}\"/" pyproject.toml
|
|
122
|
+
|
|
123
|
+
- name: Push release branch and tag
|
|
124
|
+
if: steps.check.outputs.tag_exists == 'false'
|
|
125
|
+
run: |
|
|
126
|
+
EP_VERSION="${{ steps.ver.outputs.ep_version }}"
|
|
127
|
+
TAG="${{ steps.ver.outputs.tag }}"
|
|
128
|
+
BRANCH="${{ steps.ver.outputs.branch }}"
|
|
129
|
+
|
|
130
|
+
git config user.name "github-actions[bot]"
|
|
131
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
132
|
+
|
|
133
|
+
# Capture codegen + version bump before switching branch
|
|
134
|
+
git stash push --include-untracked -m "release-${TAG}"
|
|
135
|
+
|
|
136
|
+
# Always rebuild the EP support branch on top of current master
|
|
137
|
+
if git ls-remote --exit-code --heads origin "$BRANCH" > /dev/null; then
|
|
138
|
+
git fetch origin "$BRANCH"
|
|
139
|
+
fi
|
|
140
|
+
git switch -C "$BRANCH" origin/master
|
|
141
|
+
|
|
142
|
+
git stash pop
|
|
143
|
+
|
|
144
|
+
git add -A
|
|
145
|
+
git commit -m "feat(models): release ${TAG} for EnergyPlus ${EP_VERSION}"
|
|
146
|
+
git tag -a "$TAG" -m "idfpy ${TAG} (EnergyPlus ${EP_VERSION})"
|
|
147
|
+
|
|
148
|
+
git push origin "$BRANCH" --force-with-lease
|
|
149
|
+
git push origin "$TAG"
|
|
150
|
+
|
|
151
|
+
- name: Build distribution
|
|
152
|
+
run: uv build
|
|
153
|
+
|
|
154
|
+
- name: Publish to PyPI
|
|
155
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
name: Sync EnergyPlus
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
schedule:
|
|
5
|
+
- cron: "0 6 * * 1" # Weekly Monday 06:00 UTC
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: write
|
|
10
|
+
pull-requests: write
|
|
11
|
+
id-token: write
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
sync:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
environment: pypi
|
|
17
|
+
steps:
|
|
18
|
+
- uses: actions/checkout@v4
|
|
19
|
+
with:
|
|
20
|
+
ref: master
|
|
21
|
+
fetch-depth: 0
|
|
22
|
+
|
|
23
|
+
- name: Detect latest EnergyPlus release
|
|
24
|
+
id: ep
|
|
25
|
+
env:
|
|
26
|
+
GH_TOKEN: ${{ github.token }}
|
|
27
|
+
run: |
|
|
28
|
+
RELEASE_JSON=$(gh api repos/NREL/EnergyPlus/releases/latest)
|
|
29
|
+
TAG=$(echo "$RELEASE_JSON" | jq -r '.tag_name')
|
|
30
|
+
VERSION=${TAG#v}
|
|
31
|
+
ASSET_URL=$(echo "$RELEASE_JSON" | jq -r '
|
|
32
|
+
.assets[]
|
|
33
|
+
| select(.name | test("Linux-Ubuntu24\\.04-x86_64\\.tar\\.gz$"))
|
|
34
|
+
| .browser_download_url
|
|
35
|
+
')
|
|
36
|
+
if [ -z "$ASSET_URL" ]; then
|
|
37
|
+
ASSET_URL=$(echo "$RELEASE_JSON" | jq -r '
|
|
38
|
+
.assets[]
|
|
39
|
+
| select(.name | test("Linux.*x86_64\\.tar\\.gz$"))
|
|
40
|
+
| .browser_download_url
|
|
41
|
+
' | head -1)
|
|
42
|
+
fi
|
|
43
|
+
{
|
|
44
|
+
echo "version=$VERSION"
|
|
45
|
+
echo "asset_url=$ASSET_URL"
|
|
46
|
+
} >> "$GITHUB_OUTPUT"
|
|
47
|
+
echo "EnergyPlus $VERSION -> $ASSET_URL"
|
|
48
|
+
|
|
49
|
+
- name: Skip if version already released
|
|
50
|
+
id: check
|
|
51
|
+
run: |
|
|
52
|
+
VERSION="${{ steps.ep.outputs.version }}"
|
|
53
|
+
TAG="v${VERSION}"
|
|
54
|
+
|
|
55
|
+
TAG_EXISTS=false
|
|
56
|
+
if git ls-remote --exit-code --tags origin "refs/tags/$TAG" > /dev/null 2>&1; then
|
|
57
|
+
TAG_EXISTS=true
|
|
58
|
+
fi
|
|
59
|
+
|
|
60
|
+
PYPI_EXISTS=false
|
|
61
|
+
HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" \
|
|
62
|
+
"https://pypi.org/pypi/idfpy/${VERSION}/json")
|
|
63
|
+
if [ "$HTTP_CODE" = "200" ]; then
|
|
64
|
+
PYPI_EXISTS=true
|
|
65
|
+
fi
|
|
66
|
+
|
|
67
|
+
SKIP=false
|
|
68
|
+
if [ "$TAG_EXISTS" = "true" ] && [ "$PYPI_EXISTS" = "true" ]; then
|
|
69
|
+
echo "Tag $TAG and PyPI ${VERSION} both already exist; skipping"
|
|
70
|
+
SKIP=true
|
|
71
|
+
elif [ "$TAG_EXISTS" = "true" ]; then
|
|
72
|
+
echo "::error::Tag $TAG already exists but PyPI ${VERSION} is missing; refusing to proceed"
|
|
73
|
+
exit 1
|
|
74
|
+
elif [ "$PYPI_EXISTS" = "true" ]; then
|
|
75
|
+
echo "::error::PyPI ${VERSION} already exists but tag $TAG is missing; refusing to proceed"
|
|
76
|
+
exit 1
|
|
77
|
+
fi
|
|
78
|
+
|
|
79
|
+
echo "skip=$SKIP" >> "$GITHUB_OUTPUT"
|
|
80
|
+
|
|
81
|
+
- name: Download schema
|
|
82
|
+
if: steps.check.outputs.skip == 'false'
|
|
83
|
+
run: |
|
|
84
|
+
curl -fL -o ep.tar.gz "${{ steps.ep.outputs.asset_url }}"
|
|
85
|
+
tar -xzf ep.tar.gz --wildcards '*/Energy+.schema.epJSON' --strip-components=1
|
|
86
|
+
rm ep.tar.gz
|
|
87
|
+
ls -lh 'Energy+.schema.epJSON'
|
|
88
|
+
|
|
89
|
+
- uses: astral-sh/setup-uv@v4
|
|
90
|
+
if: steps.check.outputs.skip == 'false'
|
|
91
|
+
|
|
92
|
+
- name: Generate models
|
|
93
|
+
if: steps.check.outputs.skip == 'false'
|
|
94
|
+
run: |
|
|
95
|
+
uv sync --all-groups
|
|
96
|
+
uv run idfpy codegen --schema 'Energy+.schema.epJSON' --output idfpy/models
|
|
97
|
+
uv run ruff check --fix .
|
|
98
|
+
uv run ruff format .
|
|
99
|
+
uv run ty check .
|
|
100
|
+
rm 'Energy+.schema.epJSON'
|
|
101
|
+
|
|
102
|
+
- name: Run tests
|
|
103
|
+
if: steps.check.outputs.skip == 'false'
|
|
104
|
+
run: uv run pytest tests/ -v
|
|
105
|
+
|
|
106
|
+
- name: Update version metadata
|
|
107
|
+
if: steps.check.outputs.skip == 'false'
|
|
108
|
+
run: |
|
|
109
|
+
EP_VERSION="${{ steps.ep.outputs.version }}"
|
|
110
|
+
MAJOR_MINOR="${EP_VERSION%.*}"
|
|
111
|
+
|
|
112
|
+
OBJ_COUNT=$(grep -rh '_idf_object_type: ClassVar' idfpy/models/*.py \
|
|
113
|
+
| grep -cv '_base.py')
|
|
114
|
+
REF_COUNT=$(grep -c 'Ref = Annotated' idfpy/models/_refs.py)
|
|
115
|
+
PROP_COUNT=$(grep -rh '^ @property$' idfpy/models/*.py \
|
|
116
|
+
| grep -cv '_base.py')
|
|
117
|
+
|
|
118
|
+
sed -i "s/^version = .*/version = \"${EP_VERSION}\"/" pyproject.toml
|
|
119
|
+
|
|
120
|
+
# README badge: URL slug + alt text
|
|
121
|
+
sed -Ei "s|EnergyPlus-[0-9.]+-orange|EnergyPlus-${MAJOR_MINOR}-orange|" README.md
|
|
122
|
+
sed -Ei "s|\[!\[EnergyPlus [0-9.]+\]|[![EnergyPlus ${MAJOR_MINOR}]|" README.md
|
|
123
|
+
|
|
124
|
+
# Autoupdate badge: workflow filename (belt-and-braces; primary update is manual)
|
|
125
|
+
sed -Ei "s|update-models\.yml|sync-energyplus.yml|g" README.md
|
|
126
|
+
|
|
127
|
+
# Auto-generated schema version line
|
|
128
|
+
sed -Ei "s|version \*\*[0-9.]+\*\*|version **${EP_VERSION}**|" README.md
|
|
129
|
+
|
|
130
|
+
# Feature list counts + comparison table
|
|
131
|
+
sed -Ei "s|\*\*[0-9]+\+? object types\*\*|**${OBJ_COUNT} object types**|" README.md
|
|
132
|
+
sed -Ei "s|\*\*[0-9]+ reference types\*\*|**${REF_COUNT} reference types**|" README.md
|
|
133
|
+
sed -Ei "s|✅ [0-9]+ ref groups|✅ ${REF_COUNT} ref groups|" README.md
|
|
134
|
+
sed -Ei "s|✅ [0-9]+ properties|✅ ${PROP_COUNT} properties|" README.md
|
|
135
|
+
|
|
136
|
+
- name: Publish to latest branch and tag
|
|
137
|
+
id: push
|
|
138
|
+
if: steps.check.outputs.skip == 'false'
|
|
139
|
+
run: |
|
|
140
|
+
EP_VERSION="${{ steps.ep.outputs.version }}"
|
|
141
|
+
|
|
142
|
+
git config user.name "github-actions[bot]"
|
|
143
|
+
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
144
|
+
|
|
145
|
+
# Capture codegen + metadata changes before switching branch
|
|
146
|
+
git stash push --include-untracked -m "sync-${EP_VERSION}"
|
|
147
|
+
|
|
148
|
+
# Rebase latest on top of current master, then re-apply the stash
|
|
149
|
+
if git ls-remote --exit-code --heads origin latest > /dev/null; then
|
|
150
|
+
git fetch origin latest
|
|
151
|
+
git switch -C latest origin/master
|
|
152
|
+
else
|
|
153
|
+
git switch -C latest
|
|
154
|
+
fi
|
|
155
|
+
|
|
156
|
+
git stash pop
|
|
157
|
+
|
|
158
|
+
git add -A
|
|
159
|
+
if git diff --cached --quiet; then
|
|
160
|
+
echo "No changes to publish"
|
|
161
|
+
echo "updated=false" >> "$GITHUB_OUTPUT"
|
|
162
|
+
exit 0
|
|
163
|
+
fi
|
|
164
|
+
|
|
165
|
+
git commit -m "feat(models): sync to EnergyPlus ${EP_VERSION}"
|
|
166
|
+
git tag -a "v${EP_VERSION}" -m "EnergyPlus ${EP_VERSION} models"
|
|
167
|
+
|
|
168
|
+
git push origin latest --force-with-lease
|
|
169
|
+
git push origin "v${EP_VERSION}"
|
|
170
|
+
|
|
171
|
+
echo "updated=true" >> "$GITHUB_OUTPUT"
|
|
172
|
+
|
|
173
|
+
- name: Build distribution
|
|
174
|
+
if: steps.push.outputs.updated == 'true'
|
|
175
|
+
run: uv build
|
|
176
|
+
|
|
177
|
+
- name: Publish to PyPI
|
|
178
|
+
if: steps.push.outputs.updated == 'true'
|
|
179
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
180
|
+
|
|
181
|
+
- name: Open PR to sync README to master
|
|
182
|
+
if: steps.push.outputs.updated == 'true'
|
|
183
|
+
env:
|
|
184
|
+
GH_TOKEN: ${{ github.token }}
|
|
185
|
+
run: |
|
|
186
|
+
EP_VERSION="${{ steps.ep.outputs.version }}"
|
|
187
|
+
BRANCH="chore/sync-readme"
|
|
188
|
+
TITLE="docs: sync README for EnergyPlus ${EP_VERSION}"
|
|
189
|
+
|
|
190
|
+
# README on latest (HEAD) already has the sed-updated content
|
|
191
|
+
cp README.md /tmp/README.new
|
|
192
|
+
|
|
193
|
+
git fetch origin master
|
|
194
|
+
git switch -C "$BRANCH" origin/master
|
|
195
|
+
cp /tmp/README.new README.md
|
|
196
|
+
|
|
197
|
+
if git diff --quiet; then
|
|
198
|
+
echo "README already in sync with master, nothing to PR"
|
|
199
|
+
exit 0
|
|
200
|
+
fi
|
|
201
|
+
|
|
202
|
+
git add README.md
|
|
203
|
+
git commit -m "$TITLE"
|
|
204
|
+
git push -f origin "$BRANCH"
|
|
205
|
+
|
|
206
|
+
BODY=$(cat <<EOF
|
|
207
|
+
Auto-generated by the \`Sync EnergyPlus\` workflow.
|
|
208
|
+
|
|
209
|
+
Updates README badges, version line, and counts to match EnergyPlus ${EP_VERSION}.
|
|
210
|
+
Only \`README.md\` is touched — models and codegen products stay on the \`latest\` branch.
|
|
211
|
+
EOF
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
if PR_NUM=$(gh pr view "$BRANCH" --json number -q .number 2>/dev/null); then
|
|
215
|
+
gh pr edit "$PR_NUM" --title "$TITLE" --body "$BODY"
|
|
216
|
+
else
|
|
217
|
+
gh pr create --base master --head "$BRANCH" --title "$TITLE" --body "$BODY"
|
|
218
|
+
fi
|
idfpy-25.1.0/.gitignore
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
// 使用 IntelliSense 了解相关属性。
|
|
3
|
+
// 悬停以查看现有属性的描述。
|
|
4
|
+
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
|
|
5
|
+
"version": "0.2.0",
|
|
6
|
+
"configurations": [
|
|
7
|
+
{
|
|
8
|
+
"name": "save and load idf",
|
|
9
|
+
"type": "debugpy",
|
|
10
|
+
"request": "launch",
|
|
11
|
+
"module": "pytest",
|
|
12
|
+
"console": "integratedTerminal",
|
|
13
|
+
"args": [
|
|
14
|
+
"tests/test_models.py::test_actual_idf_file",
|
|
15
|
+
"-s",
|
|
16
|
+
"--no-header"
|
|
17
|
+
],
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"name": "codegen",
|
|
21
|
+
"type": "debugpy",
|
|
22
|
+
"request": "launch",
|
|
23
|
+
"module": "idfpy",
|
|
24
|
+
"console": "integratedTerminal",
|
|
25
|
+
"args": [
|
|
26
|
+
"codegen",
|
|
27
|
+
"--schema",
|
|
28
|
+
"Energy+.schema.epJSON",
|
|
29
|
+
"--output",
|
|
30
|
+
"${workspaceFolder}/idfpy/models"
|
|
31
|
+
],
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"name": "temp test",
|
|
35
|
+
"type": "debugpy",
|
|
36
|
+
"request": "launch",
|
|
37
|
+
"module": "pytest",
|
|
38
|
+
"console": "integratedTerminal",
|
|
39
|
+
"args": [
|
|
40
|
+
"tests/test_models.py::test_to_dict_preserves_empty_string_name",
|
|
41
|
+
"-s",
|
|
42
|
+
"--no-header"
|
|
43
|
+
],
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"name": "All test",
|
|
47
|
+
"type": "debugpy",
|
|
48
|
+
"request": "launch",
|
|
49
|
+
"module": "pytest",
|
|
50
|
+
"console": "integratedTerminal",
|
|
51
|
+
"args": [
|
|
52
|
+
"tests",
|
|
53
|
+
"-s",
|
|
54
|
+
"--no-header"
|
|
55
|
+
],
|
|
56
|
+
},
|
|
57
|
+
]
|
|
58
|
+
}
|
idfpy-25.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 ITOTI-Y
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|