Skip to content

Commit

Permalink
✨ Add case studies (#1)
Browse files Browse the repository at this point in the history
This adds the case studies as is from the "capsule 20230218" email correspondence with some cleanup and additional tooling.
  • Loading branch information
s-weigand authored Feb 21, 2023
1 parent 32a52bf commit c1dc8ca
Show file tree
Hide file tree
Showing 62 changed files with 9,913 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Tests

on:
# For now commented out since private repositories only have a limited amount of CI time
# push:
# pull_request:
workflow_dispatch:

jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- name: Check out repo
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Run pre-commit
uses: pre-commit/action@v3.0.0

test:
name: Run ${{ matrix.case_study }}
runs-on: ubuntu-latest
needs: [pre-commit]
strategy:
matrix:
case_study: [4TT, dPSI, rc]

steps:
- name: Check out repo
uses: actions/checkout@v3
- name: Set up Python "3.10"
uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install dependencies
run: |
python -m pip install --upgrade pip wheel
python -m pip install -r requirements.txt
- name: Show installed packages
run: python -m pip freeze
- name: Run tests
run: |
python -m pytest ${{ matrix.case_study }}
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,3 +127,14 @@ dmypy.json

# Pyre type checker
.pyre/

# vscode config
.vscode

# result folders
20*/
results/
guide/

# Corrected 4TT data generate after the first analysis step
4TT/data/corr4TT.ascii
57 changes: 57 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
ci:
skip: [interrogate]

default_language_version:
python: python3.10

repos:
# Formatters
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-ast
- id: check-builtin-literals
- id: check-merge-conflict
- id: end-of-file-fixer
- id: trailing-whitespace
- id: debug-statements
- id: fix-encoding-pragma
args: [--remove]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.0-alpha.4 # Use the sha or tag you want to point at
hooks:
- id: prettier

# Notebook tools
- repo: https://github.com/kynan/nbstripout
rev: 0.6.1
hooks:
- id: nbstripout
args:
- "--drop-empty-cells"
- "--extra-keys"
- "metadata.vscode metadata.language_info.version"

- repo: https://github.com/nbQA-dev/nbQA
rev: 1.6.1
hooks:
- id: nbqa-black
additional_dependencies: [black==23.1.0]
args: [--nbqa-mutate]
- id: nbqa-pyupgrade
additional_dependencies: [pyupgrade==3.3.1]
args: [--nbqa-mutate, --py310-plus]
- id: nbqa-flake8
- id: nbqa-check-ast
- id: nbqa-isort
additional_dependencies: [isort==5.12.0]
args: [--nbqa-mutate]

- repo: https://github.com/codespell-project/codespell
rev: v2.2.2
hooks:
- id: codespell
types: [file]
types_or: [python, pyi, markdown, rst, jupyter]
args: [-L doas]
Binary file added 4TT/4TT.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
165 changes: 165 additions & 0 deletions 4TT/data/4TT_PBS.ascii

Large diffs are not rendered by default.

49 changes: 49 additions & 0 deletions 4TT/models/model.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# type: doas

initial_concentration:
j1:
compartments: [S2, S1, T1, S2rel, T1hot]
parameters: [j.1, j.0, j.0, j.0, j.0]

k_matrix:
k1:
matrix:
"(S2rel, S2)": kinetic.to_S2rel_from_S2
"(S1, S2)": kinetic.to_S1_from_S2
"(S1, S2rel)": kinetic.to_S1_from_S2rel
"(T1hot, S2rel)": kinetic.to_T1hot_from_S2rel
"(T1hot, S1)": kinetic.to_T1hot_from_S1
"(T1, T1hot)": kinetic.to_T1_from_T1hot
"(T1, T1)": kinetic.from_T1

megacomplex:
doas:
type: damped-oscillation
labels: [osc1, osc2, osc3, osc4]
frequencies: [osc.freq.1, osc.freq.2, osc.freq.3, osc.freq.4]
rates: [osc.rates.1, osc.rates.2, osc.rates.3, osc.rates.4]
decay:
type: decay
k_matrix: [k1]
# baseline:
# type: baseline
# dimension: time
artifact:
type: coherent-artifact
order: 3
width: artifact.CAwidth

irf:
irf1:
type: spectral-gaussian
center: irf.center
width: irf.width
dispersion_center: irf.dispcenter
center_dispersion_coefficients: [irf.disp1, irf.disp2, irf.disp3]
model_dispersion_with_wavenumber: true

dataset:
dataset1:
initial_concentration: j1
megacomplex: [doas, decay, artifact]
irf: irf1
58 changes: 58 additions & 0 deletions 4TT/models/model_refined6osc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# type: doas

initial_concentration:
j1:
compartments: [S2, S1, T1, S2rel, T1hot]
parameters: [j.1, j.0, j.0, j.0, j.0]

k_matrix:
k1:
matrix:
"(S2rel, S2)": kinetic.to_S2rel_from_S2
"(S1, S2)": kinetic.to_S1_from_S2
"(S1, S2rel)": kinetic.to_S1_from_S2rel
"(T1hot, S2rel)": kinetic.to_T1hot_from_S2rel
"(T1hot, S1)": kinetic.to_T1hot_from_S1
"(T1, T1hot)": kinetic.to_T1_from_T1hot
"(T1, T1)": kinetic.from_T1

megacomplex:
doas:
type: damped-oscillation
labels: [osc1, osc2, osc3, osc4, osc5, osc6]
frequencies:
[osc.freq.1, osc.freq.2, osc.freq.3, osc.freq.4, osc.freq.5, osc.freq.6]
rates:
[
osc.rates.1,
osc.rates.2,
osc.rates.3,
osc.rates.4,
osc.rates.5,
osc.rates.6,
]
decay:
type: decay
k_matrix: [k1]
# baseline:
# type: baseline
# dimension: time
artifact:
type: coherent-artifact
order: 3
width: artifact.CAwidth

irf:
irf1:
type: spectral-gaussian
center: irf.center
width: irf.width
dispersion_center: irf.dispcenter
center_dispersion_coefficients: [irf.disp1, irf.disp2, irf.disp3]
model_dispersion_with_wavenumber: true

dataset:
4TT:
initial_concentration: j1
megacomplex: [doas, decay, artifact]
irf: irf1
52 changes: 52 additions & 0 deletions 4TT/models/model_sequential.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# type: doas

initial_concentration:
j1:
# compartments: [S2, S1, T1, S2rel, T1hot]
# parameters: [j.1, j.0, j.0, j.0, j.0]
compartments: [S2, S1, T1, T1hot]
parameters: [j.1, j.0, j.0, j.0]

k_matrix:
k1:
matrix:
# "(S2rel, S2)": kinetic.to_S2rel_from_S2
"(S1, S2)": kinetic.to_S1_from_S2
# "(S1, S2rel)": kinetic.to_S1_from_S2rel
# "(T1hot, S2rel)": kinetic.to_T1hot_from_S2rel
"(T1hot, S1)": kinetic.to_T1hot_from_S1
"(T1, T1hot)": kinetic.to_T1_from_T1hot
"(T1, T1)": kinetic.from_T1

megacomplex:
doas:
type: damped-oscillation
labels: [osc1, osc2, osc3, osc4]
frequencies: [osc.freq.1, osc.freq.2, osc.freq.3, osc.freq.4]
rates: [osc.rates.1, osc.rates.2, osc.rates.3, osc.rates.4]
decay:
type: decay
k_matrix: [k1]
# baseline:
# type: baseline
# dimension: time
artifact:
type: coherent-artifact
order: 3
width: artifact.CAwidth

irf:
irf1:
type: spectral-gaussian
center: irf.center
width: irf.width
dispersion_center: irf.dispcenter
center_dispersion_coefficients: [irf.disp1, irf.disp2, irf.disp3]
model_dispersion_with_wavenumber: true

dataset:
# dataset1:
4TT:
initial_concentration: j1
megacomplex: [doas, decay, artifact]
irf: irf1
51 changes: 51 additions & 0 deletions 4TT/models/model_sequential5osc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# type: doas

initial_concentration:
j1:
# compartments: [S2, S1, T1, S2rel, T1hot]
# parameters: [j.1, j.0, j.0, j.0, j.0]
compartments: [S2, S1, T1, T1hot]
parameters: [j.1, j.0, j.0, j.0]

k_matrix:
k1:
matrix:
# "(S2rel, S2)": kinetic.to_S2rel_from_S2
"(S1, S2)": kinetic.to_S1_from_S2
# "(S1, S2rel)": kinetic.to_S1_from_S2rel
# "(T1hot, S2rel)": kinetic.to_T1hot_from_S2rel
"(T1hot, S1)": kinetic.to_T1hot_from_S1
"(T1, T1hot)": kinetic.to_T1_from_T1hot
"(T1, T1)": kinetic.from_T1

megacomplex:
doas:
type: damped-oscillation
labels: [osc1, osc2, osc3, osc4, osc5]
frequencies: [osc.freq.1, osc.freq.2, osc.freq.3, osc.freq.4, osc.freq.5]
rates: [osc.rates.1, osc.rates.2, osc.rates.3, osc.rates.4, osc.rates.5]
decay:
type: decay
k_matrix: [k1]
# baseline:
# type: baseline
# dimension: time
artifact:
type: coherent-artifact
order: 3
width: artifact.CAwidth

irf:
irf1:
type: spectral-gaussian
center: irf.center
width: irf.width
dispersion_center: irf.dispcenter
center_dispersion_coefficients: [irf.disp1, irf.disp2, irf.disp3]
model_dispersion_with_wavenumber: true

dataset:
dataset1:
initial_concentration: j1
megacomplex: [doas, decay, artifact]
irf: irf1
61 changes: 61 additions & 0 deletions 4TT/models/model_sequential6osc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# type: doas

initial_concentration:
j1:
# compartments: [S2, S1, T1, S2rel, T1hot]
# parameters: [j.1, j.0, j.0, j.0, j.0]
compartments: [S2, S1, T1, T1hot]
parameters: [j.1, j.0, j.0, j.0]

k_matrix:
k1:
matrix:
# "(S2rel, S2)": kinetic.to_S2rel_from_S2
"(S1, S2)": kinetic.to_S1_from_S2
# "(S1, S2rel)": kinetic.to_S1_from_S2rel
# "(T1hot, S2rel)": kinetic.to_T1hot_from_S2rel
"(T1hot, S1)": kinetic.to_T1hot_from_S1
"(T1, T1hot)": kinetic.to_T1_from_T1hot
"(T1, T1)": kinetic.from_T1

megacomplex:
doas:
type: damped-oscillation
labels: [osc1, osc2, osc3, osc4, osc5, osc6]
frequencies:
[osc.freq.1, osc.freq.2, osc.freq.3, osc.freq.4, osc.freq.5, osc.freq.6]
rates:
[
osc.rates.1,
osc.rates.2,
osc.rates.3,
osc.rates.4,
osc.rates.5,
osc.rates.6,
]
decay:
type: decay
k_matrix: [k1]
# baseline:
# type: baseline
# dimension: time
artifact:
type: coherent-artifact
order: 3
width: artifact.CAwidth

irf:
irf1:
type: spectral-gaussian
center: irf.center
width: irf.width
dispersion_center: irf.dispcenter
center_dispersion_coefficients: [irf.disp1, irf.disp2, irf.disp3]
model_dispersion_with_wavenumber: true

dataset:
# dataset1:
4TT:
initial_concentration: j1
megacomplex: [doas, decay, artifact]
irf: irf1
Loading

0 comments on commit c1dc8ca

Please sign in to comment.