Skip to content

Commit dddd1d8

Browse files
committed
MAINT: Rework to highspy and highs API names
1 parent 16b2fd6 commit dddd1d8

File tree

2 files changed

+14
-14
lines changed

2 files changed

+14
-14
lines changed

scipy/optimize/_highs/_highs_wrapper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ def _highs_wrapper(c, indptr, indices, data, lhs, rhs, lb, ub, integrality, opti
119119
lp.num_row_ = numrow
120120
lp.a_matrix_.num_col_ = numcol
121121
lp.a_matrix_.num_row_ = numrow
122-
lp.a_matrix_.format_ = _h.HighsMatrixFormat.kColwise
122+
lp.a_matrix_.format_ = _h.MatrixFormat.kColwise
123123
lp.col_cost_ = c
124124
lp.col_lower_ = lb
125125
lp.col_upper_ = ub

scipy/optimize/_linprog_highs.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@
2121
from ._highspy._core import(
2222
kHighsInf,
2323
HighsDebugLevel,
24-
HighsObjSense,
24+
ObjSense,
2525
HighsModelStatus,
2626
)
2727
from ._highspy._core.simplex_constants import (
28-
HighsSimplexStrategy,
29-
HighsSimplexCrashStrategy,
30-
HighsSimplexEdgeWeightStrategy,
28+
SimplexStrategy,
29+
SimplexCrashStrategy,
30+
SimplexEdgeWeightStrategy,
3131
)
3232
from scipy.sparse import csc_matrix, vstack, issparse
3333

@@ -37,7 +37,7 @@ def _highs_to_scipy_status_message(highs_status, highs_message):
3737

3838
scipy_statuses_messages = {
3939
None: (4, "HiGHS did not provide a status code. "),
40-
HighsModelStatus.kNotSet: (4, ""),
40+
HighsModelStatus.kNotset: (4, ""),
4141
HighsModelStatus.kLoadError: (4, ""),
4242
HighsModelStatus.kModelError: (2, ""),
4343
HighsModelStatus.kPresolveError: (4, ""),
@@ -293,10 +293,10 @@ def _linprog_highs(lp, solver, time_limit=None, presolve=True,
293293
simplex_dual_edge_weight_strategy_enum = _convert_to_highs_enum(
294294
simplex_dual_edge_weight_strategy,
295295
'simplex_dual_edge_weight_strategy',
296-
choices={'dantzig': HighsSimplexEdgeWeightStrategy.kDantzig,
297-
'devex': HighsSimplexEdgeWeightStrategy.kDevex,
298-
'steepest-devex': HighsSimplexEdgeWeightStrategy.kChoose,
299-
'steepest': HighsSimplexEdgeWeightStrategy.kSteepestEdge,
296+
choices={'dantzig': SimplexEdgeWeightStrategy.kSimplexEdgeWeightStrategyDantzig,
297+
'devex': SimplexEdgeWeightStrategy.kSimplexEdgeWeightStrategyDevex,
298+
'steepest-devex': SimplexEdgeWeightStrategy.kSimplexEdgeWeightStrategyChoose,
299+
'steepest': SimplexEdgeWeightStrategy.kSimplexEdgeWeightStrategySteepestEdge,
300300
None: None})
301301

302302
c, A_ub, b_ub, A_eq, b_eq, bounds, x0, integrality = lp
@@ -319,10 +319,10 @@ def _linprog_highs(lp, solver, time_limit=None, presolve=True,
319319

320320
options = {
321321
'presolve': presolve,
322-
'sense': HighsObjSense.kMinimize,
322+
'sense': ObjSense.kMinimize,
323323
'solver': solver,
324324
'time_limit': time_limit,
325-
'highs_debug_level': HighsDebugLevel.kNone,
325+
'highs_debug_level': HighsDebugLevel.kHighsDebugLevelNone,
326326
'dual_feasibility_tolerance': dual_feasibility_tolerance,
327327
'ipm_optimality_tolerance': ipm_optimality_tolerance,
328328
'log_to_console': disp,
@@ -331,8 +331,8 @@ def _linprog_highs(lp, solver, time_limit=None, presolve=True,
331331
'primal_feasibility_tolerance': primal_feasibility_tolerance,
332332
'simplex_dual_edge_weight_strategy':
333333
simplex_dual_edge_weight_strategy_enum,
334-
'simplex_strategy': HighsSimplexStrategy.kDual,
335-
'simplex_crash_strategy': HighsSimplexCrashStrategy.kOff,
334+
'simplex_strategy': SimplexStrategy.kSimplexStrategyDual,
335+
'simplex_crash_strategy': SimplexCrashStrategy.kSimplexCrashStrategyOff,
336336
'ipm_iteration_limit': maxiter,
337337
'simplex_iteration_limit': maxiter,
338338
'mip_rel_gap': mip_rel_gap,

0 commit comments

Comments
 (0)