Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tanghaibao committed May 1, 2024
1 parent 9f963bb commit 7c1d9c5
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions jcvi/algorithms/lpsolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ def __init__(self, lp_data, work_dir=Work_dir, clean=True, verbose=False):
mkdir(work_dir)

lpfile = op.join(work_dir, "data.lp") # problem instance
logger.debug("write MIP instance to `{0}`".format(lpfile))
logger.debug("Write MIP instance to `%s`", lpfile)

fw = open(lpfile, "w")
fw.write(lp_data)
Expand All @@ -208,7 +208,7 @@ def __init__(self, lp_data, work_dir=Work_dir, clean=True, verbose=False):
self.results = self.parse_output(outfile)

if self.results:
logger.debug("optimized objective value ({0})".format(self.obj_val))
logger.debug("Optimized objective value (%s)", self.obj_val)

def run(self, lp_data):
raise NotImplementedError
Expand Down Expand Up @@ -241,8 +241,7 @@ def run(self, lpfile):

if retcode == 127:
logger.error(
"You need to install program `glpsol` "
+ "[http://www.gnu.org/software/glpk/]"
"You need to install program `glpsol` [http://www.gnu.org/software/glpk/]"
)
return -1, None

Expand Down Expand Up @@ -314,9 +313,7 @@ def run(self, lpfile):
retcode = sh(cmd, outfile=outf)

if retcode == 127:
logger.error(
"You need to install program `scip` " + "[http://scip.zib.de/]"
)
logger.error("You need to install program `scip` [http://scip.zib.de/]")
return -1, None

return retcode, outfile
Expand Down Expand Up @@ -780,7 +777,7 @@ def min_feedback_arc_set(edges, remove=False, maxcycles=20000):
ncycles += 1
if ncycles == maxcycles:
break
logger.debug("A total of {0} cycles found.".format(ncycles))
logger.debug("A total of %d cycles found.", ncycles)

L.constraints = constraints
L.add_vars(nedges)
Expand Down

0 comments on commit 7c1d9c5

Please sign in to comment.