Changeset 9476


Ignore:
Timestamp:
Dec 14, 2014 1:32:37 AM (4 years ago)
Author:
wehart
Message:

Removing the ability to execute a transformation with
a virtual attribute of the model.transform object.

Location:
pyomo/trunk/pyomo/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • pyomo/trunk/pyomo/core/base/PyomoModel.py

    r9336 r9476  
    133133        return TransformationFactory.services()
    134134
    135     def __getattr__(self, name):
     135    def X__getattr__(self, name):
     136        """ Disabled the option of returning a function based on a virtual attribute """
    136137        if name.startswith('_'):
    137138            return self.__dict__[name]
  • pyomo/trunk/pyomo/core/tests/unit/test_transform.py

    r9271 r9476  
    6363
    6464    def test_apply_transformation1(self):
    65         self.assertTrue('relax_integrality' in apply_transformation())
     65        self.assertTrue('base.relax_integrality' in apply_transformation())
    6666
    6767    def test_apply_transformation2(self):
    6868        self.assertEqual(apply_transformation('foo'),None)
    69         self.assertTrue(isinstance(apply_transformation('relax_integrality'),Plugin))
    70         self.assertTrue(isinstance(apply_transformation('relax_integrality'),Plugin))
     69        self.assertTrue(isinstance(apply_transformation('base.relax_integrality'),Plugin))
     70        self.assertTrue(isinstance(apply_transformation('base.relax_integrality'),Plugin))
    7171        self.assertEqual(apply_transformation('foo', self.model),None)
    7272
     
    7979
    8080        instance=self.model.create()
    81         transformed = instance.transform.nonnegative_vars()
     81        transformed = instance.transform('base.nonnegative_vars')
    8282
    8383        # Check that all variables have nonnegative bounds or domains
     
    158158
    159159        instance = self.model.create()
    160         transformed = instance.transform.nonnegative_vars()
     160        transformed = instance.transform('base.nonnegative_vars')
    161161
    162162        # Make sure everything is nonnegative
Note: See TracChangeset for help on using the changeset viewer.