MovedModuleFinder
(类来自 pyomo.common.deprecation)
- class pyomo.common.deprecation.MovedModuleFinder[source]
基础类:
object支持通过替代名称加载模块的自定义查找器。
这个类实现了
importlib.abc.Finder接口 (通过鸭子类型来避免意外昂贵的导入importlib.abc)。Pyomo 在导入此模块时,会自动将一个此查找器的实例注册到
importlib,方法是将其附加到sys.meta_path列表的末尾。随后对moved_module()的调用会将旧模块名和新模块名之间的关联注册到mapping类属性中。- __init__()
方法
__init__()find_spec(fullname, path[, target])invalidate_caches()属性
dict将(已移除的)模块名称映射到MovedModuleInfo对象成员文档
- 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将(已移除的)模块名称映射到MovedModuleInfo对象