File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change 5
5
## Fixes
6
6
7
7
* Fixes the incorrect bounds in the CycleFree loop removal.
8
+ * Fixes reduced costs and shadow prices not available when using non-convex models.
8
9
9
10
## Other
10
11
Original file line number Diff line number Diff line change @@ -174,7 +174,15 @@ def get_solution(
174
174
reduced = np .empty (len (reactions ))
175
175
var_primals = model .solver .primal_values
176
176
shadow = np .empty (len (metabolites ))
177
- if model .solver .is_integer :
177
+
178
+ try :
179
+ var_duals = model .solver .reduced_costs
180
+ constr_duals = model .solver .shadow_prices
181
+ duals_available = True
182
+ except Exception :
183
+ duals_available = False
184
+
185
+ if model .solver .is_integer or not duals_available :
178
186
reduced .fill (np .nan )
179
187
shadow .fill (np .nan )
180
188
for i , rxn in enumerate (reactions ):
You can’t perform that action at this time.
0 commit comments