Repository navigation
Start Github Actions CI #70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
20a18d0
b92166c
d7c59d2
6e76a46
3441c7b
b638d51
22abae2
9a47127
e004f6f
181276e
e7fa94e
1bbd6e6
6d29b77
6d82ddc
7e05ff8
8aee0bc
8bb00e7
ea9cfed
030db2c
abe34a8
4dc914e
cf3e50a
0a0403e
7256909
1f25b1a
851a4e3
e6d32c7
6ecd3aa
0010c5f
f31c0b7
d3cbd16
754b363
3613ea0
ecee872
fb57d8d
8f3ddf5
4ca65a2
267b7d7
f402998
cca075b
e6c46fb
71d99be
6a86b4e
5a65710
f8e904a
e2d3749
118a7d3
a06e9ec
fb72df4
702bab9
38de6be
379b00a
3067ce2
a2f4845
8615c7b
a5ab8b0
4c8844f
c1c9577
e7084ce
3cfdbe0
df4f3a5
807561f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| name: Tests | ||
|
|
||
| on: | ||
| pull_request: | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| tests: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Check out repository | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Set up Python | ||
| uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: "3.11.5" | ||
|
|
||
| - name: Install system dependencies | ||
| run: | | ||
| sudo apt-get update | ||
| sudo apt-get install -y liblapack3 libblas3 gfortran | ||
|
|
||
| - name: Install latex | ||
| run: | | ||
| sudo apt-get install -y \ | ||
| texlive-latex-base \ | ||
| texlive-latex-recommended \ | ||
| texlive-latex-extra \ | ||
| texlive-fonts-recommended \ | ||
| dvipng \ | ||
| cm-super | ||
|
|
||
| - name: Install test dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip | ||
| python -m pip install pybind11 setuptools pyomo idaes-pse | ||
| pyomo download-extensions | ||
| pyomo build-extensions | ||
| idaes get-extensions --to $GITHUB_WORKSPACE/.idaes | ||
|
Comment on lines
+38
to
+41
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Pyomo extensions are for |
||
| pushd $GITHUB_WORKSPACE/.idaes | ||
| tar -xf idaes-local-ubuntu*-x86_64.tar.gz | ||
| popd | ||
| tree $GITHUB_WORKSPACE/.idaes | ||
| export PKG_CONFIG_PATH="$GITHUB_WORKSPACE/.idaes/lib/pkgconfig:$PKG_CONFIG_PATH" | ||
| python -m pip install ".[test]" | ||
|
Owner
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here we are installing with latest dependency versions, per pyproject.toml. Alternatively, we could use the frozen environment from requirements.txt. I think I prefer using latest versions. If something starts failing, we can pin dependencies as necessary. |
||
|
|
||
| - name: Run tests | ||
| run: | | ||
| export PATH="$PATH:$GITHUB_WORKSPACE/.idaes" | ||
| ipopt --version | ||
| python -m pytest \ | ||
| var_elim/algorithms/tests \ | ||
| var_elim/heuristics/tests \ | ||
| var_elim/mip_formulations/tests | ||
|
|
||
| - name: Run structural analysis | ||
| run: | | ||
| export PATH="$PATH:$GITHUB_WORKSPACE/.idaes" | ||
| python reproduce.py structure --smoke --run-dir=. | ||
| test -s results/structure-distill.csv | ||
| test -s results/structure-distill.txt | ||
| test -s results/structure-distill-matching.txt | ||
| test -s images/fraction-elim.pdf | ||
| test -s images/nnz-per-con.pdf | ||
|
|
||
| - name: Run solvetime analysis | ||
| run: | | ||
| export PATH="$PATH:$GITHUB_WORKSPACE/.idaes" | ||
| export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/.idaes/lib" | ||
| export PKG_CONFIG_PATH="$GITHUB_WORKSPACE/.idaes/lib/pkgconfig:$PKG_CONFIG_PATH" | ||
| pkg-config --libs --cflags ipopt | ||
| python reproduce.py solvetime --smoke --run-dir=. | ||
| test -s results/solvetime-distill-matching.csv | ||
| test -s results/solvetime-distill-matching.txt | ||
| test -s images/fraction-solvetime.pdf | ||
|
|
||
| - name: Run convergence analysis | ||
| run: | | ||
| export PATH="$PATH:$GITHUB_WORKSPACE/.idaes" | ||
| export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/.idaes/lib" | ||
| export PKG_CONFIG_PATH="$GITHUB_WORKSPACE/.idaes/lib/pkgconfig:$PKG_CONFIG_PATH" | ||
| pkg-config --libs --cflags ipopt | ||
| python reproduce.py convergence --smoke --run-dir=. | ||
| test -s results/sweep/distill-matching-sweep.csv | ||
| test -s results/sweep/distill-matching-sweep-summary.csv | ||
| test -s images/distill-matching-sweep-convergence.pdf | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| ___________________________________________________________________________ | ||
|
|
||
| Variable Elimination: Research code for variable elimination in NLPs | ||
|
|
||
| Copyright (c) 2023. Triad National Security, LLC. All rights reserved. | ||
|
|
||
| This program was produced under U.S. Government contract 89233218CNA000001 | ||
| for Los Alamos National Laboratory (LANL), which is operated by Triad | ||
| National Security, LLC for the U.S. Department of Energy/National Nuclear | ||
| Security Administration. All rights in the program are reserved by Triad | ||
| National Security, LLC, and the U.S. Department of Energy/National Nuclear | ||
| Security Administration. The Government is granted for itself and others | ||
| acting on its behalf a nonexclusive, paid-up, irrevocable worldwide license | ||
| in this material to reproduce, prepare derivative works, distribute copies | ||
| to the public, perform publicly and display publicly, and to permit others | ||
| to do so. | ||
|
|
||
| This software is distributed under the 3-clause BSD license. | ||
| ___________________________________________________________________________ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Necessary for our matplotlib plotting scripts. The particular subpackages were chosen by trial-and-error as I didn't want to install an entire texlive distribution...