Description
Title:
Test failures in PR #326: "No source found that can handle 'ICONICS:SSP(2024).1'" (Commit f886d2d)
Description:
After merging PR #326 (specifically commit f886d2d9a4f96b3d9ad844ac216b531c25a2c47b
), tests in both test_gdp.py
and test_projections.py
started failing. The core issue in both files appears to be the inability to handle the source identifier 'ICONICS:SSP(2024).1'
, resulting in the following error:
ValueError: No source found that can handle 'ICONICS:SSP(2024).1'
Failure Details (test_projections.py
):
Running pytest message_ix_models/tests/tools/costs/test_projections.py
results in:
- 7 Failed Tests:
test_create_cost_projections[config0-exp_fix0-exp_inv0]
(SSP2, R11)test_create_cost_projections[config2-exp_fix2-exp_inv2]
(SSP5, R12, cooling)test_bare_res[R11]
test_bare_res[R12]
test_ccs_costs[energy]
test_ccs_costs[materials]
test_ccs_costs[cooling]
- 2 XFailed Tests (Expected Failures):
test_create_cost_projections
withConfig(node="R20")
test_bare_res[R20]
- 1 Passed Test:
test_create_cost_projections[config1-exp_fix1-exp_inv1]
(SSP2, materials, convergence) - Note: This test seems unaffected as it uses the 'convergence' method, not 'gdp'.
Failure Details (test_gdp.py
):
Running pytest message_ix_models/tests/tools/costs/test_gdp.py
results in all 5 tests failing with the same ValueError
.
Failure Trace (Common to both files):
The error originates when calling prepare_computer
from within process_raw_ssp_data
:
..\..\..\tools\costs\gdp.py:74: in process_raw_ssp_data
key, *_ = prepare_computer(context, c, ssp, source_kw, strict=False)
.\..\..\tools\exo_data.py:231:
context = <Context object ...>, c = <genno.core.computer.Computer object ...>
source = 'ICONICS:SSP(2024).1', source_kw = {'measure': 'POP', 'model': 'IIASA-WiC POP 2023', 'name': '_pop 1'}
# ... (code for prepare_computer) ...
if source_obj is None:
> raise ValueError(f"No source found that can handle {source!r}")
E ValueError: No source found that can handle 'ICONICS:SSP(2024).1'
..\..\..\tools\exo_data.py:231: ValueError
Context:
When resetting main
to the commit before the problematic one (e.g., git reset --hard dadf8d891
), the tests in both files pass again.
git bisect
identified the first bad commit as:
f886d2d9a4f96b3d9ad844ac216b531c25a2c47b is the first bad commit
commit f886d2d9a4f96b3d9ad844ac216b531c25a2c47b
Author: Paul Natsuo Kishimoto <[email protected]>
Date: Fri Apr 4 11:16:11 2025 +0200
Simplify path handling in SSP{Original,Update}
Use path_fallback() in both methods with common arguments.
message_ix_models/project/ssp/data.py | 60 ++++++++++++++---------------------
1 file changed, 23 insertions(+), 37 deletions(-)
This commit simplified path handling in message_ix_models/project/ssp/data.py
, which seems linked to this regression.
Reproduction:
- Check out commit
f886d2d9a4f96b3d9ad844ac216b531c25a2c47b
or any later commit onmain
. - Run the tests:
pytest message_ix_models/tests/tools/costs/test_gdp.py pytest message_ix_models/tests/tools/costs/test_projections.py
- Observe the failures detailed above.
Environment:
- OS: Windows
- Python: 3.13.2
- Test framework: pytest-8.3.5