calliope-project / calliope

A multi-scale energy systems modelling framework

Home Page:https://www.callio.pe

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Compare LPs to improve testing of constraints

brynpickering opened this issue · comments

Problem description

The new math formulation implementation (#411) has a time penalty for very small models which slows down the tests.

To speed things up, we should reduce how much of a backend model we build on testing the validity of different constraints.

Following the approach of Oemof, we can build incomplete models and then write an LP file that we do a string comparison against. Then we don't need to solve the model each time, nor do we need (or want) to run m.build() in the tests. Instead, we should use the backend API for adding constraints/variables/expressions one at a time.

Calliope version

v0.7.0-dev

Method to do so added in #453, now we just need to implement all tests in this format.