예제 #1
0
 def transform(self, name=None, **kwds):
     logger.warning(
         "DEPRECATION WARNING: This method has been removed.  Use the TransformationFactory to construct a transformation object."
     )
     if name is None:
         return TransformationFactory.services()
     xfrm = TransformationFactory(name)
     if xfrm is None:
         raise ValueError("Bad model transformation '%s'" % name)
     return xfrm(self, **kwds)
예제 #2
0
    def transform(self, name=None, **kwds):
        if name is None:
            deprecation_warning(
                "Use the TransformationFactory iterator to get the list "
                "of known transformations.", version='4.3.11323')
            return list(TransformationFactory)

        deprecation_warning(
            "Use TransformationFactory('%s') to construct a transformation "
            "object, or TransformationFactory('%s').apply_to(model) to "
            "directly apply the transformation to the model instance." % (
                name,name,), version='4.3.11323')

        xfrm = TransformationFactory(name)
        if xfrm is None:
            raise ValueError("Unknown model transformation '%s'" % name)
        return xfrm.apply_to(self, **kwds)
예제 #3
0
 def transform(self, name=None, **kwds):
     logger.warning("DEPRECATION WARNING: This method has been removed.  Use the TransformationFactory to construct a transformation object.")
     if name is None:
         return TransformationFactory.services()
     xfrm = TransformationFactory(name)
     if xfrm is None:
         raise ValueError("Bad model transformation '%s'" % name)
     return xfrm(self, **kwds)
예제 #4
0
파일: PyomoModel.py 프로젝트: Pyomo/pyomo
    def transform(self, name=None, **kwds):
        if name is None:
            logger.warning(
"""DEPRECATION WARNING: Model.transform() is deprecated.  Use
the TransformationFactory iterator to get the list of known
transformations.""")
            return list(TransformationFactory)

        logger.warning(
"""DEPRECATION WARNING: Model.transform() is deprecated.  Use
TransformationFactory('%s') to construct a transformation object, or
TransformationFactory('%s').apply_to(model) to directly apply the
transformation to the model instance.""" % (name,name,) )

        xfrm = TransformationFactory(name)
        if xfrm is None:
            raise ValueError("Unknown model transformation '%s'" % name)
        return xfrm.apply_to(self, **kwds)
예제 #5
0
    def transform(self, name=None, **kwds):
        if name is None:
            logger.warning(
"""DEPRECATION WARNING: Model.transform() is deprecated.  Use
the TransformationFactory iterator to get the list of known
transformations.""")
            return list(TransformationFactory)

        logger.warning(
"""DEPRECATION WARNING: Model.transform() is deprecated.  Use
TransformationFactory('%s') to construct a transformation object, or
TransformationFactory('%s').apply_to(model) to directly apply the
transformation to the model instance.""" % (name,name,) )

        xfrm = TransformationFactory(name)
        if xfrm is None:
            raise ValueError("Unknown model transformation '%s'" % name)
        return xfrm.apply_to(self, **kwds)
예제 #6
0
파일: dual.py 프로젝트: qtothec/pyomo
 def _dualize(self, submodel, unfixed):
     """
     Generate the dual of a submodel
     """
     transform = TransformationFactory("core.linear_dual")
     return transform._dualize(submodel, unfixed)
예제 #7
0
파일: connector.py 프로젝트: xfLee/pyomo
 def apply(self, **kwds):
     instance = kwds.pop('instance')
     xform = TransformationFactory('core.expand_connectors')
     xform.apply_to(instance, **kwds)
     return instance
예제 #8
0
파일: connector.py 프로젝트: qtothec/pyomo
 def apply(self, **kwds):
     instance = kwds.pop('instance')
     xform = TransformationFactory('core.expand_connectors')
     xform.apply_to(instance, **kwds)
     return instance
예제 #9
0
 def _dualize(self, submodel, unfixed):
     """
     Generate the dual of a submodel
     """
     transform = TransformationFactory('core.linear_dual')
     return transform._dualize(submodel, unfixed)