Skip to content

Support multiple BACI releases in the CEPII source - #544

Draft
Wegatriespython wants to merge 1 commit into
project/oscefrom
project/osce-baci
Draft

Support multiple BACI releases in the CEPII source#544
Wegatriespython wants to merge 1 commit into
project/oscefrom
project/osce-baci

Conversation

@Wegatriespython

@Wegatriespython Wegatriespython commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

This is a draft PR which builds on #543, to extend support for newer BACI releases

Further extensions might be added here related to BACI data workflow as the project evolves.

PR checklist

  • Add or expand tests; coverage checks both ✅
  • Add, expand, or update documentation.
    - [ ] Update doc/whatsnew.

@Wegatriespython
Wegatriespython marked this pull request as draft August 20, 2026 14:28
The source was fixed to the 202501 release, named in the pooch registry and in
the class docstring, which carried "test with additional releases" as a todo.

Add ARCHIVE, mapping a release to its archive, and Options.release, defaulting
to the earliest supported so existing results do not move. Selecting data files
now matches the release as well as the prefix: releases extract to a shared
directory, so without it a second extracted release would be read alongside the
first.

fetch() gains an optional filename, required only where a registry holds more
than one entry, which replaces the NotImplementedError it raised there. This is
additive: existing callers pass no filename and every other registry has one
entry, so only the path that previously raised behaves differently.

Add load_data(), a plain-DataFrame entry point for consumers that use pandas
and have no Computer, alongside the existing genno path. It resolves reporter
codes to alpha-3 and raises on an unmapped code rather than dropping those
observations. get_mapping() now builds on the same private mapping, in which
the hand-listed codes take precedence over the ISO 3166-1 values.
@codecov

codecov Bot commented Aug 20, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 74.6%. Comparing base (2da1998) to head (8e85884).

Files with missing lines Patch % Lines
message_ix_models/tools/cepii.py 93.7% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           project/osce    #544   +/-   ##
============================================
  Coverage          74.5%   74.6%           
============================================
  Files               327     327           
  Lines             26132   26188   +56     
============================================
+ Hits              19488   19542   +54     
- Misses             6644    6646    +2     
Files with missing lines Coverage Δ
message_ix_models/tests/tools/test_cepii.py 100.0% <100.0%> (ø)
message_ix_models/util/pooch.py 79.1% <100.0%> (+2.9%) ⬆️
message_ix_models/tools/cepii.py 98.4% <93.7%> (-1.6%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant