Skip to content

Commit 9892f8c

Browse files
authored
A helpful error message if we encounter a GRBException while running the cpp solver. (#91)
1 parent e820382 commit 9892f8c

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def build_extension(self, ext):
7676

7777
setup(
7878
name='hatchet',
79-
version='0.4.3',
79+
version='0.4.4',
8080
packages=['hatchet', 'hatchet.utils', 'hatchet.utils.solve', 'hatchet.bin', 'hatchet.data'],
8181
package_dir={'': 'src'},
8282
package_data={'hatchet': ['hatchet.ini'], 'hatchet.data': ['*']},

src/hatchet/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = '0.4.3'
1+
__version__ = '0.4.4'
22

33
import os.path
44
from importlib.resources import path

src/hatchet/bin/HATCHet.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,11 @@ def execute(args, basecmd, n, outprefix):
683683
else:
684684
raise RuntimeError(error('Failed to parse the output of the following command because the final objective was not found: \n\t\t{}\n'.format(cmd)))
685685
else:
686-
raise RuntimeError(error("The following command failed: \n\t\t{}\nwith {}\n".format(cmd, buffer)))
686+
if any('GRBException' in line for line in buffer):
687+
msg = '\nYou likely have a licensing issue with Gurobi. Please run `hatchet check-solver` to ensure that the solver is working correctly.'
688+
else:
689+
msg = '\nUnexpected error during solve. Please run `hatchet check-solver` to ensure that the solver is working correctly.'
690+
raise RuntimeError(error("The following command failed: \n\t\t{}\nwith {}\n{}".format(cmd, buffer, msg)))
687691

688692
return obj
689693

0 commit comments

Comments
 (0)