Repository navigation
Move the OG-CLEWS linker into MUIOGO - #550
Open
marcelolafleur wants to merge 10 commits into
Open
marcelolafleur wants to merge 10 commits into
marcelolafleur wants to merge 10 commits into
Conversation
MUIOGO now requires Python 3.11 or 3.12. Python 3.10 reaches end of life in October 2026, and nothing in MUIOGO needs it. The installers no longer take whatever Python happens to be on the machine: a .python-version file makes uv build every environment on 3.12. The startup check, the setup scripts, the docs and CI all follow the new range, and CI now tests on 3.12. The lockfile drops only the 3.10 downloads; no package version changes.
With 3.11 as the minimum, the linter targets 3.11 and asks for the shorter datetime.UTC in place of datetime.timezone.utc. They are the same value, so behaviour does not change.
MUIOGO becomes the home of the linker that couples CLEWS results into OG-Core country models. This copies the current linker from the ogclews-link research repository (branch experiment/v18-gold-coupled, commit ee92c9b), renamed from ogclews_link to oglink, with its tests, the IHME burden data it needs for the health channel, and its data notes. Two modules stay behind in ogclews-link: the old reverse-pass driver, which wrote into MUIOGO's case storage directly and is replaced by MUIOGO's applyPatch endpoint, and the environment-accounts module, which nothing uses. The package keeps its own environment. Nothing is wired into MUIOGO yet.
The steady state now always uses the country calibration's own root method, which is OG-Core's standard method. Anderson stays where the calibration puts it: the transition path. This removes the switch that could force Anderson onto the steady state, which crashed the 8-industry Philippines baseline, and adds a test so the override cannot come back unnoticed.
Two improvements from EAPD-DRB#537. The linker now reads each CLEWS result table by its exact name, so a similar table (for example the discounted version of a cost) can never be read by mistake when the intended one is missing. And if the industry weights behind the cost-push leg cannot be computed, the run's record now says so instead of quietly giving a smaller result. The exact-name reader broke the marginal-price reader, which looked up the dual file by its short code. It now uses the file's full name, as MUIOGO writes it; the price series read from the Philippines GOLD runs is unchanged. Adds EAPD-DRB#537's 16 tests for the price, industry-weight, reader and wedge logic. Co-authored-by: Aditya Kushwaha <72969747+Adityakushwaha2006@users.noreply.github.com>
The post-run hook and the /oglink/status check now use the linker in this repository, from its own environment at oglink/.venv, instead of looking for a separate ogclews-link install. The overrides are now OGLINK_PYTHON and OGLINK_HOME, matching the linker's own settings. The linker, in turn, now finds the MUIOGO checkout it lives in, so it sees MUIOGO's cases and installed OG models without any configuration.
Adds a CI job that installs the linker in its own Python 3.12 environment and runs its tests. The README explains how to build that environment, how MUIOGO uses it, and how to run it by hand. uv.lock pins the linker's environment.
MUIOGO shows results with its own chart and table libraries, so the linker no longer draws figures. It writes the results as data (the macro table, the results file and the run record) for MUIOGO to display. This removes the figure deck and what existed only for it: the step that built it after each run, the --no-figures option, the copy of CLEWS files into each run folder, and matplotlib. The deck stays in the ogclews-link research repository. Charting coupled results in MUIOGO comes in a later change.
The linker no longer needs its own environment. Its only extra need, scipy (for the health channel's age profile), is now a MUIOGO dependency, so every MUIOGO install can run it with nothing more to set up. scipy 1.17.1 is the newest release that works with MUIOGO's numpy 1.26.4, and it also works with numpy 2, so the planned numpy upgrade will not need to change it. The post-run hook starts the linker as a separate process with MUIOGO's own Python, from the oglink folder; the web app still never imports it. The status check now says plainly when the linker cannot run, for example when an older MUIOGO environment has not been updated with scipy yet. The linker's separate build file, lockfile and environment settings are removed.
The linker's tests now run in the same job and environment as MUIOGO's own tests, right after them, instead of in a separate job with its own Python.
This was referenced Sep 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #549 (Python 3.11 and 3.12). Please merge that first. Until then this PR also shows #549's two commits.
MUIOGO becomes the home of the OG-CLEWS linker, the code that takes a solved CLEWS case into an OG-Core country model. It was developed in the ogclews-link research repository, and MUIOGO's post-run hook called it from there. This brings the current version in as the
oglinkfolder, and new work on the linker happens here from now on.How it runs
GET /oglink/statusnow says plainly when the linker can't run, for example when an older MUIOGO environment hasn't picked up scipy yet.What changed on the way in
MUIOGO side
Checked
/oglink/status?deep=1finds the linker and all installed OG models.This replaces #537. #539, the reverse pass, can be rebased on top of this. Part of #538.
@autibet could you review this one?