Skip to content
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

Rewrite Jupyter Notebook examples as Python examples #1681

Merged
merged 18 commits into from
Apr 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 20 additions & 6 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -280,9 +280,10 @@ jobs:
path: interfaces/dotnet/coveragereport*
retention-days: 5
- name: Upload Coverage to Codecov
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
verbose: true
token: ${{secrets.CODECOV_TOKEN}}
files: ./coverage.xml,./build/pycov.xml,./interfaces/dotnet/coverage.cobertura.xml
fail_ci_if_error: true

Expand Down Expand Up @@ -315,21 +316,27 @@ jobs:
libblas-dev liblapack-dev libhdf5-dev libfmt-dev libsundials-dev
- name: Install conda dependencies
run: |
mamba install -q doxygen=1.9.7 scons pip
mamba install -q doxygen=1.9.7 scons pip scikits.odes
- name: Upgrade pip
run: pip install -U pip setuptools wheel
- name: Install Python dependencies
run: |
pip install ruamel.yaml scons numpy cython 'sphinx>=7.2,<8' \
sphinxcontrib-matlabdomain sphinxcontrib-doxylink sphinxcontrib-bibtex \
pydata-sphinx-theme==0.14.1 sphinx-argparse sphinx_design myst-nb \
sphinx-copybutton matplotlib pandas scipy pint
sphinx-copybutton matplotlib pandas scipy pint coolprop graphviz
pip install "git+https://github.com/sphinx-gallery/sphinx-gallery.git@master"
pip install "git+https://github.com/Cantera/sphinx-tags.git@main"
- name: Build Cantera
run: scons build -j2 debug=n optimize=y use_pch=n
- name: Build documentation
run: scons sphinx doxygen logging=debug
run: |
scons sphinx doxygen logging=debug \
sphinx_options="-W --keep-going --warning-file=sphinx-warnings.txt"
- name: Show Sphinx warnings
run: |
cat sphinx-warnings.txt
if: failure()
- name: Ensure 'scons help' options work
run: |
scons help --options
Expand Down Expand Up @@ -409,12 +416,19 @@ jobs:
run: python3 -m pip install -U pip setuptools wheel
- name: Install Python dependencies
run: |
python3 -m pip install numpy ruamel.yaml pandas pyarrow matplotlib scipy pint graphviz
python3 -m pip install numpy ruamel.yaml pandas pyarrow matplotlib scipy \
pint graphviz CoolProp
python3 -m pip install --pre --no-index --find-links dist cantera
- name: Run the examples
# See https://unix.stackexchange.com/a/392973 for an explanation of the -exec part
# See https://unix.stackexchange.com/a/392973 for an explanation of the -exec part.
# Skip 1D_packed_bed.py due to difficulty installing scikits.odes.
# Skip continuous_reactor.py due to thermo warnings
# Increase figure limit to handle flame_speed_convergence_analysis.py.
run: |
ln -s libcantera_shared.so build/lib/libcantera_shared.so.3
rm samples/python/reactors/1D_packed_bed.py
rm samples/python/reactors/continuous_reactor.py
echo "figure.max_open_warning: 100" > matplotlibrc
export LD_LIBRARY_PATH=build/lib
find samples/python -type f -iname "*.py" \
-exec sh -c 'for n; do echo "$n" | tee -a results.txt && python3 "$n" >> results.txt || exit 1; done' sh {} +
Expand Down
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ Ingmar Schoegl (@ischoegl), Louisiana State University
Santosh Shanbhogue (@santoshshanbhogue), Massachusetts Institute of Technology
Travis Sikes (@tsikes)
Harsh Sinha (@sin-ha)
Sai Krishna Sirumalla (@skrsna), Northeastern University
David Sondak
Raymond Speth (@speth), Massachusetts Institute of Technology
Su Sun (@ssun30), Northeastern University
Expand Down
120 changes: 120 additions & 0 deletions doc/sphinx/_static/images/samples/flame-speed.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
167 changes: 167 additions & 0 deletions doc/sphinx/_static/images/samples/single-particle-battery.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading