コード例 #1
0
ファイル: PyomoModel.py プロジェクト: Juanlu001/pyomo
 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):
     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)
コード例 #3
0
ファイル: PyomoModel.py プロジェクト: qtothec/pyomo
    def transform(self, name=None, **kwds):
        if name is None:
            logger.warning(
"""DEPRECATION WARNING: Model.transform() is deprecated.  Use
TransformationFactory().services() method to get the list of known
transformations.""")
            return TransformationFactory.services()

        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)
コード例 #4
0
    def transform(self, name=None, **kwds):
        if name is None:
            logger.warning(
"""DEPRECATION WARNING: Model.transform() is deprecated.  Use
TransformationFactory().services() method to get the list of known
transformations.""")
            return TransformationFactory.services()

        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)