convexengineering / gpkit

Geometric programming for engineers
http://gpkit.readthedocs.org
MIT License
206 stars 40 forks source link

Control panel not working #664

Closed codykarcher closed 8 years ago

codykarcher commented 8 years ago

I'm assuming this is related to #662 , but I'm getting the following error when I try to run m.controlpanel():

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-5-1284bb9e590e> in <module>()
    237 # sol=m.localsolve()
    238 # sol = m.solve()
--> 239 m.controlpanel()

/Users/codykarcher/Dropbox (MIT)/Research/gpkit/gpkit/constraints/costed.pyc in controlpanel(self, *args, **kwargs)
     83         """
     84         from ..interactive.widgets import modelcontrolpanel
---> 85         return modelcontrolpanel(self, *args, **kwargs)

/Users/codykarcher/Dropbox (MIT)/Research/gpkit/gpkit/interactive/widgets.py in modelcontrolpanel(model, *args, **kwargs)
    101     """
    102 
--> 103     sliders = model.interact(*args, **kwargs)
    104     sliderboxes = []
    105     for sl in sliders.children:

/Users/codykarcher/Dropbox (MIT)/Research/gpkit/gpkit/constraints/costed.pyc in interact(self, ranges, fn_of_sol, **solvekwargs)
     74         """
     75         from ..interactive.widgets import modelinteract
---> 76         return modelinteract(self, ranges, fn_of_sol, **solvekwargs)
     77 
     78     def controlpanel(self, *args, **kwargs):

/Users/codykarcher/Dropbox (MIT)/Research/gpkit/gpkit/interactive/widgets.py in modelinteract(model, ranges, fn_of_sol, **solvekwargs)
     89             #     print(out)
     90 
---> 91     resolve()
     92 
     93     return widgets.interactive(resolve, **ranges)

/Users/codykarcher/Dropbox (MIT)/Research/gpkit/gpkit/interactive/widgets.py in resolve(**subs)
     68         try:
     69             try:
---> 70                 model.solve(**solvekwargs)
     71             except (AttributeError, ValueError):
     72                 model.localsolve(**solvekwargs)

/Users/codykarcher/Dropbox (MIT)/Research/gpkit/gpkit/constraints/prog_factories.pyc in solvefn(self, solver, verbosity, skipsweepfailures, *args, **kwargs)
     77                       solver, verbosity-1, *args, **kwargs)
     78         else:
---> 79             self.program, solvefn = genfunction(self, verbosity-1)
     80             result = solvefn(solver, verbosity-1, *args, **kwargs)
     81             solution.append(result)

/Users/codykarcher/Dropbox (MIT)/Research/gpkit/gpkit/constraints/prog_factories.pyc in programify(self, verbosity, substitutions, **kwargs)
     32         if not substitutions:
     33             substitutions = self.substitutions
---> 34         prog = program(self.cost, self, substitutions, verbosity, **kwargs)
     35         if return_attr:
     36             return prog, getattr(prog, return_attr)

/Users/codykarcher/Dropbox (MIT)/Research/gpkit/gpkit/geometric_program.pyc in __init__(self, cost, constraints, substitutions, verbosity)
     63             constraint.substitutions = self.substitutions
     64             try:
---> 65                 constr_posys = constraint.as_posyslt1()
     66             except TypeError as err:
     67                 if err.message == ("SignomialInequality could not simplify to"

/Users/codykarcher/Dropbox (MIT)/Research/Conceptual_Design_Tool/CDT/Models/GPkitModels/XFOIL.pyc in as_posyslt1(self)
     11 
     12     def as_posyslt1(self):
---> 13         raise TypeError("This CD model is not allowed to solve as a GP.")
     14 
     15     def as_gpconstr(self, x0):

TypeError: This CD model is not allowed to solve as a GP.
whoburg commented 8 years ago

should be resolved by #667. @cjk12, please close if so.

codykarcher commented 8 years ago

Yup, we're good.