OSeMOSYS / otoole

OSeMOSYS Tools for Energy
https://otoole.readthedocs.io
MIT License
23 stars 17 forks source link

Read in zero values from cplex #215

Open willu47 opened 7 months ago

willu47 commented 7 months ago

Reads in zero values from the CPLEX solution file

Description

Removes the piece of code which excluded zero values from the CPLEX solution.

Issue Ticket Number

214

Documentation

This has not been documented.

willu47 commented 7 months ago

A few things to consider before merging:

trevorb1 commented 7 months ago

Hi @willu47! I believe your second bullet point of

adding a command line flag to make this a user-defined option

has been implemented in PR #126! Specifically, the --write_defaults flag. However, I just tried to do a test with it on Simplicity, and the default values were not written out :(

When I run this command

otoole results cplex csv model.sol results-with-zero datafile data.txt config.yaml --write_defaults

The results write out with zeros removed. No helpful debugging logs got printed out either. I tried with cbc as well, and the same thing happened; results write out with the zeros removed.

trevorb1 commented 7 months ago

Ahh.. we are hitting the KeyError exception here. The dubugging statement is just lousy cause it printed out the key REGION rather then something more descriptive. My fault there! haha

https://github.com/OSeMOSYS/otoole/blob/15bdc0b09e82a04c713d71bfdfb72f0a17d26fde/src/otoole/input.py#L260-L264