Skip to content

add sphinx-copybutton and adjust path to docs in pyotracker.yml #876

add sphinx-copybutton and adjust path to docs in pyotracker.yml

add sphinx-copybutton and adjust path to docs in pyotracker.yml #876

name: GitHub CI
on:
push:
branches:
- main
pull_request:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
defaults:
run:
shell: bash -l {0}
jobs:
ruff:
name: Ruff Linting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: chartboost/ruff-action@v1
nompi4py:
name: no mpi4py
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
python-version: 3.11
auto-activate-base: false
- name: Install dependencies
run: |
pip install sphinx sphinx_rtd_theme cplex
pip install xpress pandas dill
- name: setup the program
run: |
pip install -e .
- name: PH EF tests
run: |
cd mpisppy/tests
python test_ef_ph.py
regression:
name: Basic regression tests
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
python-version: 3.11
auto-activate-base: false
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo sphinx sphinx_rtd_theme sphinx-copybutton dill gridx-egret cplex pybind11
pip install xpress
- name: Build pyomo extensions
run: |
# we don't need it all; just APPSI's extensions
pyomo build-extensions || python -c "from pyomo.contrib.appsi.cmodel import cmodel_available; exit(0) if bool(cmodel_available) else exit(1)"
- name: setup the program
run: |
pip install -e .
- name: Test EF/PH
run: |
python mpisppy/tests/test_ef_ph.py
- name: Test afew
run: |
cd examples
python afew.py xpress_persistent
- name: Test ComponentMap
run: |
pytest mpisppy/tests/test_component_map_usage.py
- name: Test docs
run: |
cd ./doc/
make doctest
runall_persistent:
name: run_all.py persistent solver
runs-on: ubuntu-latest
needs: [ruff]
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
python-version: 3.11
auto-activate-base: false
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo sphinx sphinx_rtd_theme dill gridx-egret cplex pybind11
pip install xpress
- name: Build pyomo extensions
run: |
# we don't need it all; just APPSI's extensions
pyomo build-extensions || python -c "from pyomo.contrib.appsi.cmodel import cmodel_available; exit(0) if bool(cmodel_available) else exit(1)"
- name: setup the program
run: |
pip install -e .
- name: Test run_all nouc
run: |
cd examples
python run_all.py xpress_persistent "" nouc
runall:
name: run_all.py direct solver
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
python-version: 3.11
auto-activate-base: false
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo sphinx sphinx_rtd_theme dill gridx-egret cplex pybind11
pip install xpress
- name: Build pyomo extensions
run: |
# we don't need it all; just APPSI's extensions
pyomo build-extensions || python -c "from pyomo.contrib.appsi.cmodel import cmodel_available; exit(0) if bool(cmodel_available) else exit(1)"
- name: setup the program
run: |
pip install -e .
- name: Test run_all nouc
run: |
cd examples
python run_all.py xpress_direct "" nouc
schur-complement:
name: schur-complement
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.11]
steps:
- uses: actions/checkout@v3
- name: setup conda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
channels: anaconda, conda-forge
activate-environment: test_env
auto-activate-base: false
- name: Install dependencies
shell: bash -l {0}
run: |
python -m pip install --upgrade pip
# Test tooling
pip install pytest pytest-cov
# Core build/test deps
pip install pybind11
conda install -y conda-forge::libstdcxx-ng
conda install -y openmpi pymumps --no-update-deps
pip install mpi4py pandas
# pyutilib / pyomo / parapint
pip install git+https://github.com/pyutilib/pyutilib.git
git clone https://github.com/pyomo/pyomo.git
cd pyomo/
pip install -e .
pyomo download-extensions
pyomo build-extensions
cd ../
pip install git+https://github.com/parapint/parapint.git
# Install this repo (editable)
pip install -e .
- name: Test with pytest (serial)
shell: bash -l {0}
run: |
pytest -q -vv mpisppy/tests/test_sc.py
- name: Test with pytest under MPI
shell: bash -l {0}
run: |
mpirun -np 3 -oversubscribe python -m pytest -q -vv mpisppy/tests/test_sc.py
straight-tests:
name: straight_tests.py
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
python-version: 3.11
auto-activate-base: false
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo xpress cplex dill matplotlib
- name: setup the program
run: |
pip install -e .
- name: mpi tests
run: |
cd mpisppy/tests
python straight_tests.py
admm-wrapper:
name: admm wrapper tests
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
python-version: 3.11
auto-activate-base: false
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo xpress cplex
pip install numpy packaging
- name: setup the program
run: |
pip install -e .
- name: run tests
timeout-minutes: 10
run: |
cd mpisppy/tests
# envall does nothing
python test_admmWrapper.py
python test_stoch_admmWrapper.py
aph:
name: aph tests
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
python-version: 3.11
auto-activate-base: false
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo xpress cplex
- name: setup the program
run: |
pip install -e .
- name: run tests
timeout-minutes: 10
run: |
cd mpisppy/tests
# envall does nothing
python test_aph.py
pickled-bundles:
name: pickled bundles tests
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
python-version: 3.11
auto-activate-base: false
- name: Install dependencies
run: |
conda install mpi4py "numpy<2" setuptools
pip install pyomo pandas xpress cplex scipy sympy dill PyYAML Pympler networkx pandas packaging
- name: setup the program
run: |
pip install -e .
- name: run pickled bundles tests
timeout-minutes: 10
run: |
cd mpisppy/tests
python test_pickle_bundle.py
mps:
name: MPS tests
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
python-version: 3.11
auto-activate-base: false
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo xpress cplex mip
- name: setup the program
run: |
pip install -e .
- name: run MPS tests
timeout-minutes: 2
run: |
cd mpisppy/tests
python test_mps.py
confidence-intervals:
name: confidence intervals tests
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
python-version: 3.11
auto-activate-base: false
- name: Install dependencies
run: |
conda install mpi4py "numpy<2" setuptools
pip install pyomo pandas xpress cplex scipy sympy dill packaging
- name: setup the program
run: |
pip install -e .
- name: run farmer tests
timeout-minutes: 10
run: |
cd mpisppy/tests
python test_conf_int_farmer.py
- name: run aircond tests
timeout-minutes: 10
run: |
cd mpisppy/tests
python test_conf_int_aircond.py
test-generic-pyomo-released:
name: generic_tester.py
runs-on: ubuntu-latest
needs: [ruff]
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
python-version: 3.11
auto-activate-base: false
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo sphinx sphinx_rtd_theme dill gridx-egret cplex pybind11
- name: Build pyomo extensions
run: |
# we don't need it all; just APPSI's extensions
pyomo build-extensions || python -c "from pyomo.contrib.appsi.cmodel import cmodel_available; exit(0) if bool(cmodel_available) else exit(1)"
- name: setup the program
run: |
pip install -e .
- name: Test test_generic nouc
run: |
cd examples
python generic_tester.py cplex_direct "" nouc
test-gradient-rho:
name: gradient and rho tests
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v3
with:
activate-environment: test_env
python-version: 3.11
auto-activate-base: false
- name: Install dependencies
run: |
conda install conda-forge::libstdcxx-ng
conda install mpi4py "numpy<2" setuptools cmake
pip install pyomo pandas xpress cplex scipy sympy dill packaging
- name: setup the program
run: |
pip install -e .
- name: run farmer tests
timeout-minutes: 10
run: |
cd mpisppy/tests
python test_gradient_rho.py
python test_xbar_w_reader_writer.py
test-headers:
name: header test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
python-version: 3.11
auto-activate-base: false
- name: Install dependencies
run: |
conda install mpi4py "numpy<2" setuptools
pip install pyomo addheader pyyaml pytest
- name: setup the program
run: |
pip install -e .
- name: run headers test
timeout-minutes: 10
run: |
cd mpisppy/tests
pytest test_headers.py
test-pysp:
name: pysp tests
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
python-version: 3.11
auto-activate-base: false
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools pytest pyyaml networkx
pip install pyomo xpress cplex
- name: setup the program
run: |
pip install -e .
- name: run pysp model tests
timeout-minutes: 10
run: |
cd mpisppy/tests
# envall does nothing
python test_pysp_model.py
- name: run pysp unit tests
timeout-minutes: 10
run: |
cd mpisppy/utils/pysp_model
pytest -v .
test-cylinders:
name: tests on some cylinders
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
python-version: 3.11
auto-activate-base: false
- name: Install dependencies
run: |
conda install mpi4py "numpy<2" setuptools
pip install pyomo pandas xpress cplex scipy packaging
- name: setup the program
run: |
pip install -e .
- name: run tests
timeout-minutes: 10
run: |
cd mpisppy/tests
mpiexec -np 2 python -m mpi4py test_with_cylinders.py
test-agnostic:
name: tests on agnostic
runs-on: ubuntu-latest
needs: [ruff]
steps:
- uses: actions/checkout@v3
- uses: conda-incubator/setup-miniconda@v2
with:
activate-environment: test_env
python-version: 3.11
auto-activate-base: false
- name: Install dependencies
run: |
conda install mpi4py pandas setuptools
pip install pyomo xpress cplex
pip install numpy packaging
python -m pip install amplpy --upgrade
python -m amplpy.modules install highs cbc gurobi
python -m pip install gamspy
python -m pip install mip
# license?
- name: setup the program
run: |
pip install -e .
- name: run agnostic tests
timeout-minutes: 10
run: |
cd mpisppy/tests
python test_agnostic.py
- name: run agnostic cylinders
timeout-minutes: 10
run: |
cd mpisppy/agnostic/examples
python afew_agnostic.py
- name: run loose AMPL
timeout-minutes: 10
run: |
cd examples/loose_agnostic/AMPL
bash farmer_example.bash
# GAMS is not tested because I don't want to deal with the license
#cd ../GAMS
#bash farmer_example.bash