Skip to content

Commit 04730de

Browse files
committed
Fixing up a few things and supporting changes to GiMPy
1 parent 2ce655a commit 04730de

File tree

3 files changed

+16
-6
lines changed

3 files changed

+16
-6
lines changed

setup.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import setuptools
55

66
setup(name='coinor.grumpy',
7-
version='0.9.1',
7+
version='0.9.2',
88
description='Graphics for Understanding Mathematical Programming (GrUMPy)',
99
long_description='''GrUMPy is a class for visualizing various algorithm used in solving discrete optimization problem. It has a class for dynamically generating and visualizing branch-and-bound trees that is derived from the GiMPy graph class. Using the branch-and-bound class, a user can visualize the branch-and-bound process in a number of different ways either by building the tree dynamically through direct calls to Python from the solver or by piping the output of an instrumented solver to GrUMPy for parsing. The branch-and-bound class also includes a pure Python implementation of branch and bound that is targeted at educational use.
1010
@@ -23,7 +23,9 @@
2323
license='Eclipse Public License',
2424
url='https://github.com/tkralphs/GrUMPy/',
2525
namespace_packages=['coinor'],
26-
packages=['coinor.grumpy','coinor.grumpy.examples','coinor'],
26+
packages=['coinor.grumpy','coinor'],
27+
package_data={'':['*.vbc']},
28+
include_package_data=True,
2729
package_dir = {'coinor': 'src'},
2830
install_requires=['coinor.gimpy>=2.0.0', 'pulp']
2931
)

src/grumpy/BBTree.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,13 @@ def set_display_mode(self, mode):
274274
self.attr['display'] = 'off'
275275
elif mode is 'file':
276276
self.attr['display'] = 'file'
277+
elif mode is 'matplotlib':
278+
self.attr['display'] = 'matplotlib'
277279
else:
278280
raise Exception('%s is not a valid display mode.' %mode)
279281

280-
def display(self, item = 'all', basename = 'graph', format='png', count=None):
282+
def display(self, item = 'all', basename = 'graph', format='png', count=None,
283+
pause=False, wait_for_click=True):
281284
'''
282285
Displays/Saves images requested. BranchAndBound method calls this method
283286
to visualize the branch and bound tree.
@@ -300,7 +303,7 @@ def display(self, item = 'all', basename = 'graph', format='png', count=None):
300303
n.attr['style'] = 'filled'
301304
else:
302305
n.attr['label'] = ' '
303-
BinaryTree.display(self)
306+
BinaryTree.display(self, pause = pause, wait_for_click = wait_for_click)
304307
return
305308
if self.attr['display'] is 'off':
306309
return
@@ -2082,7 +2085,7 @@ def parse_options():
20822085
T = BBTree()
20832086
#T.set_layout('dot2tex')
20842087
#T.set_display_mode('file')
2085-
T.set_display_mode('xdot')
2088+
T.set_display_mode('matplotlib')
20862089
#T.set_display_mode('pygame')
20872090
CONSTRAINTS, VARIABLES, OBJ, MAT, RHS = GenerateRandomMIP(rand_seed = 120)
20882091
BranchAndBound(T, CONSTRAINTS, VARIABLES, OBJ, MAT, RHS,

src/grumpy/__main__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
from __future__ import print_function
22
from future import standard_library
33
standard_library.install_aliases()
4-
from coinor.grumpy import BBTree
4+
from .BBTree import *
5+
from .BranchAndBound import *
6+
try:
7+
from .polyhedron2D import *
8+
except ImportError:
9+
pass
510
import sys
611
import io
712

0 commit comments

Comments
 (0)