Closed KasiaKoz closed 10 months ago
How about pd.Series(variable.extract_values())
? that's what we use in calliope
I pulled out the entire code block that processes the model for solution variables - I didn't want to do it initially, because I really didn't want to mock loads of objects, but it turned out to not be that bad at all (no need to even use mocker). I noticed there was a dedicated method to get the index of the variable, which is much cleaner than processing the string representation of the variable. I hope the method and test names look a lot better now too - let me know what you think @mfitz !
Fixes #224
@brynpickering - maybe you know of a better way of pulling results out from a pyomo model? (Bearing in mind I want to test this without having to mock loads of objects...)