Skip to content

Commit f6c9a42

Browse files
authored
Merge pull request #7 from scientificcomputing/finsberg/updates
A bunch of updates
2 parents 71cbdb4 + e1f8277 commit f6c9a42

23 files changed

+703
-423
lines changed

.flake8

Lines changed: 0 additions & 5 deletions
This file was deleted.

.github/workflows/build_docs.yml

Lines changed: 27 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,27 +23,44 @@ jobs:
2323
build:
2424
runs-on: ubuntu-22.04
2525
container:
26-
image: finsberg/fenics-gmsh:latest
26+
image: ghcr.io/scientificcomputing/fenics-gmsh:2023-08-16
2727

2828
env:
2929
# Directory that will be published on github pages
3030
PUBLISH_DIR: ./_build/html
3131

3232
steps:
33-
- uses: actions/checkout@v3
33+
- uses: actions/checkout@v4
3434

3535
- name: Install dependencies
36-
run: python3 -m pip install -r requirements.txt
36+
run: python3 -m pip install -r requirements-docs.txt
37+
38+
- name: Build docs
39+
run: jupyter book build -W .
40+
41+
42+
- name: Cache
43+
id: cache
44+
uses: actions/cache@v3
45+
with:
46+
path: |
47+
~/.cache/pip
48+
~/_build
49+
key: cache_v1
50+
restore-keys: |
51+
cache_v1
52+
53+
- name: Install dependencies
54+
run: python3 -m pip install -r requirements-docs.txt
3755

3856
- name: Build docs
3957
run: jupyter book build .
4058

4159
- name: Upload artifact
42-
uses: actions/upload-pages-artifact@v1
60+
uses: actions/upload-pages-artifact@v2
4361
with:
4462
path: ${{ env.PUBLISH_DIR }}
4563

46-
4764
# Single deploy job since we're just deploying
4865
deploy:
4966
if: github.ref == 'refs/heads/main'
@@ -53,13 +70,15 @@ jobs:
5370
url: ${{ steps.deployment.outputs.page_url }}
5471

5572
runs-on: ubuntu-latest
73+
5674
steps:
5775
- name: Checkout
58-
uses: actions/checkout@v3
76+
uses: actions/checkout@v4
5977

6078
- name: Setup Pages
61-
uses: actions/configure-pages@v2
79+
uses: actions/configure-pages@v3
80+
6281

6382
- name: Deploy to GitHub Pages
6483
id: deployment
65-
uses: actions/deploy-pages@v1
84+
uses: actions/deploy-pages@v2
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Simple workflow for deploying static content to GitHub Pages
2+
name: Reproduce results
3+
4+
on:
5+
push:
6+
branches: ["main"]
7+
pull_request:
8+
branches: ["main"]
9+
10+
# Allows you to run this workflow manually from the Actions tab
11+
workflow_dispatch:
12+
workflow_call:
13+
14+
15+
jobs:
16+
run:
17+
runs-on: ubuntu-22.04
18+
container:
19+
image: ghcr.io/scientificcomputing/fenics-gmsh:2023-08-16
20+
21+
steps:
22+
- uses: actions/checkout@v4
23+
24+
- name: Cache
25+
id: cache
26+
uses: actions/cache@v3
27+
with:
28+
path: |
29+
~/.cache/pip
30+
key: cache_v1
31+
restore-keys: |
32+
cache_v1
33+
34+
- name: Install dependencies
35+
run: python3 -m pip install -r requirements.txt
36+
37+
- name: Download data
38+
run: cd data && bash download_data.sh && cd ..
39+
40+
- name: Run pre-processing
41+
run: cd code && python3 pre_processing.py && cd ..
42+
43+
- name: Run simulation
44+
run: cd code && python3 run_fiber_generation.py && cd ..
45+
46+
- name: Postprocess
47+
run: cd code && python3 postprocess.py && cd ..
48+
49+
- name: Upload artifact
50+
if: always()
51+
uses: actions/upload-artifact@v3
52+
with:
53+
path: |
54+
./data/mesh
55+
./code/results
56+
if-no-files-found: error

