Skip to content

Commit

Permalink
use --skip rather than hard coding
Browse files Browse the repository at this point in the history
  • Loading branch information
mscroggs committed Nov 7, 2024
1 parent e9de55f commit c066cc2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/notebook-images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ jobs:
- name: Generate notebooks
run: |
python3 -m pip install .
python3 -m pip install jupytext nbconvert ipykernel matplotlib pandas
python3 examples/generate_notebooks.py
python3 -m pip install jupytext nbconvert ipykernel matplotlib
python3 examples/generate_notebooks.py --skip "dirichlet_weak_imposition,simple_helmholtz_fem_bem_coupling_dolfin,opencl_benchmarks"
- name: Push to GitHub
run: |
Expand Down
11 changes: 6 additions & 5 deletions examples/generate_notebooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,15 @@

parser = argparse.ArgumentParser(description="Generate Bempp notebooks")
parser.add_argument('--run', metavar="run", default="true")
parser.add_argument('--skip', metavar="skip", default="")

args = parser.parse_args()
assert args.run in ["true", "false"]
run_notebooks = (args.run == "true")
if args.skip == "":
skip = []
else:
skip = args.skip.split(",")

# Get all the examples in each folder
notebook_dir = os.path.join(os.path.dirname(os.path.realpath(__file__)), "notebooks")
Expand Down Expand Up @@ -44,11 +49,7 @@
assert os.system(f"jupytext --to ipynb {file_copy}") == 0
assert os.system(f"rm {file_copy}") == 0

# Skip examples that use fmm or legacy FEniCS
if run_notebooks and i[:-3] not in [
"dirichlet_weak_imposition",
"simple_helmholtz_fem_bem_coupling_dolfin",
]:
if run_notebooks and i[:-3] not in skip:
assert os.system(
"jupyter nbconvert --execute --to notebook --inplace "
+ os.path.join(path, f"convert-{i[:-3]}.ipynb")
Expand Down

0 comments on commit c066cc2

Please sign in to comment.