Closed brynpickering closed 2 months ago
Attention: Patch coverage is 95.45455%
with 18 lines
in your changes missing coverage. Please review.
Project coverage is 95.92%. Comparing base (
1e35888
) to head (f66f8e2
).
I have added tests, but we don't have gurobipy installed in the CI builds so those tests are being skipped. Hence the massive coverage drop.
I have run the urban scale model for a full year using the pyomo (with gurobi solver) and gurobi interfaces and get the attached results.
Headline: Gurobi interface peaks at ~30% less memory than pyomo. I know you got different results when running locally @sjpfenninger. This could be because I'm using a cloud license for Gurobi which I think means it offloads the actual solving onto a remote machine.
gurobi run:
import calliope
calliope.set_log_verbosity("info")
m = calliope.examples.urban_scale(time_subset=None)
m.build(backend="gurobi")
m.solve(solver_options={"Threads": 1})
pyomo run:
import calliope
calliope.set_log_verbosity("info")
m = calliope.examples.urban_scale(time_subset=None)
m.build(backend="pyomo")
m.solve(
solver="gurobi", solver_options={"Threads": 1})
Profiling using memray and setting [out] and [runfile] separately for pyomo and gurobi runs:
memray run --trace-python-allocators -o [out].bin [runfile].py
memray flamegraph [out].bin -o [out].html
Last week's new pyomo release has caused an issue in one of our tests (see #597). I've pinned Pyomo upper bound to avoid this issue for now.
Thanks for the review @irm-codebase - updated!
We can't provide generalised instructions for cbc in the installation guide due to Windows users not being able to install it directly (and pixi
wouldn't solve that). I would rather move to using HiGHs
as our default open source solver, but I haven't got it to work with the pyomo kernel library...
Fixes #349 Fixes #597 (by pinning pyomo)
Summary of changes in this pull request:
gurobipy
interfaceHow to use:
gurobipy
into your calliope env:mamba install gurobi::gurobi
model = calliope.Model(...) model.build(backend="gurobi") model.solve()