.gitignore

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
data/data.tar
2-
data/mesh
3-
data/._mesh
4-
data/*.json
5-
data/*.h5
6-
code/results/*.h5
7-
code/results/*.xdmf
1+
data.tar
2+
mesh
3+
._mesh
4+
*.json
5+
*.h5
6+
*.xdmf
87

98
# Created by https://www.toptal.com/developers/gitignore/api/python,visualstudiocode
109
# Edit at https://www.toptal.com/developers/gitignore?templates=python,visualstudiocode

.pre-commit-config.yaml

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,42 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.3.0
3+
rev: v4.5.0
44
hooks:
55
- id: check-yaml
66
- id: end-of-file-fixer
77
- id: trailing-whitespace
88
- id: check-docstring-first
99
- id: debug-statements
1010
- id: requirements-txt-fixer
11+
- id: check-added-large-files
12+
- id: check-toml
1113

12-
- repo: https://github.com/asottile/reorder_python_imports
13-
rev: v3.8.3
14+
- repo: https://github.com/asottile/add-trailing-comma
15+
rev: v3.1.0
1416
hooks:
15-
- id: reorder-python-imports
17+
- id: add-trailing-comma
1618

1719
- repo: https://github.com/psf/black
18-
rev: 22.10.0
20+
rev: 23.10.1
1921
hooks:
2022
- id: black
2123

22-
- repo: https://github.com/pre-commit/pre-commit-hooks
23-
rev: v2.0.0
24+
- repo: https://github.com/charliermarsh/ruff-pre-commit
25+
# Ruff version.
26+
rev: 'v0.1.4'
2427
hooks:
25-
- id: flake8
28+
- id: ruff
2629

27-
- repo: https://github.com/asottile/add-trailing-comma
28-
rev: v2.3.0
29-
hooks:
30-
- id: add-trailing-comma
3130

3231
- repo: https://github.com/pre-commit/mirrors-mypy
33-
rev: v0.982
32+
rev: v1.6.1
3433
hooks:
3534
- id: mypy
35+
additional_dependencies:
36+
- types-requests
3637

37-
- repo: https://github.com/asottile/pyupgrade
38-
rev: v3.1.0
38+
- repo: https://github.com/streetsidesoftware/cspell-cli
39+
rev: v7.3.2
3940
hooks:
40-
- id: pyupgrade
41-
args: [--py38-plus]
41+
- id: cspell
42+
files: docs/(.+).md|README.md|code/demo.py

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
This repository contains supplementary code for the paper
55
> Finsberg, H., Dokken, J. 2022.
6-
> Title of paper, Journal of blabla, volume, page, url
6+
> Title of paper, Journal of ..., volume, page, url
77
88

99
## Abstract

_config.yml

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Book settings
22
# Learn more at https://jupyterbook.org/customize/config.html
33

4-
title: Example FEniCS paper
5-
author: Henrik Finsberg
4+
title: Example paper FEniCS
5+
author: Henrik Finsberg and Jørgen Dokken
66
logo: "docs/logo.png"
7-
copyright: "2022"
7+
copyright: "2023"
8+
only_build_toc_files: true
89

910
# Force re-execution of notebooks on each build.
1011
# See https://jupyterbook.org/content/execute.html
@@ -14,12 +15,11 @@ execute:
1415
# Information about where the book exists on the web
1516
repository:
1617
url: https://github.com/scientificcomputing/example-paper-fenics # Online location of your book
17-
branch: main
18+
branch: main # Which branch of the repository should be used when creating links (optional)
1819

1920
launch_buttons:
2021
notebook_interface: "jupyterlab" # The interface interactive links will activate ["classic", "jupyterlab"]
2122
binderhub_url: "https://mybinder.org"
22-
thebe: true
2323

2424
html:
2525
use_issues_button: true
@@ -31,13 +31,25 @@ parse:
3131
- dollarmath
3232
- linkify
3333

34+
3435
sphinx:
3536
config:
3637
bibtex_bibfiles: ["docs/refs.bib"]
3738
suppress_warnings: ["bibtex.duplicate_citation"] # If the same paper is cited in multiple files
39+
nb_execution_show_tb: True
40+
html_theme_options:
41+
navigation_with_keys: false
42+
html_last_updated_fmt: "%b %d, %Y"
43+
nb_custom_formats: # https://jupyterbook.org/en/stable/file-types/jupytext.html#file-types-custom
44+
.py:
45+
- jupytext.reads
46+
- fmt: py
3847

3948
extra_extensions:
4049
- 'sphinx.ext.autodoc'
4150
- 'sphinx.ext.napoleon'
4251
- 'sphinx.ext.viewcode'
4352
- "sphinxcontrib.bibtex"
53+
54+
55+
exclude_patterns: [".pytest_cache/*", ".github/*"]

_toc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
format: jb-book
2-
root: index
2+
root: README
33

44
chapters:
55
- file: docs/abstract

0 commit comments

Comments
 (0)