-
Notifications
You must be signed in to change notification settings - Fork 526
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
529 changed files
with
19,047 additions
and
14,023 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,70 @@ | ||
Pyomo leverages ``make`` to generate documentation. The following two | ||
sections describe how to build and test the online documentation | ||
locally. | ||
|
||
> **NOTE**: All commands assume you are running from the *root Pyomo source directory*. | ||
|
||
Preview Changes Locally | ||
------------------------ | ||
----------------------- | ||
|
||
1. Install Sphinx | ||
1. Install documentation dependencies (e.g., Sphinx, etc): | ||
|
||
```bash | ||
$ pip install sphinx sphinx_rtd_theme sphinx_copybutton | ||
$ pip install -e .[docs] | ||
``` | ||
|
||
**NOTE**: You may get a warning about the `dot` command if you do not have | ||
`graphviz` installed. | ||
> **NOTE**: You may get a warning about the `dot` command if you do | ||
> not have `graphviz` installed. | ||
1. Build the documentation | ||
|
||
2. Build the documentation. Sphinx (and Pyomo) support multiple | ||
documentation *targets*. These instructions describe building the | ||
`html` target, but the same process applies for other targets. | ||
|
||
```bash | ||
$ make html # Option 1 | ||
$ make latexpdf # Option 2 | ||
$ make -C doc/OnlineDocs html | ||
``` | ||
|
||
1. View `_build/html/index.html` in your browser | ||
3. View ``doc/OnlineDocs/_build/html/index.html`` in your browser | ||
|
||
Test Changes Locally | ||
-------------------- | ||
|
||
```bash | ||
$ make -C doc/OnlineDocs doctest -d # from the pyomo root folder | ||
$ make -C doc/OnlineDocs doctest | ||
``` | ||
|
||
Rebuilding the documentation | ||
---------------------------- | ||
|
||
Sphinx caches significant amounts of work at the end of a documentation | ||
build. However, if you are in the process of editing the documentation, | ||
it may not correctly invalidate the cache. You can purge the entire | ||
cache with | ||
|
||
```bash | ||
$ make -C doc/OnlineDocs clean | ||
``` | ||
|
||
Combining steps | ||
--------------- | ||
|
||
These steps can, of course, be combined into a single command: | ||
|
||
```bash | ||
$ make -c doc/OnlineDocs clean html doctest | ||
``` | ||
|
||
Documentation history | ||
--------------------- | ||
|
||
The Pyomo online documentation went through a significant overhaul in | ||
2024. If you need to go back and look at the old documentation, the | ||
following git hashes might be relevant: | ||
|
||
- [23fb726ce](https://github.com/Pyomo/pyomo/commit/23fb726ce0e092412081bd70e8a0370af46f6d0f): | ||
main (close to just) before the reorg was merged | ||
|
||
- [c157587fc](https://github.com/Pyomo/pyomo/commit/c157587fc9a03300b53879b99c1f350a26a9519f): | ||
reorg branch just before the `Archive` subdirectory was removed |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{{ name | escape | underline}} | ||
|
||
({{ objtype }} from :py:mod:`{{ module }}`) | ||
|
||
.. testsetup:: * | ||
|
||
# import everything from the module containing this class so that | ||
# doctests for the class docstrings see the correct environment | ||
from {{ module }} import * | ||
|
||
.. currentmodule:: {{ module }} | ||
|
||
.. auto{{ objtype }}:: {{ objname }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
{{ name | escape | underline}} | ||
|
||
(class from :py:mod:`{{ module }}`) | ||
|
||
.. testsetup:: * | ||
|
||
# import everything from the module containing this class so that | ||
# doctests for the class docstrings see the correct environment | ||
from {{ module }} import * | ||
|
||
.. currentmodule:: {{ module }} | ||
|
||
{# Note that numpy.ndarray examples fail doctest; disable documentation | ||
of inherited members for classes derived from ndarray #} | ||
|
||
.. autoclass:: {{ module }}::{{ objname }} | ||
:members: | ||
:show-inheritance: | ||
{{ '' if (module + '.' + name) in ( | ||
'pyomo.contrib.pynumero.sparse.block_vector.BlockVector', | ||
'pyomo.contrib.pynumero.sparse.mpi_block_vector.MPIBlockVector', | ||
'pyomo.core.expr.ndarray.NumericNDArray', | ||
) else ':inherited-members:' }} | ||
|
||
{% block methods %} | ||
.. automethod:: __init__ | ||
|
||
{% if methods %} | ||
.. rubric:: {{ _('Methods') }} | ||
|
||
.. autosummary:: | ||
{% for item in methods %} | ||
~{{ name }}.{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
{% block attributes %} | ||
{% if attributes %} | ||
.. rubric:: {{ _('Attributes') }} | ||
|
||
.. autosummary:: | ||
{% for item in attributes %} | ||
~{{ name }}.{{ item }} | ||
{%- endfor %} | ||
{% endif %} | ||
{% endblock %} | ||
|
||
.. rubric:: Member Documentation |
Oops, something went wrong.