Skip to content

Commit

Permalink
Merge pull request #3259 from mrmundt/link-checking
Browse files Browse the repository at this point in the history
Add URL Checking to Markdown + Doc Files
  • Loading branch information
mrmundt committed May 14, 2024
2 parents 6365a25 + 293807c commit f2a311a
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 44 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/test_branches.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,19 @@ jobs:
uses: crate-ci/typos@master
with:
config: ./.github/workflows/typos.toml
- name: URL Checker
uses: urlstechie/urlchecker-action@0.0.34
with:
# A comma-separated list of file types to cover in the URL checks
file_types: .md,.rst
# Choose whether to include file with no URLs in the prints.
print_all: false
# More verbose summary at the end of a run
verbose: true
# How many times to retry a failed request (defaults to 1)
retry_count: 3
# Exclude Jenkins because it's behind a firewall
exclude_urls: https://pyomo-jenkins.sandia.gov/


build:
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/test_pr_and_main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,19 @@ jobs:
uses: crate-ci/typos@master
with:
config: ./.github/workflows/typos.toml
- name: URL Checker
uses: urlstechie/urlchecker-action@0.0.34
with:
# A comma-separated list of file types to cover in the URL checks
file_types: .md,.rst
# Choose whether to include file with no URLs in the prints.
print_all: false
# More verbose summary at the end of a run
verbose: true
# How many times to retry a failed request (defaults to 1)
retry_count: 3
# Exclude Jenkins because it's behind a firewall
exclude_urls: https://pyomo-jenkins.sandia.gov/


build:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ NumPy compatible functions:
* `numpy.arccos() <https://numpy.org/doc/stable/reference/generated/numpy.arccos.html>`_
* `numpy.sinh() <https://numpy.org/doc/stable/reference/generated/numpy.sinh.html>`_
* `numpy.cosh() <https://numpy.org/doc/stable/reference/generated/numpy.cosh.html>`_
* `numpy.abs() <https://numpy.org/doc/stable/reference/generated/numpy.abs.html>`_
* `numpy.abs() <https://numpy.org/doc/stable/reference/generated/numpy.absolute.html>`_
* `numpy.tanh() <https://numpy.org/doc/stable/reference/generated/numpy.tanh.html>`_
* `numpy.arccosh() <https://numpy.org/doc/stable/reference/generated/numpy.arccosh.html>`_
* `numpy.arcsinh() <https://numpy.org/doc/stable/reference/generated/numpy.arcsinh.html>`_
Expand Down
44 changes: 2 additions & 42 deletions doc/OnlineDocs/contribution_guide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -404,50 +404,10 @@ Contrib 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.

The following two examples illustrate the two ways
that ``pyomo.contrib`` can be used to integrate third-party
contributions.

Including External Packages
+++++++++++++++++++++++++++

The `pyomocontrib_simplemodel
<http://pyomocontrib-simplemodel.readthedocs.io/en/latest/>`_ package
is derived from Pyomo, and it defines the class SimpleModel that
illustrates how Pyomo can be used in a simple, less object-oriented
manner. Specifically, this class mimics the modeling style supported
by `PuLP <https://github.com/coin-or/pulp>`_.

While ``pyomocontrib_simplemodel`` can be installed and used separate
from Pyomo, this package is included in ``pyomo/contrib/simplemodel``.
This allows this package to be referenced as if were defined as a
subpackage of ``pyomo.contrib``. For example::

from pyomo.contrib.simplemodel import *
from math import pi

m = SimpleModel()

r = m.var('r', bounds=(0,None))
h = m.var('h', bounds=(0,None))

m += 2*pi*r*(r + h)
m += pi*h*r**2 == 355

status = m.solve("ipopt")

This example illustrates that a package can be distributed separate
from Pyomo while appearing to be included in the ``pyomo.contrib``
subpackage. Pyomo requires a separate directory be defined under
``pyomo/contrib`` for each such package, and the Pyomo developer
team will approve the inclusion of third-party packages in this
manner.


Contrib Packages within Pyomo
+++++++++++++++++++++++++++++

Third-party contributions can also be included directly within the
Third-party contributions can be included directly within the
``pyomo.contrib`` package. The ``pyomo/contrib/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
Expand All @@ -465,7 +425,7 @@ import this package, but if an import failure occurs, Pyomo will
silently ignore it. Otherwise, this pyomo package will be treated
like any other. Specifically:

* Plugin classes defined in this package are loaded when `pyomo.environ` is loaded.
* Plugin classes defined in this package are loaded when ``pyomo.environ`` is loaded.

* Tests in this package are run with other Pyomo tests.

2 changes: 1 addition & 1 deletion doc/OnlineDocs/modeling_extensions/dae.rst
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ supported by CasADi. A list of available integrators for each package is
given below. Please refer to the `SciPy
<https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.ode.html>`_
and `CasADi
<http://casadi.sourceforge.net/api/html/db/d3d/classcasadi_1_1Integrator.html>`_ documentation directly for the most up-to-date information about
<https://web.casadi.org/python-api/#integrator>`_ documentation directly for the most up-to-date information about
these packages and for more information about the various integrators and
options.

Expand Down

0 comments on commit f2a311a

Please sign in to comment.