def help_transformations(): import pyomo.environ from pyomo.core import TransformationFactory wrapper = textwrap.TextWrapper() wrapper.initial_indent = ' ' wrapper.subsequent_indent = ' ' print("") print("Pyomo Model Transformations") print("---------------------------") for xform in sorted(TransformationFactory): print(" " + xform) _doc = TransformationFactory.doc(xform) or "" # Ideally, the Factory would ensure that the doc string # indicated deprecation, but as @deprecated() is Pyomo # functionality and the Factory comes directly from PyUtilib, # PyUtilib probably shouldn't contain Pyomo-specific processing. # The next best thing is to ensure that the deprecation status # is indicated here. _init_doc = TransformationFactory.get_class(xform).__init__.__doc__ \ or "" if _init_doc.strip().startswith( 'DEPRECATED') and 'DEPRECAT' not in _doc: _doc = ' '.join(('[DEPRECATED]', _doc)) if _doc: print(wrapper.fill(_doc))
def help_transformations(): import pyomo.environ from pyomo.core import TransformationFactory wrapper = textwrap.TextWrapper() wrapper.initial_indent = ' ' wrapper.subsequent_indent = ' ' print("") print("Pyomo Model Transformations") print("---------------------------") for xform in sorted(TransformationFactory.services()): print(" " + xform) print(wrapper.fill(TransformationFactory.doc(xform)))
def help_transformations(): import pyomo.environ from pyomo.core import TransformationFactory wrapper = textwrap.TextWrapper() wrapper.initial_indent = ' ' wrapper.subsequent_indent = ' ' print("") print("Pyomo Model Transformations") print("---------------------------") for xform in sorted(TransformationFactory.services()): print(" "+xform) print(wrapper.fill(TransformationFactory.doc(xform)))