Skip to content

Commit e602a40

Browse files
authored
Version change (#691)
* cleaning of deprecation + change of version * fix some more deprecation issues * updated HISTORY and included Antony Phillips in authors.
1 parent 67e0852 commit e602a40

File tree

12 files changed

+20
-214
lines changed

12 files changed

+20
-214
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ Roy, J.S
22
Mitchell, Stuart A
33
Christophe-Marie Duquesne (PYGLPK and YAPOSIB bindings)
44
Franco Peschiera
5+
Antony Phillips

HISTORY

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
# Copyright S.A.Mitchell ([email protected]), 2007-
33
# Copyright F.Peschiera ([email protected]), 2019-
44
# See the LICENSE file for copyright information.
5+
2.8.0 2024-01-12
6+
mip start in HiGHS_CMD and SCIP_PY
7+
GUROBI solver with environment handling
8+
added COPT solver
9+
added gurobi, highs, xpress, copt to github actions
10+
cbc arm binary
11+
fixes to SCIPS
12+
took out deprecations in arguments
513
2.7.0
614
added HiGHS solver
715
added XPRESS_PY solver

pulp/apis/__init__.py

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,3 @@ def listSolvers(onlyAvailable=False):
156156
result.append(solver.name)
157157
del solver
158158
return result
159-
160-
161-
# DEPRECATED aliases:
162-
get_solver = getSolver
163-
get_solver_from_json = getSolverFromJson
164-
get_solver_from_dict = getSolverFromDict
165-
list_solvers = listSolvers

pulp/apis/coin_api.py

Lines changed: 3 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ def __init__(
4848
mip=True,
4949
msg=True,
5050
timeLimit=None,
51-
fracGap=None,
52-
maxSeconds=None,
5351
gapRel=None,
5452
gapAbs=None,
5553
presolve=None,
@@ -62,7 +60,6 @@ def __init__(
6260
threads=None,
6361
logPath=None,
6462
timeMode="elapsed",
65-
mip_start=False,
6663
maxNodes=None,
6764
):
6865
"""
@@ -80,35 +77,10 @@ def __init__(
8077
:param bool presolve: if True, adds presolve on
8178
:param bool cuts: if True, adds gomory on knapsack on probing on
8279
:param bool strong: if True, adds strong
83-
:param float fracGap: deprecated for gapRel
84-
:param float maxSeconds: deprecated for timeLimit
8580
:param str timeMode: "elapsed": count wall-time to timeLimit; "cpu": count cpu-time
86-
:param bool mip_start: deprecated for warmStart
8781
:param int maxNodes: max number of nodes during branching. Stops the solving when reached.
8882
"""
8983

90-
if fracGap is not None:
91-
warnings.warn("Parameter fracGap is being deprecated for gapRel")
92-
if gapRel is not None:
93-
warnings.warn("Parameter gapRel and fracGap passed, using gapRel")
94-
else:
95-
gapRel = fracGap
96-
if maxSeconds is not None:
97-
warnings.warn("Parameter maxSeconds is being deprecated for timeLimit")
98-
if timeLimit is not None:
99-
warnings.warn(
100-
"Parameter timeLimit and maxSeconds passed, using timeLimit"
101-
)
102-
else:
103-
timeLimit = maxSeconds
104-
if mip_start:
105-
warnings.warn("Parameter mip_start is being deprecated for warmStart")
106-
if warmStart:
107-
warnings.warn(
108-
"Parameter mipStart and mip_start passed, using warmStart"
109-
)
110-
else:
111-
warmStart = mip_start
11284
LpSolver_CMD.__init__(
11385
self,
11486
gapRel=gapRel,
@@ -377,8 +349,6 @@ def __init__(
377349
mip=True,
378350
msg=True,
379351
timeLimit=None,
380-
fracGap=None,
381-
maxSeconds=None,
382352
gapRel=None,
383353
gapAbs=None,
384354
presolve=None,
@@ -390,7 +360,6 @@ def __init__(
390360
path=None,
391361
threads=None,
392362
logPath=None,
393-
mip_start=False,
394363
timeMode="elapsed",
395364
):
396365
if path is not None:
@@ -402,8 +371,6 @@ def __init__(
402371
mip=mip,
403372
msg=msg,
404373
timeLimit=timeLimit,
405-
fracGap=fracGap,
406-
maxSeconds=maxSeconds,
407374
gapRel=gapRel,
408375
gapAbs=gapAbs,
409376
presolve=presolve,
@@ -414,7 +381,6 @@ def __init__(
414381
keepFiles=keepFiles,
415382
threads=threads,
416383
logPath=logPath,
417-
mip_start=mip_start,
418384
timeMode=timeMode,
419385
)
420386

@@ -478,14 +444,14 @@ def __init__(
478444
rounding=1,
479445
integerPresolve=1,
480446
strong=5,
481-
epgap=None,
482447
*args,
483448
**kwargs,
484449
):
485450
LpSolver.__init__(self, *args, **kwargs)
486451
self.fracGap = None
487-
if epgap is not None:
488-
self.fracGap = float(epgap)
452+
gapRel = self.optionsDict.get("gapRel")
453+
if gapRel is not None:
454+
self.fracGap = float(gapRel)
489455
if self.timeLimit is not None:
490456
self.timeLimit = float(self.timeLimit)
491457
# Todo: these options are not yet implemented

pulp/apis/copt_api.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,6 @@ def __init__(
5151
"""
5252
Initialize command-line solver
5353
"""
54-
if mip_start:
55-
warnings.warn("Parameter mip_start is being deprecated for warmStart")
56-
if warmStart:
57-
warnings.warn(
58-
"Parameter warmStart and mip_start passed, using warmStart"
59-
)
60-
else:
61-
warmStart = mip_start
62-
6354
LpSolver_CMD.__init__(self, path, keepFiles, mip, msg, [])
6455

6556
self.mipstart = warmStart
@@ -333,14 +324,6 @@ def __init__(
333324
"""
334325
Initialize COPT solver
335326
"""
336-
if mip_start:
337-
warnings.warn("Parameter mip_start is being deprecated for warmStart")
338-
if warmStart:
339-
warnings.warn(
340-
"Parameter warmStart and mip_start passed, using warmStart"
341-
)
342-
else:
343-
warmStart = mip_start
344327

345328
LpSolver.__init__(self, mip, msg)
346329

@@ -888,7 +871,6 @@ def __init__(
888871
mip=True,
889872
msg=True,
890873
timeLimit=None,
891-
epgap=None,
892874
gapRel=None,
893875
warmStart=False,
894876
logPath=None,
@@ -901,14 +883,7 @@ def __init__(
901883
:param float gapRel: relative gap tolerance for the solver to stop (in fraction)
902884
:param bool warmStart: if True, the solver will use the current value of variables as a start
903885
:param str logPath: path to the log file
904-
:param float epgap: deprecated for gapRel
905886
"""
906-
if epgap is not None:
907-
warnings.warn("Parameter epgap is being deprecated for gapRel")
908-
if gapRel is not None:
909-
warnings.warn("Parameter gapRel and epgap passed, using gapRel")
910-
else:
911-
gapRel = epgap
912887

913888
LpSolver.__init__(
914889
self,

pulp/apis/cplex_api.py

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ class CPLEX_CMD(LpSolver_CMD):
1111

1212
def __init__(
1313
self,
14-
timelimit=None,
1514
mip=True,
1615
msg=True,
1716
timeLimit=None,
@@ -25,7 +24,6 @@ def __init__(
2524
logPath=None,
2625
maxMemory=None,
2726
maxNodes=None,
28-
mip_start=False,
2927
):
3028
"""
3129
:param bool mip: if False, assume LP even if integer variables
@@ -41,25 +39,7 @@ def __init__(
4139
:param str logPath: path to the log file
4240
:param float maxMemory: max memory to use during the solving. Stops the solving when reached.
4341
:param int maxNodes: max number of nodes during branching. Stops the solving when reached.
44-
:param bool mip_start: deprecated for warmStart
45-
:param float timelimit: deprecated for timeLimit
4642
"""
47-
if timelimit is not None:
48-
warnings.warn("Parameter timelimit is being deprecated for timeLimit")
49-
if timeLimit is not None:
50-
warnings.warn(
51-
"Parameter timeLimit and timelimit passed, using timeLimit "
52-
)
53-
else:
54-
timeLimit = timelimit
55-
if mip_start:
56-
warnings.warn("Parameter mip_start is being deprecated for warmStart")
57-
if warmStart:
58-
warnings.warn(
59-
"Parameter mipStart and mip_start passed, using warmStart"
60-
)
61-
else:
62-
warmStart = mip_start
6343
LpSolver_CMD.__init__(
6444
self,
6545
gapRel=gapRel,
@@ -293,8 +273,6 @@ def __init__(
293273
gapRel=None,
294274
warmStart=False,
295275
logPath=None,
296-
epgap=None,
297-
logfilename=None,
298276
threads=None,
299277
):
300278
"""
@@ -304,24 +282,8 @@ def __init__(
304282
:param float gapRel: relative gap tolerance for the solver to stop (in fraction)
305283
:param bool warmStart: if True, the solver will use the current value of variables as a start
306284
:param str logPath: path to the log file
307-
:param float epgap: deprecated for gapRel
308-
:param str logfilename: deprecated for logPath
309285
:param int threads: number of threads to be used by CPLEX to solve a problem (default None uses all available)
310286
"""
311-
if epgap is not None:
312-
warnings.warn("Parameter epgap is being deprecated for gapRel")
313-
if gapRel is not None:
314-
warnings.warn("Parameter gapRel and epgap passed, using gapRel")
315-
else:
316-
gapRel = epgap
317-
if logfilename is not None:
318-
warnings.warn("Parameter logfilename is being deprecated for logPath")
319-
if logPath is not None:
320-
warnings.warn(
321-
"Parameter logPath and logfilename passed, using logPath"
322-
)
323-
else:
324-
logPath = logfilename
325287

326288
LpSolver.__init__(
327289
self,

pulp/apis/glpk_api.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,15 +207,15 @@ def actualSolve(self, lp, callback=None):
207207
else:
208208

209209
def __init__(
210-
self, mip=True, msg=True, timeLimit=None, epgap=None, **solverParams
210+
self, mip=True, msg=True, timeLimit=None, gapRel=None, **solverParams
211211
):
212212
"""
213213
Initializes the glpk solver.
214214
215215
@param mip: if False the solver will solve a MIP as an LP
216216
@param msg: displays information from the solver to stdout
217217
@param timeLimit: not handled
218-
@param epgap: not handled
218+
@param gapRel: not handled
219219
@param solverParams: not handled
220220
"""
221221
LpSolver.__init__(self, mip, msg)

pulp/apis/gurobi_api.py

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ def __init__(
7070
mip=True,
7171
msg=True,
7272
timeLimit=None,
73-
epgap=None,
7473
gapRel=None,
7574
warmStart=False,
7675
logPath=None,
@@ -86,7 +85,6 @@ def __init__(
8685
:param float gapRel: relative gap tolerance for the solver to stop (in fraction)
8786
:param bool warmStart: if True, the solver will use the current value of variables as a start
8887
:param str logPath: path to the log file
89-
:param float epgap: deprecated for gapRel
9088
:param gp.Env env: Gurobi environment to use. Default None.
9189
:param dict envOptions: environment options.
9290
:param bool manageEnv: if False, assume the environment is handled by the user.
@@ -148,13 +146,6 @@ def __init__(
148146
self.model = None
149147
self.init_gurobi = False # whether env and model have been initialised
150148

151-
if epgap is not None:
152-
warnings.warn("Parameter epgap is being deprecated for gapRel")
153-
if gapRel is not None:
154-
warnings.warn("Parameter gapRel and epgap passed, using gapRel")
155-
else:
156-
gapRel = epgap
157-
158149
LpSolver.__init__(
159150
self,
160151
mip=mip,
@@ -243,7 +234,7 @@ def available(self):
243234
try:
244235
with gp.Env(params=self.env_options):
245236
pass
246-
except gurobipy.GurobiError as e:
237+
except gp.GurobiError as e:
247238
warnings.warn(f"GUROBI error: {e}.")
248239
return False
249240
return True
@@ -416,16 +407,7 @@ def __init__(
416407
:param bool keepFiles: if True, files are saved in the current directory and not deleted after solving
417408
:param str path: path to the solver binary
418409
:param str logPath: path to the log file
419-
:param bool mip_start: deprecated for warmStart
420410
"""
421-
if mip_start:
422-
warnings.warn("Parameter mip_start is being deprecated for warmStart")
423-
if warmStart:
424-
warnings.warn(
425-
"Parameter warmStart and mip_start passed, using warmStart"
426-
)
427-
else:
428-
warmStart = mip_start
429411
LpSolver_CMD.__init__(
430412
self,
431413
gapRel=gapRel,

pulp/apis/xpress_api.py

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ def __init__(
5454
options=None,
5555
keepFiles=False,
5656
path=None,
57-
maxSeconds=None,
58-
targetGap=None,
5957
heurFreq=None,
6058
heurStra=None,
6159
coverCuts=None,
@@ -69,8 +67,6 @@ def __init__(
6967
:param bool msg: if False, no log is shown
7068
:param float timeLimit: maximum time for solver (in seconds)
7169
:param float gapRel: relative gap tolerance for the solver to stop (in fraction)
72-
:param maxSeconds: deprecated for timeLimit
73-
:param targetGap: deprecated for gapRel
7470
:param heurFreq: the frequency at which heuristics are used in the tree search
7571
:param heurStra: heuristic strategy
7672
:param coverCuts: the number of rounds of lifted cover inequalities at the top node
@@ -80,20 +76,6 @@ def __init__(
8076
https://www.fico.com/fico-xpress-optimization/docs/latest/solver/optimizer/HTML/chapter7.html
8177
:param bool warmStart: if True, then use current variable values as start
8278
"""
83-
if maxSeconds:
84-
warnings.warn("Parameter maxSeconds is being deprecated for timeLimit")
85-
if timeLimit is not None:
86-
warnings.warn(
87-
"Parameter timeLimit and maxSeconds passed, using timeLimit"
88-
)
89-
else:
90-
timeLimit = maxSeconds
91-
if targetGap is not None:
92-
warnings.warn("Parameter targetGap is being deprecated for gapRel")
93-
if gapRel is not None:
94-
warnings.warn("Parameter gapRel and epgap passed, using gapRel")
95-
else:
96-
gapRel = targetGap
9779
LpSolver_CMD.__init__(
9880
self,
9981
gapRel=gapRel,

pulp/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
This file contains the constant definitions for PuLP
2828
Note that hopefully these will be changed into something more pythonic
2929
"""
30-
VERSION = "2.7.0"
30+
VERSION = "2.8.0"
3131
EPS = 1e-7
3232

3333
# variable categories

0 commit comments

Comments
 (0)