Skip to content

Commit

Permalink
fix some more deprecation issues
Browse files Browse the repository at this point in the history
  • Loading branch information
pchtsp committed Oct 2, 2023
1 parent 11ee7f9 commit f0b6887
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
12 changes: 3 additions & 9 deletions pulp/apis/coin_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -349,8 +349,6 @@ def __init__(
mip=True,
msg=True,
timeLimit=None,
fracGap=None,
maxSeconds=None,
gapRel=None,
gapAbs=None,
presolve=None,
Expand All @@ -362,7 +360,6 @@ def __init__(
path=None,
threads=None,
logPath=None,
mip_start=False,
timeMode="elapsed",
):
if path is not None:
Expand All @@ -374,8 +371,6 @@ def __init__(
mip=mip,
msg=msg,
timeLimit=timeLimit,
fracGap=fracGap,
maxSeconds=maxSeconds,
gapRel=gapRel,
gapAbs=gapAbs,
presolve=presolve,
Expand All @@ -386,7 +381,6 @@ def __init__(
keepFiles=keepFiles,
threads=threads,
logPath=logPath,
mip_start=mip_start,
timeMode=timeMode,
)

Expand Down Expand Up @@ -450,14 +444,14 @@ def __init__(
rounding=1,
integerPresolve=1,
strong=5,
epgap=None,
*args,
**kwargs,
):
LpSolver.__init__(self, *args, **kwargs)
self.fracGap = None
if epgap is not None:
self.fracGap = float(epgap)
gapRel = self.optionsDict.get("gapRel")
if gapRel is not None:
self.fracGap = float(gapRel)
if self.timeLimit is not None:
self.timeLimit = float(self.timeLimit)
# Todo: these options are not yet implemented
Expand Down
4 changes: 2 additions & 2 deletions pulp/apis/glpk_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,15 +207,15 @@ def actualSolve(self, lp, callback=None):
else:

def __init__(
self, mip=True, msg=True, timeLimit=None, epgap=None, **solverParams
self, mip=True, msg=True, timeLimit=None, gapRel=None, **solverParams
):
"""
Initializes the glpk solver.
@param mip: if False the solver will solve a MIP as an LP
@param msg: displays information from the solver to stdout
@param timeLimit: not handled
@param epgap: not handled
@param gapRel: not handled
@param solverParams: not handled
"""
LpSolver.__init__(self, mip, msg)
Expand Down
4 changes: 2 additions & 2 deletions pulp/tests/test_pulp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1339,7 +1339,7 @@ def test_LpVariable_indexs_param(self):

print("\t Testing 'indexs' param continues to work for LpVariable.dicts")
# explicit param creates a dict of type LpVariable
assign_vars = LpVariable.dicts(name="test", indexs=(customers, agents))
assign_vars = LpVariable.dicts(name="test", indices=(customers, agents))
for k, v in assign_vars.items():
for a, b in v.items():
self.assertIsInstance(b, LpVariable)
Expand All @@ -1351,7 +1351,7 @@ def test_LpVariable_indexs_param(self):
self.assertIsInstance(b, LpVariable)

print("\t Testing 'indexs' param continues to work for LpVariable.matrix")
# explicit param creates list of list of LpVariable
# explicit param creates list of LpVariable
assign_vars_matrix = LpVariable.matrix(
name="test", indices=(customers, agents)
)
Expand Down

0 comments on commit f0b6887

Please sign in to comment.