Deprecation and Removal of Functionality

During the course of development, there may be cases where it becomes necessary to deprecate or remove functionality from the standard Pyomo offering.

Deprecation

We offer a set of tools to help with deprecation in pyomo.common.deprecation.

By policy, when deprecating or moving an existing capability, one of the following utilities should be leveraged. Each has a required version argument that should be set to current development version (e.g., "6.6.2.dev0"). This version will be updated to the next actual release as part of the Pyomo release process. The current development version can be found by running

pyomo --version

on your local fork/branch.

deprecated([msg, logger, version, remove_in])

Decorator to indicate that a function, method, or class is deprecated.

deprecation_warning(msg[, logger, version, ...])

Standardized function for formatting and emitting deprecation warnings.

moved_module(old_name, new_name[, msg, ...])

Provide a deprecation path for moved / renamed modules

relocated_module_attribute(local, target, ...)

Provide a deprecation path for moved / renamed module attributes

RenamedClass(name, bases, classdict, *args, ...)

Metaclass to provide a deprecation path for renamed classes

Removal

By policy, functionality should be deprecated with reasonable warning, pending extenuating circumstances. The functionality should be deprecated, following the information above.

If the functionality is documented in the most recent edition of Pyomo - Optimization Modeling in Python, it may not be removed until the next major version release.

For other functionality, it is preferred that ample time is given before removing the functionality. At minimum, significant functionality removal will result in a minor version bump.