MovedModuleFinder

(class from pyomo.common.deprecation)

class pyomo.common.deprecation.MovedModuleFinder[source]

Bases: object

Custom finder that supports loading a module through an alternative name.

This class implements the importlib.abc.Finder interface (through duck-typing to avoid a surprisingly costly import of importlib.abc).

Pyomo automatically registers a single instance of this finder with importlib by appending it to the end of the sys.meta_path list when this module is imported. Subsequent calls to moved_module() register the association between the old and new module names with the mapping class attribute.

__init__()

Methods

__init__()

find_spec(fullname, path[, target])

invalidate_caches()

Attributes

mapping

dict that maps (removed) module names to MovedModuleInfo objects

Member Documentation

mapping = {'pyomo.__future__': ('pyomo.__future__', 'pyomo.future', None, None, None, None), 'pyomo.common.getGSL': ('pyomo.common.getGSL', 'pyomo.common.gsl', NOTSET, None, '6.5.0', None), 'pyomo.common.plugin': ('pyomo.common.plugin', 'pyomo.common.plugin_base', NOTSET, None, '6.5.0', None), 'pyomo.contrib.incidence_analysis.util': ('pyomo.contrib.incidence_analysis.util', 'pyomo.contrib.incidence_analysis.scc_solver', "The 'pyomo.contrib.incidence_analysis.util' module has been moved to 'pyomo.contrib.incidence_analysis.scc_solver'. However, we recommend importing this functionality (e.g. solve_strongly_connected_components) directly from 'pyomo.contrib.incidence_analysis'.", None, '6.5.0', None), 'pyomo.contrib.parmest.ipopt_solver_wrapper': ('pyomo.contrib.parmest.ipopt_solver_wrapper', 'pyomo.contrib.parmest.utils.ipopt_solver_wrapper', NOTSET, None, '6.4.2', None), 'pyomo.contrib.simplemodel': ('pyomo.contrib.simplemodel', 'pyomocontrib_simplemodel', 'The use of pyomo.contrib.simplemodel is deprecated. This capability is now supported in the pyomocontrib_simplemodel package, which is included in the pyomo_community distribution.', None, '5.6.9', None), 'pyomo.core.base.plugin': ('pyomo.core.base.plugin', 'pyomo._archive.plugin', 'The pyomo.core.base.plugin module is deprecated.  See pyomo.core.base.transformation for Transformation and TransformationFactory, pyomo.core.base.component for ModelComponentFactory and pyomo.scripting.interface for IPyomoScript* interfaces.', None, '6.0', None), 'pyomo.core.base.rangeset': ('pyomo.core.base.rangeset', 'pyomo._archive.rangeset', 'The pyomo.core.base.rangeset module is deprecated.  Import RangeSet objects from pyomo.core.base.set or pyomo.core.', None, '5.7', None), 'pyomo.core.base.sets': ('pyomo.core.base.sets', 'pyomo._archive.sets', 'The pyomo.core.base.sets module is deprecated.  Import Set objects from pyomo.core.base.set or pyomo.core.', None, '5.7', None), 'pyomo.core.base.template_expr': ('pyomo.core.base.template_expr', 'pyomo._archive.template_expr', 'The pyomo.core.base.template_expr module is deprecated.  Import expression template objects from pyomo.core.expr.template_expr.', None, '5.7', None), 'pyomo.core.expr.current': ('pyomo.core.expr.current', 'pyomo._archive.current', 'pyomo.core.expr.current is deprecated.  Please import expression symbols from pyomo.core.expr', None, '6.6.2', None), 'pyomo.core.kernel.component_map': ('pyomo.core.kernel.component_map', 'pyomo._archive.component_map', 'The pyomo.core.kernel.component_map module is deprecated.  Import ComponentMap from pyomo.common.collections.', None, '5.7.1', None), 'pyomo.core.kernel.component_set': ('pyomo.core.kernel.component_set', 'pyomo._archive.component_set', 'The pyomo.core.kernel.component_set module is deprecated.  Import ComponentSet from pyomo.common.collections.', None, '5.7.1', None), 'pyomo.core.kernel.register_numpy_types': ('pyomo.core.kernel.register_numpy_types', 'pyomo._archive.register_numpy_types', 'pyomo.core.kernel.register_numpy_types is deprecated.  NumPy type registration is handled automatically by pyomo.common.dependencies.numpy', None, '6.1', None), 'pyomo.gdp.plugins.chull': ('pyomo.gdp.plugins.chull', 'pyomo._archive.chull', 'The pyomo.gdp.plugins.chull module is deprecated.  Import the Hull reformulation objects from pyomo.gdp.plugins.hull.', None, '5.7', None), 'pyomo.pysp': ('pyomo.pysp', 'pysp', 'PySP has been removed from the pyomo.pysp namespace.  Beginning in Pyomo 6.0, PySP is distributed as a separate package.  Please see https://github.com/Pyomo/pysp for information on downloading and installing PySP', None, '6.0', None)}

dict that maps (removed) module names to MovedModuleInfo objects