FZJ-IEK3-VSA/tsam

Tsam erroneously raises error after successfully solving k_medoids clustering problem with Gurobi

FlRedder opened this issue · 1 comments

elif self.solver=='gurobi' and not results['Solver'][0]['Termination condition'].index in [2,7,8,9,10]: # optimal
raise ValueError(results['Solver'][0]['Termination message'])

The above code raises an error although Gurobi finds a valid solution for clustering method k_medoids. Hence, the error message should not be raised.

Possible cause for the bug:

  • API changes in Pyomo (my version: 6.0.1) or Gurobi (my version: 9.1.1). The index attribute of results['Solver'][0]['Termination condition'] seems not to be present in Pyomo 6.0.1 anymore. Could it be replaced by results['Solver'][0]['Return code']?

Hotfix:

  • If I comment out the above lines everything works just fine.

Dear Florian,

thanks for pointing out!
The issue should be solved with the latest release 1.1.2.

Best
Leander