Skip to content

Commit

Permalink
Merge pull request #7 from scientificcomputing/finsberg/updates
Browse files Browse the repository at this point in the history
A bunch of updates
  • Loading branch information
finsberg authored Nov 8, 2023
2 parents 71cbdb4 + e1f8277 commit f6c9a42
Show file tree
Hide file tree
Showing 23 changed files with 703 additions and 423 deletions.
5 changes: 0 additions & 5 deletions .flake8

This file was deleted.

35 changes: 27 additions & 8 deletions .github/workflows/build_docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,27 +23,44 @@ jobs:
build:
runs-on: ubuntu-22.04
container:
image: finsberg/fenics-gmsh:latest
image: ghcr.io/scientificcomputing/fenics-gmsh:2023-08-16

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

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Install dependencies
run: python3 -m pip install -r requirements.txt
run: python3 -m pip install -r requirements-docs.txt

- name: Build docs
run: jupyter book build -W .


- name: Cache
id: cache
uses: actions/cache@v3
with:
path: |
~/.cache/pip
~/_build
key: cache_v1
restore-keys: |
cache_v1
- name: Install dependencies
run: python3 -m pip install -r requirements-docs.txt

- name: Build docs
run: jupyter book build .

- name: Upload artifact
uses: actions/upload-pages-artifact@v1
uses: actions/upload-pages-artifact@v2
with:
path: ${{ env.PUBLISH_DIR }}


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

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Pages
uses: actions/configure-pages@v2
uses: actions/configure-pages@v3


- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1
uses: actions/deploy-pages@v2
56 changes: 56 additions & 0 deletions .github/workflows/reproduce_results.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Simple workflow for deploying static content to GitHub Pages
name: Reproduce results

on:
push:
branches: ["main"]
pull_request:
branches: ["main"]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
workflow_call:


jobs:
run:
runs-on: ubuntu-22.04
container:
image: ghcr.io/scientificcomputing/fenics-gmsh:2023-08-16

steps:
- uses: actions/checkout@v4

- name: Cache
id: cache
uses: actions/cache@v3
with:
path: |
~/.cache/pip
key: cache_v1
restore-keys: |
cache_v1
- name: Install dependencies
run: python3 -m pip install -r requirements.txt

- name: Download data
run: cd data && bash download_data.sh && cd ..

- name: Run pre-processing
run: cd code && python3 pre_processing.py && cd ..

- name: Run simulation
run: cd code && python3 run_fiber_generation.py && cd ..

- name: Postprocess
run: cd code && python3 postprocess.py && cd ..

- name: Upload artifact
if: always()
uses: actions/upload-artifact@v3
with:
path: |
./data/mesh
./code/results
if-no-files-found: error
13 changes: 6 additions & 7 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
data/data.tar
data/mesh
data/._mesh
data/*.json
data/*.h5
code/results/*.h5
code/results/*.xdmf
data.tar
mesh
._mesh
*.json
*.h5
*.xdmf

# Created by https://www.toptal.com/developers/gitignore/api/python,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=python,visualstudiocode
Expand Down
35 changes: 18 additions & 17 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.5.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- id: check-docstring-first
- id: debug-statements
- id: requirements-txt-fixer
- id: check-added-large-files
- id: check-toml

- repo: https://github.com/asottile/reorder_python_imports
rev: v3.8.3
- repo: https://github.com/asottile/add-trailing-comma
rev: v3.1.0
hooks:
- id: reorder-python-imports
- id: add-trailing-comma

- repo: https://github.com/psf/black
rev: 22.10.0
rev: 23.10.1
hooks:
- id: black

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.0.0
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: 'v0.1.4'
hooks:
- id: flake8
- id: ruff

- repo: https://github.com/asottile/add-trailing-comma
rev: v2.3.0
hooks:
- id: add-trailing-comma

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.982
rev: v1.6.1
hooks:
- id: mypy
additional_dependencies:
- types-requests

- repo: https://github.com/asottile/pyupgrade
rev: v3.1.0
- repo: https://github.com/streetsidesoftware/cspell-cli
rev: v7.3.2
hooks:
- id: pyupgrade
args: [--py38-plus]
- id: cspell
files: docs/(.+).md|README.md|code/demo.py
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

This repository contains supplementary code for the paper
> Finsberg, H., Dokken, J. 2022.
> Title of paper, Journal of blabla, volume, page, url
> Title of paper, Journal of ..., volume, page, url

## Abstract
Expand Down
22 changes: 17 additions & 5 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Book settings
# Learn more at https://jupyterbook.org/customize/config.html

title: Example FEniCS paper
author: Henrik Finsberg
title: Example paper FEniCS
author: Henrik Finsberg and Jørgen Dokken
logo: "docs/logo.png"
copyright: "2022"
copyright: "2023"
only_build_toc_files: true

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

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

html:
use_issues_button: true
Expand All @@ -31,13 +31,25 @@ parse:
- dollarmath
- linkify


sphinx:
config:
bibtex_bibfiles: ["docs/refs.bib"]
suppress_warnings: ["bibtex.duplicate_citation"] # If the same paper is cited in multiple files
nb_execution_show_tb: True
html_theme_options:
navigation_with_keys: false
html_last_updated_fmt: "%b %d, %Y"
nb_custom_formats: # https://jupyterbook.org/en/stable/file-types/jupytext.html#file-types-custom
.py:
- jupytext.reads
- fmt: py

extra_extensions:
- 'sphinx.ext.autodoc'
- 'sphinx.ext.napoleon'
- 'sphinx.ext.viewcode'
- "sphinxcontrib.bibtex"


exclude_patterns: [".pytest_cache/*", ".github/*"]
2 changes: 1 addition & 1 deletion _toc.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
format: jb-book
root: index
root: README

chapters:
- file: docs/abstract
Expand Down
Loading

0 comments on commit f6c9a42

Please sign in to comment.