Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## [4.18.17RC] - 2026-06-03 Unreleased in PyPI

- [CHANGED] update the architecture diagram (`doc/img/openTEPES_architecture.svg`) so it matches the code. The old picture used the planned folder names (`io/`, `schema.py`, `solver/`, `solve.py`); it now shows the real flat module names (`openTEPES_InputSchema.py`, `openTEPES_ProblemSolving.py`, and so on), with the five real solver modules. Implemented modules are shaded green and planned ones are left white, with a small legend. Also commit a rendered `doc/img/openTEPES_architecture.png` and point the `README.md` at the PNG instead of the SVG, so the diagram shows on pages that do not display SVG (such as the PyPI project page). Added a short `doc/img/README.md` explaining the SVG is the hand-drawn source (there is no generator script), that the PNG is rendered from it, and how to regenerate the PNG on Windows, macOS and Linux.
- [FIXED] a binary investment problem (for example `IndBinNetInvest=1`) crashed under the HiGHS solver with `NoDualsError` on the first solve. `ProblemSolving` attaches the `dual` Suffix before the first solve only for a pure-LP model, because a mixed-integer problem has no duals; it then recovers the duals later by fixing the integer variables and re-solving as an LP. The check that decided "is this a pure LP" also required each variable to already have a value, but before the first solve no variable has a value yet, so a model with binary *investment* variables was wrongly treated as an LP, got the Suffix, and crashed when HiGHS was asked for duals it does not have. The check now looks only at whether a variable is integer/binary and unfixed, not at its value. Unit-commitment models did not hit this because their binary variables are given starting values. No change for any model that already worked.
- [ADDED] a test (`test_binary_investment` in `tests/test_run.py`) for a binary (integer) investment decision, which no other test covered — every other case solves the investment variables as a continuous relaxation. It switches on `IndBinNetInvest` for the `9n` case so the single candidate line becomes a {0,1} build-or-not decision; the cost (254.337 MEUR) differs from the continuous result (252.201 MEUR) because the binary decision forces a full line build. The test also guards the fix above. A companion fixture `case_7d_binary` runs the case from a private temporary copy (so its solver log files do not clash with the other 9n tests on Windows, where a log file can stay open after a solve), applies the 7-day truncation, and overrides one or more columns of the Option file.
- [CHANGED] split the CI workflow (`.github/workflows/ci.yml`) into two jobs to save time. A `fast` job runs the linter and the tests that do not solve a model, on all three operating systems and all three Python versions (3.11, 3.12, 3.13) — this is where import, packaging and Python-version problems show up. A `solve` job runs the full model test suite (every case, the multi-stage case, and Benders) once per operating system on Python 3.12, since the model results are the same on every Python version. Tests that solve a model are now marked with `@pytest.mark.solve` (registered in `pyproject.toml`); the `fast` job runs `-m "not solve"` and the `solve` job runs `-m solve`. Also added a per-test timeout on the solve job so a stuck solver fails quickly instead of using up the whole job, and turned on dependency caching for `uv`. No test was removed; the same tests still run, just spread across the two jobs.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ It has been used by the **Ministry for the Ecological Transition and the Demogra

The package is organised in six layers, from input/output (pure pandas, no Pyomo) up to result aggregation. Each module encodes its layer in the file name alongside the other `openTEPES_*.py` modules at the package root — `openTEPES_Input*` for the input-source layer (`openTEPES_InputSchema`, `openTEPES_InputSource`, `openTEPES_InputCSVSource`, `openTEPES_InputDuckDBSource`) and `openTEPES_ProblemSolving*` for the solver layer (`openTEPES_ProblemSolving`, `openTEPES_ProblemSolvingBenders`, `openTEPES_ProblemSolvingDualExtraction`, `openTEPES_ProblemSolvingPersistent`, `openTEPES_ProblemSolvingTuning`) — so concerns are addressable in code and the parallelisation modes (per-case sweep, in-memory overlay, post-build hot-swap) become first-class architectural seams.

![Architecture diagram](/doc/img/openTEPES_architecture.svg)
![Architecture diagram](/doc/img/openTEPES_architecture.png)

# How to Cite

Expand Down
30 changes: 30 additions & 0 deletions doc/img/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Architecture diagram

Two files make up the architecture diagram shown in the project `README.md`:

- `openTEPES_architecture.svg` — the source. It is hand-drawn SVG (the boxes and
text are plain SVG elements) and is edited directly; there is no script that
generates it. Open it in any text or vector editor, change what you need, save.
- `openTEPES_architecture.png` — a raster copy rendered from the SVG. The project
`README.md` embeds the PNG, because some pages (for example the PyPI project
page) do not display SVG images.

Modules drawn in **green** are implemented (merged upstream); modules drawn in
**white** are planned and their names are indicative.

After editing the SVG, regenerate the PNG so the two stay in step. Use a vector
tool such as [Inkscape](https://inkscape.org), which runs on Windows, macOS and
Linux:

Windows (Command Prompt or PowerShell):

```
inkscape openTEPES_architecture.svg --export-type=png --export-filename=openTEPES_architecture.png -w 1710
```

Linux / macOS (Inkscape, or `rsvg-convert` from librsvg):

```
inkscape openTEPES_architecture.svg --export-type=png --export-filename=openTEPES_architecture.png -w 1710
rsvg-convert -w 1710 openTEPES_architecture.svg -o openTEPES_architecture.png
```
Binary file added doc/img/openTEPES_architecture.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
101 changes: 59 additions & 42 deletions doc/img/openTEPES_architecture.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading