diff --git a/.gitignore b/.gitignore index 9550b0773f7..e4ff1b24149 100644 --- a/.gitignore +++ b/.gitignore @@ -16,6 +16,7 @@ __pycache__/ *.egg-info/ # Documentation builds +doc/OnlineDocs/api doc/OnlineDocs/_build doc/OnlineDocs/**/*.spy diff --git a/doc/OnlineDocs/contribution_guide.rst b/doc/OnlineDocs/contribution_guide.rst index 6a3298a81d4..6bad41ca128 100644 --- a/doc/OnlineDocs/contribution_guide.rst +++ b/doc/OnlineDocs/contribution_guide.rst @@ -75,6 +75,35 @@ at least 70% coverage of the lines modified in the PR and prefer coverage closer to 90%. We also require that all tests pass before a PR will be merged. +Tests must import the Pyomo test harness from +``pyomo.common.unittest`` instead of using Python's built-in +``unittest`` module directly. This wrapper extends the standard testing +framework with Pyomo-specific capabilities, including automatic plugin +discovery, solver availability checks, and improved test filtering +controls. Using the provided interface ensures that all tests run +consistently across Pyomo's multiple CI environments. +A small example is shown below: + +.. code-block:: python + + import pyomo.common.unittest as unittest + + class TestSomething(unittest.TestCase): + def test_basic(self): + self.assertEqual(1 + 1, 2) + +Developers can also use any of the predefined ``pytest`` markers to categorize +their tests appropriately. +Markers are declared in ``pyproject.toml``. Some commonly used markers are: + +- ``expensive``: tests that take a long time to run +- ``mpi``: tests that require MPI +- ``solver(name)``: dynamic marker to label a test for a specific solver, + e.g., ``@pytest.mark.solver("gurobi")`` + +More details about Pyomo-defined default test behavior can be found in +the `conftest.py file `_. + .. note:: If you are having issues getting tests to pass on your Pull Request, please tag any of the core developers to ask for help. @@ -336,33 +365,48 @@ Finally, move to the directory containing the clone of your Pyomo fork and run: :: - pip install -e . + pip install -e .[tests,docs,optional] These commands register the cloned code with the active python environment -(``pyomodev``). This way, your changes to the source code for ``pyomo`` are +(``pyomodev``) and installs all possible optional dependencies. +This way, your changes to the source code for ``pyomo`` are automatically used by the active environment. You can create another conda environment to switch to alternate versions of pyomo (e.g., stable). +.. note:: + + The ``optional`` and ``docs`` dependencies are not strictly required; + however, we recommend installing them to ensure that a large number of + tests can be run locally. Optional packages that are not available will + cause tests to skip. + Review Process -------------- After a PR is opened it will be reviewed by at least two members of the core development team. The core development team consists of anyone with -write-access to the Pyomo repository. Pull requests opened by a core +write-access to the Pyomo repository. PRs opened by a core developer only require one review. The reviewers will decide if they think a PR should be merged or if more changes are necessary. Reviewers look for: - - * Outside of ``pyomo.contrib``: Code rigor and standards, edge cases, - side effects, etc. - * Inside of ``pyomo.contrib``: No “glaringly obvious” problems with - the code - * Documentation and tests -The core development team tries to review pull requests in a timely -manner but we make no guarantees on review timeframes. In addition, PRs -might not be reviewed in the order they are opened in. +* **Core and Addons:** Code rigor, standards compliance, test coverage above + a threshold, and avoidance of unintended side effects (e.g., regressions) +* **Devel:** Basic code correctness and clarity, with an understanding that + these areas are experimental and evolving +* **All areas:** Code formatting (using ``black``), documentation, and tests + +.. note:: + + For more information about Pyomo's development principles and the + stability expectations for ``addons`` and ``devel``, see + :doc:`/principles`. + +The core development team tries to review PRs in a timely +manner, but we make no guarantees on review timeframes. In addition, PRs +might not be reviewed in the order in which they are opened. + Where to put contributed code ----------------------------- @@ -372,58 +416,110 @@ git repository. Next, you should create a branch on your fork dedicated to the development of the new feature or bug fix you're interested in. Once you have this branch checked out, you can start coding. Bug fixes and minor enhancements to existing Pyomo functionality should be -made in the appropriate files in the Pyomo code base. New examples, -features, and packages built on Pyomo should be placed in -``pyomo.contrib``. Follow the link below to find out if -``pyomo.contrib`` is right for your code. - -``pyomo.contrib`` ------------------ - -Pyomo uses the ``pyomo.contrib`` package to facilitate the inclusion -of third-party contributions that enhance Pyomo's core functionality. -The are two ways that ``pyomo.contrib`` can be used to integrate -third-party packages: - -* ``pyomo.contrib`` can provide wrappers for separate Python packages, thereby - allowing these packages to be imported as subpackages of pyomo. - -* ``pyomo.contrib`` can include contributed packages that are developed and - maintained outside of the Pyomo developer team. - -Including contrib packages in the Pyomo source tree provides a +made in the appropriate files in the Pyomo code base. + +Larger features, new modeling components, or experimental functionality +should be placed in one of Pyomo's extension namespaces, described below. + +Namespaces for Contributed and Experimental Code +++++++++++++++++++++++++++++++++++++++++++++++++ + +Pyomo has a long history of supporting community-developed extensions. +Historically, all such contributions were placed under the +``pyomo.contrib`` namespace. This structure allowed new modeling tools and +algorithms to be shared quickly, but over time it became difficult for users +to distinguish between more stable, supported functionality and +experimental or research-oriented code. + +As a result, Pyomo is transitioning to a more structured contribution +model with two clear namespaces: + +* ``pyomo.addons`` – For mostly stable, supported extensions that build on + the Pyomo core. These packages are maintained by dedicated + contributors, follow Pyomo's coding and testing standards, and adhere + to the same backwards compatibility and deprecation policies as the + rest of the codebase. + +* ``pyomo.devel`` – For experimental or rapidly evolving + contributions. These modules serve as early experimentation for research ideas, + prototypes, or specialized modeling components. Functionality under + this namespace may change or be removed between releases without + deprecation warnings. + +This two-tiered structure provides contributors a clear pathway from +**experimentation to supported integration**, while protecting users from +unexpected changes in stable areas of the codebase. + +.. list-table:: + :header-rows: 1 + :widths: 20 30 50 + + * - Namespace + - Intended Use + - Stability + * - ``pyomo.devel`` + - Active research and experimental code + - Unstable; APIs may change without warning + * - ``pyomo.addons`` + - Mostly stable, supported extensions maintained by contributors + - Mostly stable APIs; follow Pyomo's standards + * - ``pyomo`` + - Core Pyomo modeling framework + - Fully supported and versioned + +For specific inclusion requirements and maintenance expectations for each +namespace, see each directory's accompanying ``README.md``. + +Submitting a Contributed Package +-------------------------------- + +Including contributed packages in the Pyomo source tree provides a convenient mechanism for defining new functionality that can be -optionally deployed by users. We expect this mechanism to include +optionally deployed by users. We expect this mechanism to include Pyomo extensions and experimental modeling capabilities. However, -contrib packages are treated as optional packages, which are not -maintained by the Pyomo developer team. Thus, it is the responsibility +contributed packages are treated as optional packages, which are not +maintained by the Pyomo developer team. Thus, it is the responsibility of the code contributor to keep these packages up-to-date. -Contrib package contributions will be considered as pull-requests, -which will be reviewed by the Pyomo developer team. Specifically, +Contributed packages will be considered as pull requests, +which will be reviewed by the Pyomo developer team. Specifically, this review will consider the suitability of the proposed capability, whether tests are available to check the execution of the code, and whether documentation is available to describe the capability. -Contrib packages will be tested along with Pyomo. If test failures +Contributed packages will be tested along with Pyomo. If test failures arise, then these packages will be disabled and an issue will be -created to resolve these test failures. +created to resolve these test failures. The Pyomo team reserves the +right to remove contributed packages that are not maintained. -Contrib Packages within Pyomo -+++++++++++++++++++++++++++++ +When submitting a new contributed package (under either ``addons`` or +``devel``), please ensure that: + +* The package has at least one maintainer responsible for its upkeep. +* The code includes tests that can be run through Pyomo's + continuous integration framework. +* The package includes a README or module-level documentation that + clearly describes its purpose and usage. +* Optional dependencies are properly declared in ``setup.py`` + under the appropriate ``[optional]`` section. +* The contribution passes all standard style and formatting checks. + +Contributed Packages within Pyomo ++++++++++++++++++++++++++++++++++ Third-party contributions can be included directly within the -``pyomo.contrib`` package. The ``pyomo/contrib/example`` package +``pyomo.devel`` or ``pyomo.addons`` namespaces. +The ``pyomo/devel/example`` package provides an example of how this can be done, including a directory -for plugins and package tests. For example, this package can be -imported as a subpackage of ``pyomo.contrib``:: +for plugins and package tests. For example, this package can be +imported as a subpackage of ``pyomo.devel``:: import pyomo.environ as pyo - from pyomo.contrib.example import a + from pyomo.devel.example import a # Print the value of 'a' defined by this package print(a) -Although ``pyomo.contrib.example`` is included in the Pyomo source +Although ``pyomo.devel.example`` is included in the Pyomo source tree, it is treated as an optional package. Pyomo will attempt to import this package, but if an import failure occurs, Pyomo will silently ignore it. Otherwise, this pyomo package will be treated @@ -432,4 +528,3 @@ like any other. Specifically: * Plugin classes defined in this package are loaded when ``pyomo.environ`` is loaded. * Tests in this package are run with other Pyomo tests. - diff --git a/doc/OnlineDocs/getting_started/installation.rst b/doc/OnlineDocs/getting_started/installation.rst index adfc6f11dec..f69a8db4e99 100644 --- a/doc/OnlineDocs/getting_started/installation.rst +++ b/doc/OnlineDocs/getting_started/installation.rst @@ -42,18 +42,16 @@ the following in a shell: pip install pyomo -Conditional Dependencies -~~~~~~~~~~~~~~~~~~~~~~~~ +Optional Dependencies +~~~~~~~~~~~~~~~~~~~~~ Extensions to Pyomo, and many of the contributions in ``pyomo.contrib``, -often have conditional dependencies on a variety of third-party Python +often depend on additional third-party Python packages including but not limited to: matplotlib, networkx, numpy, -openpyxl, pandas, pint, pymysql, pyodbc, pyro4, scipy, sympy, and -xlrd. +openpyxl, pandas, pint, scipy, sympy, and xlrd. A full list of optional dependencies can be found in Pyomo's -``pyproject.toml`` under the ``[project.optional-dependencies]`` table. -They can be displayed by running: +``setup.py``. They can be displayed by running: :: @@ -65,14 +63,14 @@ They can be displayed by running: Pyomo extensions that require any of these packages will generate an error message for missing dependencies upon use. -When using *pip*, all conditional dependencies can be installed at once +When using *pip*, all optional dependencies can be installed at once using the following command: :: pip install 'pyomo[optional]' -When using *conda*, many of the conditional dependencies are included +When using *conda*, many of the optional dependencies are included with the standard Anaconda installation. You can check which Python packages you have installed using the command diff --git a/doc/OnlineDocs/principles.rst b/doc/OnlineDocs/principles.rst new file mode 100644 index 00000000000..a1045b6af41 --- /dev/null +++ b/doc/OnlineDocs/principles.rst @@ -0,0 +1,193 @@ +Development Principles +====================== + +The Pyomo development team follows a set of development principles. +In order to promote overall transparency, this page is intended to document +those principles, to the best of our ability, for users and potential +contributors alike. Please also review Pyomo's recent publication +on the history of its development for a holistic view into the changes +of these principles over time [MHJ+25]_. + +Backwards Compatibility +----------------------- + +Commitment to Published Interfaces +++++++++++++++++++++++++++++++++++ + +If functionality is published in the most recent edition of the +Pyomo book [PyomoBookIII]_ and corresponding examples, we treat that as +a public API commitment. Once published in the book, those APIs will not +change until the next major Pyomo release, which will coincide with a +new edition of the book. + +This commitment ensures that teaching materials, training resources, and +long-term codebases built on those examples will remain valid across an +entire major release. + +Stable, Supported APIs +++++++++++++++++++++++ + +Functionality that is part of the Pyomo source tree but not explicitly +included in the book is also expected to be stable if it resides outside +the ``contrib`` (or future ``addons`` / ``devel``) directories. This is +referred to as "core" by the Pyomo development team. + +When changes to core APIs become necessary, we will endeavor to follow one +(or both) of the following steps: + +1. **Deprecation warnings** are added in advance of functionality removal. + These are visible to users at import or execution time, + with clear guidance on replacement functionality. +2. **Relocation warnings** are provided for any relocated functionality. + These modules import from their old locations and print a warning about + the relocation in order to assist users' transition. + +Ideally, changes in this fashion can allow users and downstream packages +to adapt gradually without abrupt breakage. + +.. note:: + + For detailed guidance on how to mark functionality for deprecation or + removal within the Pyomo codebase, see + :doc:`/explanation/developer_utils/deprecation`. + +Experimental and Contributed Code ++++++++++++++++++++++++++++++++++ + +Historically, all contributed and experimental functionality has lived +under ``pyomo.contrib``. These packages are community-driven extensions +that may evolve rapidly as research and experimentation continue. Users +should not rely on API stability within this space. + +Pyomo is currently transitioning to a clearer organizational model that +distinguishes between two categories: + +* ``pyomo.addons`` – Mostly stable, supported extensions maintained by + specific contributors. + +* ``pyomo.devel`` – Active research and experimental code. + +The guiding philosophy is to protect users from surprises in stable +interfaces while continuing to enable innovation and experimentation +in development areas. + +.. note:: + + For procedural guidance on how to structure and submit new + contributions to Pyomo, please visit :doc:`contribution_guide`. + +Dependency Management +--------------------- + +Minimal Core Dependencies ++++++++++++++++++++++++++ + +Pyomo core is intentionally designed to have only one required +dependency: ``ply``. This ensures that the base functionality of Pyomo +can operate using only standard Python libraries and ``ply``. + +This approach promotes overall ease of installation, allowing other packages +to depend and be built upon Pyomo. +Additionally, this allows users to install and run Pyomo in +resource-constrained or isolated environments (such as teaching +containers or HPC systems). All additional packages are optional. + +Optional Dependencies ++++++++++++++++++++++ + +Pyomo supports a number of optional dependencies that enhance its +functionality. These are grouped into three categories: + +* **Tests** – Dependencies needed only to run the automated test suite + and continuous integration infrastructure (e.g., ``pytest``, + ``parameterized``, ``coverage``). + +* **Docs** – Dependencies needed to build the Sphinx-based documentation + (e.g., ``sphinx``, ``sphinx_rtd_theme``, ``numpydoc``). + +* **Optional** – Dependencies that enable extended + functionality throughout the Pyomo codebase, such as numerical + computations or data handling (e.g., ``numpy``, ``pandas``, + ``matplotlib``). + +These optional dependencies can be installed selectively using standard +``pip`` commands. For example: + +:: + + pip install pyomo[optional] + pip install pyomo[tests,docs] + +Pyomo's continuous integration infrastructure regularly tests against +the most recent versions of all optional dependencies to ensure that +Pyomo remains compatible with current releases in the Python ecosystem. +When incompatibilities are identified, the setup configuration is +updated accordingly. + +.. note:: + + For more information on installing Pyomo with optional extras, + see :doc:`/getting_started/installation`. + +Solvers ++++++++ + +Pyomo does not bundle or directly distribute optimization solvers. +We recognize that solver installation can be challenging for new users. +To assist with this process, see the solver +availability table and installation guidance in +:doc:`/getting_started/solvers`. This table lists solvers that can be +installed via ``pip`` or ``conda`` where available, but Pyomo itself +does not include or require any specific solver as a dependency. + +Miscellaneous Conventions +------------------------- + +There are a variety of long-standing conventions that have become +standard across the project. This list will be amended as conventions come +up, so please refer regularly for updates: + +* **Environment imports:** Import the main Pyomo environment as + ``import pyomo.environ as pyo``. + Avoid ``from pyomo.environ import *`` or alternative aliases. + Additionally, avoid all uses of ``import *``. + +* **Export lists:** Do not define ``__all__`` in modules. + Public symbols are determined by naming and documentation, not explicit lists. + +* **Circular imports:** Avoid importing from ``pyomo.core`` into any module + in ``pyomo.common`` due to the potential for circular imports. + +* **Print statements:** Avoid printing directly to ``stdout``. Pyomo is a + library, not an application, and copious output can interfere with downstream + tools and workflows. Use the appropriate logger instead. Print + information only when the user has enabled or requested it. + +* **Pull Request naming:** Pull Request titles are added to the CHANGELOG + and the release notes. The Pyomo development team reserves the right to + alter titles as appropriate to ensure they fit the look and feel of + other titles in the CHANGELOG. + +* **Full commit history:** We do **not** squash-merge Pull Requests, + preferring to retain the entire commit history. + +* **URLs:** All links in code, comments, and documentation must use ``https`` + rather than ``http``. + +* **File headers:** Every ``.py`` file must begin with the standard Pyomo + copyright header: + + .. code-block:: text + + # ___________________________________________________________________________ + # + # Pyomo: Python Optimization Modeling Objects + # Copyright (c) 2008-2025 + # National Technology and Engineering Solutions of Sandia, LLC + # Under the terms of Contract DE-NA0003525 with National Technology and + # Engineering Solutions of Sandia, LLC, the U.S. Government retains certain + # rights in this software. + # This software is distributed under the 3-clause BSD License. + # ___________________________________________________________________________ + + Update the year range as appropriate when modifying files. diff --git a/doc/OnlineDocs/reference/bibliography.rst b/doc/OnlineDocs/reference/bibliography.rst index 08c9f0e5fe0..b92ee1ca1af 100644 --- a/doc/OnlineDocs/reference/bibliography.rst +++ b/doc/OnlineDocs/reference/bibliography.rst @@ -134,6 +134,12 @@ Bibliography Intermediate Relaxations between big-M and Convex Hull Reformulations". 2021. https://arxiv.org/abs/2101.12708 +.. [MHJ+25] M. Mundt, W. E. Hart, E. S. Johnson, B. Nicholson, and + J. D. Siirola. "Pyomo: Accidentally outrunning the bear", *Patterns*, + 6(7), 101311. 2025. ISSN 2666-3899. DOI + `10.1016/j.patter.2025.101311 + `_ + .. [NW88] G. L. Nemhauser and L. A. Wolsey. *Integer and combinatorial optimization*, New York: Wiley. 1988. diff --git a/doc/OnlineDocs/reference/index.rst b/doc/OnlineDocs/reference/index.rst index 6941c951c8c..06228f60ece 100644 --- a/doc/OnlineDocs/reference/index.rst +++ b/doc/OnlineDocs/reference/index.rst @@ -16,6 +16,7 @@ Reference Guides .. toctree:: :maxdepth: 1 + ../principles future ../errors ../related_packages diff --git a/pyomo/addons/README.md b/pyomo/addons/README.md new file mode 100644 index 00000000000..a78895f3ae4 --- /dev/null +++ b/pyomo/addons/README.md @@ -0,0 +1,58 @@ +# Pyomo Addons + +The `pyomo.addons` directory contains **mostly stable extensions** to Pyomo +that are **not part of the core library*. These packages extend Pyomo's +modeling, solver, and analysis capabilities, and have demonstrated sufficient +maturity, documentation, and testing. + +## Purpose + +`pyomo.addons` houses packages that: + +- Have **mostly stable APIs** suitable for downstream use. +- Are **sufficiently documented** and **tested**. +- Represent functionality that is **useful to the wider Pyomo community** but + not required for core operation. + +Examples include: +- `gdpopt` +- `incidence_analysis` +- `latex_printer` +- `trustregion` +- `viewer` + +## Requirements + +A package may be accepted into `pyomo.addons` once it meets all of the +following criteria. + +### Stability and Maintenance +- The code must be **mostly stable** with minimal expected API changes. +- There must be at least one **designated maintainer** responsible for upkeep, + compatibility, and user support. +- The package must not rely on deprecated or `pyomo.devel` functionality. + +### Testing +- Test coverage should be **at least 80%**, or comparable to similar supported modules. +- Tests must run successfully within the Pyomo CI environment. +- Expensive, solver-specific, or optional tests should be properly marked + (e.g., with `@pytest.mark.expensive`, `@pytest.mark.solver`). + +### Documentation +- Each addon must include: + - (PREFERABLE) A **reference page** in the Pyomo online documentation. + - (MINIMUM) A **README.md** file summarizing: + - Functionality + - Example usage or link to docs + +### Dependencies +- Addons **may not introduce required dependencies** for Pyomo core. +- Optional dependencies must be: + - Declared in `setup.py` under the appropriate category. + - Publicly available on PyPI and/or Anaconda and reasonably maintained. + +### Backward Compatibility +- Addons are expected to maintain **backward-compatible APIs** between minor + Pyomo releases. +- Breaking changes must follow the documented **deprecation process** and + appear in release notes. diff --git a/pyomo/addons/__init__.py b/pyomo/addons/__init__.py new file mode 100644 index 00000000000..6eb9ea8b81d --- /dev/null +++ b/pyomo/addons/__init__.py @@ -0,0 +1,10 @@ +# ___________________________________________________________________________ +# +# Pyomo: Python Optimization Modeling Objects +# Copyright (c) 2008-2025 +# National Technology and Engineering Solutions of Sandia, LLC +# Under the terms of Contract DE-NA0003525 with National Technology and +# Engineering Solutions of Sandia, LLC, the U.S. Government retains certain +# rights in this software. +# This software is distributed under the 3-clause BSD License. +# ___________________________________________________________________________ diff --git a/pyomo/devel/README.md b/pyomo/devel/README.md new file mode 100644 index 00000000000..faf4624ef5b --- /dev/null +++ b/pyomo/devel/README.md @@ -0,0 +1,48 @@ +# Pyomo Devel + +The `pyomo.devel` directory contains **experimental, research-oriented, or +rapidly evolving** extensions to Pyomo. These packages are **not guaranteed to +be stable** and may change or be removed between releases **without +deprecation warnings**. + +## Purpose + +`pyomo.devel` is intended for: + +- Experimental algorithms and modeling approaches. +- Research prototypes under active development. +- Functionality that is **not yet ready for long-term API guarantees**. +- Work that may later graduate into `pyomo.addons` after sufficient + maturity, including testing and documentation. + +Examples include: +- `doe` +- `piecewise` +- `solver` +- `sensitivity_toolbox` + +## Expectations + +Packages placed in `pyomo.devel` are **encouraged to be exploratory** but must +still meet basic project standards to ensure they do not break the broader +Pyomo ecosystem. + +### Stability +- APIs in this directory are **not stable** and **may change or be removed** + without notice. +- Users should not rely on `pyomo.devel` components for production workflows. + +### Testing +- All `devel` packages must include **basic tests** verifying import and + execution of key components. +- Tests should run under Pyomo's CI but may be skipped in qualifying scenarios. + +### Documentation +- At minimum, each package should contain: + - A **README.md** describing the purpose and experimental status. + +### Dependencies +- Packages in `devel` **may not introduce required dependencies** for Pyomo core. +- Optional dependencies must be: + - Declared in `setup.py` under the appropriate category. + - Publicly available on PyPI and/or Anaconda and reasonably maintained. diff --git a/pyomo/devel/__init__.py b/pyomo/devel/__init__.py new file mode 100644 index 00000000000..6eb9ea8b81d --- /dev/null +++ b/pyomo/devel/__init__.py @@ -0,0 +1,10 @@ +# ___________________________________________________________________________ +# +# Pyomo: Python Optimization Modeling Objects +# Copyright (c) 2008-2025 +# National Technology and Engineering Solutions of Sandia, LLC +# Under the terms of Contract DE-NA0003525 with National Technology and +# Engineering Solutions of Sandia, LLC, the U.S. Government retains certain +# rights in this software. +# This software is distributed under the 3-clause BSD License. +# ___________________________________________________________________________ diff --git a/pyomo/contrib/example/__init__.py b/pyomo/devel/example/__init__.py similarity index 82% rename from pyomo/contrib/example/__init__.py rename to pyomo/devel/example/__init__.py index de53fcf28be..cdaa20801db 100644 --- a/pyomo/contrib/example/__init__.py +++ b/pyomo/devel/example/__init__.py @@ -12,18 +12,18 @@ # # Import "public" symbols and sub-packages. # -from pyomo.contrib.example.foo import * -from pyomo.contrib.example import bar +from pyomo.devel.example.foo import a +from pyomo.devel.example import bar # # Register plugins from this sub-package. # # The pyomo.environ package normally calls the load() function in a -# hard-coded list of pyomo.*.plugins and pyomo.contrib.*.plugins +# hard-coded list of pyomo.*.plugins and pyomo.devel.*.plugins # modules. However, This example is not included in that list, so we # will load (and register) the plugins when this module (or any # submodule) is imported. # -from pyomo.contrib.example.plugins import load +from pyomo.devel.example.plugins import load load() diff --git a/pyomo/contrib/example/bar.py b/pyomo/devel/example/bar.py similarity index 100% rename from pyomo/contrib/example/bar.py rename to pyomo/devel/example/bar.py diff --git a/pyomo/contrib/example/foo.py b/pyomo/devel/example/foo.py similarity index 100% rename from pyomo/contrib/example/foo.py rename to pyomo/devel/example/foo.py diff --git a/pyomo/contrib/example/plugins/__init__.py b/pyomo/devel/example/plugins/__init__.py similarity index 92% rename from pyomo/contrib/example/plugins/__init__.py rename to pyomo/devel/example/plugins/__init__.py index 35e25c54767..9f077eaf1b1 100644 --- a/pyomo/contrib/example/plugins/__init__.py +++ b/pyomo/devel/example/plugins/__init__.py @@ -14,4 +14,4 @@ def load(): - from pyomo.contrib.example.plugins import ex_plugin + from pyomo.devel.example.plugins import ex_plugin diff --git a/pyomo/contrib/example/plugins/ex_plugin.py b/pyomo/devel/example/plugins/ex_plugin.py similarity index 90% rename from pyomo/contrib/example/plugins/ex_plugin.py rename to pyomo/devel/example/plugins/ex_plugin.py index ac9d514c298..f0cd4ee40eb 100644 --- a/pyomo/contrib/example/plugins/ex_plugin.py +++ b/pyomo/devel/example/plugins/ex_plugin.py @@ -13,8 +13,7 @@ @TransformationFactory.register( - 'contrib.example.xfrm', - doc="An example of a transformation in a pyomo.contrib package", + 'devel.example.xfrm', doc="An example of a transformation in a pyomo.devel package" ) class Xfrm_PyomoTransformation(Transformation): def __init__(self): diff --git a/pyomo/contrib/example/tests/__init__.py b/pyomo/devel/example/tests/__init__.py similarity index 94% rename from pyomo/contrib/example/tests/__init__.py rename to pyomo/devel/example/tests/__init__.py index 57b9c2e9faa..038c4599079 100644 --- a/pyomo/contrib/example/tests/__init__.py +++ b/pyomo/devel/example/tests/__init__.py @@ -9,4 +9,4 @@ # This software is distributed under the 3-clause BSD License. # ___________________________________________________________________________ -# Tests for pyomo.contrib.example +# Tests for pyomo.devel.example diff --git a/pyomo/contrib/example/tests/test_example.py b/pyomo/devel/example/tests/test_example.py similarity index 87% rename from pyomo/contrib/example/tests/test_example.py rename to pyomo/devel/example/tests/test_example.py index 6586461337c..122ddc4b67b 100644 --- a/pyomo/contrib/example/tests/test_example.py +++ b/pyomo/devel/example/tests/test_example.py @@ -10,11 +10,11 @@ # ___________________________________________________________________________ # -# Only run the tests in this package if the pyomo.contrib.example package +# Only run the tests in this package if the pyomo.devel.example package # has been successfully imported. # -import pyomo.contrib.example +import pyomo.devel.example import pyomo.common.unittest as unittest diff --git a/pyomo/environ/__init__.py b/pyomo/environ/__init__.py index be01195b3d6..f2c105790c0 100644 --- a/pyomo/environ/__init__.py +++ b/pyomo/environ/__init__.py @@ -40,7 +40,6 @@ def _do_import(pkg_name): 'pyomo.contrib.community_detection', 'pyomo.contrib.cp', 'pyomo.contrib.cspline_external', - 'pyomo.contrib.example', 'pyomo.contrib.fme', 'pyomo.contrib.gdp_bounds', 'pyomo.contrib.gdpopt', @@ -55,6 +54,7 @@ def _do_import(pkg_name): 'pyomo.contrib.simplification', 'pyomo.contrib.solver', 'pyomo.contrib.trustregion', + 'pyomo.devel.example', ]