Skip to content

Commit d54db05

Browse files
mbaronnetclaude
andauthored
Fix CI: pin GAMS 53.5.1 + robust pTransferLimit season check (#125)
* fix: only check existing zone pairs in pTransferLimit season validation The seasonal-coverage check in _check_transfer_limits grouped pTransferLimit records with observed=False. Once the GAMS Python API began returning the z/z2 columns as categorical dtype (recent gams/gams image), observed=False started enumerating the full cartesian product of zones, creating empty phantom groups for pairs that have no transfer limit. Those empty groups were flagged as missing all seasons, failing CI on unchanged data. Use observed=True so only zone pairs actually present in pTransferLimit are validated. Real incomplete pairs are still caught. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * ci: pin GAMS image to 53.5.1 (last known-good) GAMS 54.1.0 changed gams-transfer to return categorical dtypes, which broke the pipeline in multiple places (phantom groupby groups in input_verification, UNDF values in input_treatment generic defaults). Pin to 53.5.1 — the version that was green on June 3 — to restore CI. Revisit 54.x compatibility separately. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * docs: note GAMS 53.x requirement / 54.x unsupported (refs #126) Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 5e2fd20 commit d54db05

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

.github/workflows/gams_workflow.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,10 @@ jobs:
1010
build:
1111
runs-on: ubuntu-latest
1212
container:
13-
image: gams/gams:latest
13+
# Pinned: GAMS 54.x returns gams-transfer records with categorical dtypes,
14+
# which broke input verification/treatment (phantom groupby groups, UNDF
15+
# values). Last known-good is 53.5.1. Re-evaluate before moving to :latest.
16+
image: gams/gams:53.5.1
1417

1518
steps:
1619
- name: Check out repository

README.MD

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ Install EPM and choose how you want to run it:
6969

7070
Full installation instructions are available [here](https://esmap-world-bank-group.github.io/EPM/run/run_installation/).
7171

72+
> **GAMS version:** EPM is tested on **GAMS 53.x** (CI pinned to 53.5.1). **GAMS 54.x is not yet supported** — it changes data types returned by `gams-transfer` and breaks input processing. Please use GAMS < 54 for now. Tracking: [#126](https://github.com/ESMAP-World-Bank-Group/EPM/issues/126).
73+
7274
---
7375

7476
## Works deploying EPM

epm/input_verification.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -656,7 +656,7 @@ def _check_transfer_limits(gams, db):
656656
seasons = set(p_hours_records["q"].unique())
657657
season_issues = []
658658

659-
for (z, z2), group in records.groupby(["z", "z2"], observed=False):
659+
for (z, z2), group in records.groupby(["z", "z2"], observed=True):
660660
unique_seasons = set(group["q"].unique())
661661
missing_seasons = seasons - unique_seasons
662662
if missing_seasons:

0 commit comments

Comments
 (0)