Skip to content

Commit

Permalink
esolver does not always output gz solution
Browse files Browse the repository at this point in the history
  • Loading branch information
aebrahim committed Jan 6, 2015
1 parent 11abb5a commit 3e3e653
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cobra/solvers/esolver.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def solve_problem(self, **solver_parameters):
self.solution_filepath = f.name
command = [ESOLVER_COMMAND, "-b", self.basis_filepath,
"-O", self.solution_filepath[:-4]]
if existing_basis is not None:
if existing_basis is not None and isfile(existing_basis):
command.extend(["-B", existing_basis])
command.extend(["-L", lp_filepath])
command_kwargs = {}
Expand All @@ -108,7 +108,8 @@ def solve_problem(self, **solver_parameters):
if not isfile(self.solution_filepath):
with open(self.solution_filepath, "w") as outfile:
outfile.write("=infeasible\n")
else:
elif isfile(self.solution_filepath + ".gz"):
# the solution may be written out compressed
check_call([GZIP_COMMAND, "-d", self.solution_filepath + ".gz"])
if DEVNULL is not None:
DEVNULL.close()
Expand Down

0 comments on commit 3e3e653

Please sign in to comment.