Skip to content

Commit

Permalink
ENH: Use highs_options
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoZeke committed Oct 1, 2023
1 parent 637a383 commit 8f3d57a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion scipy/optimize/_linprog_highs.py
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,14 @@ def _linprog_highs(lp, solver, time_limit=None, presolve=True,
status, message = highs_mapper.get_scipy_status(highs_status,
highs_message)

x = np.array(res['x']) if 'x' in res else None
def is_valid_x(val):
if isinstance(val, np.ndarray):
if val.dtype == object and None in val:
return False
return val is not None

x = np.array(res['x']) if 'x' in res and is_valid_x(res['x']) else None

sol = {'x': x,
'slack': slack,
'con': con,
Expand Down
2 changes: 1 addition & 1 deletion subprojects/highs.wrap
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[wrap-git]
url = https://github.com/HaoZeke/highs.git
revision = d0bac8a10ce0d7bed35469c68a95450bee9dce71
revision = d437089ca25d2dd8d8d68d6660ca3a1856c4c9a2

0 comments on commit 8f3d57a

Please sign in to comment.