Skip to content

Commit

Permalink
♻️ Refactor with project API (#4)
Browse files Browse the repository at this point in the history
This change refactors the case studies to use the project API and did lead to some[ improvements in the project API
itself](glotaran/pyglotaran#1257).

In addition, it cleans up the model and parameter files as well as notebooks.
Further improvements like using glotaran generated clp guides and explaining the smoothing due `clp_relations` will follow in a different PR.

### Change summary

- [🧹 Add project anchor files to git
ignore](75fd1ce)
- [♻️ Moved original data files from data subfolder to
measured_data](2ec5a1c)
- [🧹 Added data folder to gitignore since it gets populated by
import_data](467fd91)
- [♻️ Converted target_rc to project
API](0701661)
- [♻️ Converted target_rcg_compare to project
API](01ba768)
- [♻️ Converted target_rcg_gcrcg_rcgcr_refine to project
API](49b92c9)
- [♻️ Moved original data 4TT files from data subfolder to
measured_data](bd06310)
- [👌 Added clp_relations for smoothong of generated guidance
spectra](cc60ac0)
- [🧹 Cleaned rcg_refine models and parameters from unused
code](524af94)
- [🧹 Removed dead code comments in target_rc
model](a88cd8c)
- [👌 Use result create_clp_guide_dataset method instead of
function](84fa1ed)
- [👌 Show cleaned up model and parameter
definition](7bdda07)
- [♻️ Converted 4TT to project
API](89ac3a0)
- [♻️ Moved original data dPSI files from data subfolder to
measured_data](85ce095)
- [🧹 Ignore data folders in general since they get populated by
import_data](953dfa5)
- [♻️ Converted dPSI to project
API](73816e0)
- [🧹 Make use of improved project
API](b434331)
- [🧹 Cleaned up rc model and
parameters](079057b)
- [🧹 Cleaned up target_rcg_gcrcg_rcgcr_refine model and
parameters](621113c)
- [🧹 Cleaned up 4TT models and
parameters](f93712f)
- [🧹 Cleaned up dPSI
model](f0deea3)
- [🧹 Cleaned up rc
notebook](3ad4b6c)
- [🔧 Ignore pdfs folder when running
pytest](2a08eee)

---------

Co-authored-by: Ivo van Stokkum <i.h.m.van.stokkum@vu.nl>
  • Loading branch information
s-weigand and ism200 authored Mar 1, 2023
1 parent 179a214 commit 87becb8
Show file tree
Hide file tree
Showing 60 changed files with 693 additions and 1,548 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ dmypy.json
# vscode config
.vscode

# project data folder populated by data_import
data/

# result folders
20*/
results/
Expand All @@ -141,3 +144,6 @@ guide/

# Generated PDFs and tex source
pdfs

# project files
*.gta
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
# type: doas

initial_concentration:
j1:
compartments: [S2, S1, T1, S2rel, T1hot]
Expand Down Expand Up @@ -34,9 +32,6 @@ megacomplex:
decay:
type: decay
k_matrix: [k1]
# baseline:
# type: baseline
# dimension: time
artifact:
type: coherent-artifact
order: 3
Expand All @@ -52,7 +47,7 @@ irf:
model_dispersion_with_wavenumber: true

dataset:
4TT:
corr4TT:
initial_concentration: j1
megacomplex: [doas, decay, artifact]
irf: irf1
11 changes: 0 additions & 11 deletions 4TT/models/model_sequential.yml → 4TT/models/sequential.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
# 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
Expand All @@ -27,9 +20,6 @@ megacomplex:
decay:
type: decay
k_matrix: [k1]
# baseline:
# type: baseline
# dimension: time
artifact:
type: coherent-artifact
order: 3
Expand All @@ -45,7 +35,6 @@ irf:
model_dispersion_with_wavenumber: true

dataset:
# dataset1:
4TT:
initial_concentration: j1
megacomplex: [doas, decay, artifact]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
# 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
Expand All @@ -27,9 +20,6 @@ megacomplex:
decay:
type: decay
k_matrix: [k1]
# baseline:
# type: baseline
# dimension: time
artifact:
type: coherent-artifact
order: 3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,12 @@
# 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
Expand All @@ -36,9 +29,6 @@ megacomplex:
decay:
type: decay
k_matrix: [k1]
# baseline:
# type: baseline
# dimension: time
artifact:
type: coherent-artifact
order: 3
Expand All @@ -54,8 +44,7 @@ irf:
model_dispersion_with_wavenumber: true

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

initial_concentration:
j1:
compartments: [S2, S1, T1, S2rel, T1hot]
Expand All @@ -25,9 +23,6 @@ megacomplex:
decay:
type: decay
k_matrix: [k1]
# baseline:
# type: baseline
# dimension: time
artifact:
type: coherent-artifact
order: 3
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
osc:
freq: [752.314148, 495.196503, 206.952820, 767.406006, { vary: True }]
# rates: [
# 3.04113483, 11.2777481, 8.30780029, -9.46621990, {vary: True}]
# 3.04113483, 11.2777481, 8.3078009, {vary: True}]
rates:
- ["1", 3.04113483, { vary: True }]
- ["2", 11.2777481, { vary: True }]
Expand All @@ -14,10 +11,7 @@ j:
- ["0", 0.0, { non-negative: False, vary: False }]

kinetic:
# - ['to_S2rel_from_S2',6.58372021, {non-negative: True, vary: False}]
- ["to_S1_from_S2", 8.39700508, { non-negative: True, vary: True }]
# - ['to_S1_from_S2rel', 4.36121597, {non-negative: True, vary: False}]
# - ['to_T1hot_from_S2rel', 1.6, {non-negative: True, vary: False}]
- ["to_T1hot_from_S1", 2.24768806, { non-negative: True, vary: True }]
- ["to_T1_from_T1hot", 0.568519056, { non-negative: True, vary: False }]
- ["from_T1", 1.00000005E-03, { non-negative: True, vary: False }]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
osc:
freq: [752.314148, 495.196503, 206.952820, 767.406006, { vary: True }]
# rates: [
# 3.04113483, 11.2777481, 8.30780029, -9.46621990, {vary: True}]
# 3.04113483, 11.2777481, 8.3078009, {vary: True}]
rates:
- ["1", 3.04113483, { vary: True }]
- ["2", 11.2777481, { vary: True }]
Expand All @@ -14,10 +11,7 @@ j:
- ["0", 0.0, { non-negative: False, vary: False }]

kinetic:
# - ['to_S2rel_from_S2',6.58372021, {non-negative: True, vary: False}]
- ["to_S1_from_S2", 8.39700508, { non-negative: True, vary: True }]
# - ['to_S1_from_S2rel', 4.36121597, {non-negative: True, vary: False}]
# - ['to_T1hot_from_S2rel', 1.6, {non-negative: True, vary: False}]
- ["to_T1hot_from_S1", 2.24768806, { non-negative: True, vary: True }]
- ["to_T1_from_T1hot", 0.568519056, { non-negative: True, vary: True }]
- ["from_T1", 1.00000005E-03, { non-negative: True, vary: False }]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
osc:
freq: [752.314148, 495.196503, 206.952820, 767.406006, { vary: True }]
# rates: [
# 3.04113483, 11.2777481, 8.30780029, -9.46621990, {vary: True}]
# 3.04113483, 11.2777481, 8.3078009, {vary: True}]
rates:
- ["1", 3.04113483, { vary: True }]
- ["2", 11.2777481, { vary: True }]
Expand Down
Loading

0 comments on commit 87becb8

Please sign in to comment.