OSeMOSYS / otoole

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

Asserion error while using Otoole Results #219

Open vignesh1987 opened 6 months ago

vignesh1987 commented 6 months ago

The Issue

When I use Otoole to create result CSVs, I get an Assertion Error. I thought that this could be because I had hashed out important result variables like ProductionByTechnologyAnnual. However, the error persists even after I run the model with the variables enabled. Any pointers on what the reason could be? I have attached the error log along with the posts. otoole_results_errorlog.txt

Expected Behavior

I did not expect any assertion error.

Steps To Reproduce

I used GLPSOL to create the *.lp file. I used otoole and ran CBC to create a solution file and then used otoole results to produce the results. Attached my model file and data file for reproduction. osemosys_processed.txt data_processed.txt

Log output

No response

Operating System

Windows

What version of otoole are you running?

1.1.2

Possible Solution

The member list on Amply.py does not match in length with some variables. I doubt if this is because I have not enabled any particular result variable that Otoole considers in its default results template. Or maybe there is a mismatch between my config file (result variables) and the result variables enabled in the model file. I will investigate the latter.

Anything else?

No response

trevorb1 commented 6 months ago

Hey @vignesh1987, thanks for reporting the error! :)

Are you able to try running your results command using the non pre-processed data file? (ie. the datafile without the additional MODExTECHNOLOGYperFUELout (and other) sets at the bottom). I believe I ran into a similar error previously, and this was the fix.

While this may solve the issue, we should probably leave this issue open since more people are running into it! Not sure if this bug originates from amply or otoole tho?

vignesh1987 commented 6 months ago

HI @trevorb1 Thanks for the pointers. I ran it the usual way (without creating the super sets)and it ran smoothly. But this exploded the running time by an order of 10 (in my case), and the LP file size is 10 times bigger. Will investigate more and get back.

trevorb1 commented 6 months ago

@vignesh1987, sorry, my response may have been unclear! I guess I meant, still run the model with the pre-processed data file, but then in the otoole results conversion use the non-pre-processed data file! Off the top of my head, I believe amply has trouble parsing the pre-processed datafile with the updated sets (but this could be wrong!)

vignesh1987 commented 5 months ago

@trevorb1 : Yes, the assertion error is avoided when using the original data file instead of the pre-processed one. Shall I close this bug, or do we still have this open? May be I can add somewhere in the documentation (as a caveat) about this. This can be a temporary solution.

trevorb1 commented 5 months ago

@vignesh1987, thanks for confirming it works! I agree with you, adding this in the documentation should be enough to close this bug, as the error (I think) originates with amply. Maybe this then gets converted to a new issue of "Cannot parse preprocessed datafiles" which links to amply.