Skip to content

Commit

Permalink
Fixing up a few things and supporting changes to GiMPy
Browse files Browse the repository at this point in the history
  • Loading branch information
tkralphs committed Feb 19, 2020
1 parent 2ce655a commit 04730de
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
6 changes: 4 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import setuptools

setup(name='coinor.grumpy',
version='0.9.1',
version='0.9.2',
description='Graphics for Understanding Mathematical Programming (GrUMPy)',
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.
Expand All @@ -23,7 +23,9 @@
license='Eclipse Public License',
url='https://github.com/tkralphs/GrUMPy/',
namespace_packages=['coinor'],
packages=['coinor.grumpy','coinor.grumpy.examples','coinor'],
packages=['coinor.grumpy','coinor'],
package_data={'':['*.vbc']},
include_package_data=True,
package_dir = {'coinor': 'src'},
install_requires=['coinor.gimpy>=2.0.0', 'pulp']
)
9 changes: 6 additions & 3 deletions src/grumpy/BBTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,10 +274,13 @@ def set_display_mode(self, mode):
self.attr['display'] = 'off'
elif mode is 'file':
self.attr['display'] = 'file'
elif mode is 'matplotlib':
self.attr['display'] = 'matplotlib'
else:
raise Exception('%s is not a valid display mode.' %mode)

def display(self, item = 'all', basename = 'graph', format='png', count=None):
def display(self, item = 'all', basename = 'graph', format='png', count=None,
pause=False, wait_for_click=True):
'''
Displays/Saves images requested. BranchAndBound method calls this method
to visualize the branch and bound tree.
Expand All @@ -300,7 +303,7 @@ def display(self, item = 'all', basename = 'graph', format='png', count=None):
n.attr['style'] = 'filled'
else:
n.attr['label'] = ' '
BinaryTree.display(self)
BinaryTree.display(self, pause = pause, wait_for_click = wait_for_click)
return
if self.attr['display'] is 'off':
return
Expand Down Expand Up @@ -2082,7 +2085,7 @@ def parse_options():
T = BBTree()
#T.set_layout('dot2tex')
#T.set_display_mode('file')
T.set_display_mode('xdot')
T.set_display_mode('matplotlib')
#T.set_display_mode('pygame')
CONSTRAINTS, VARIABLES, OBJ, MAT, RHS = GenerateRandomMIP(rand_seed = 120)
BranchAndBound(T, CONSTRAINTS, VARIABLES, OBJ, MAT, RHS,
Expand Down
7 changes: 6 additions & 1 deletion src/grumpy/__main__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
from __future__ import print_function
from future import standard_library
standard_library.install_aliases()
from coinor.grumpy import BBTree
from .BBTree import *
from .BranchAndBound import *
try:
from .polyhedron2D import *
except ImportError:
pass
import sys
import io

Expand Down

0 comments on commit 04730de

Please sign in to comment.