-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Refactor: Model and Parameters (#1135)
♻️ Complete refactor of model and parameter packages using attrs (#1135) Summary of changes: * Added basic model. * Added megacomplexes model. * New Model can load from dict. * Basic idea for item fill. * Added get issues. * Added item fill. * Added model as_dict. * Added model markdown. * Added get parameter labels. * Added validate dataset datasetmodel megacomplexes. * Added global items. * Replaced old model with new. * Adapted optimization. * Adapted builtin megacomplexes. * Reimplemented ParameterGroup as Parameters. * Adapted yml load parameters. * All test are working again. * Fixed mypy issues and added docstrings for model package. * Fixed small bugs. * 🩹 Fixed benchmarks * ♻️ Refactored by Sourcery * Fixed project parameter generation. * 💥 Raised min python version to 3.10 * Refactored clp penalties to have types. * Deprecated parameter group. * Fixed model as_dict aand validate. * Fixed unique megacomplex check. * Fixed damped oscillation megacomplex type. * Small fixes. * 🩹🗑️ Raised deprecation version for new deprecations to 0.9.0 🧪🗑️ Added test for clp_area_penalties deprecation * 🧹 Renamed fuctions not conforming to snake case * ✨ Added equality check for Parameters * ♻️ Made nan_or_equal work with general values not only numeric and moved it to glotaran.utils.helpers * 👌 Added helper decorator to omit default values from repr in attrs class 👌 Made Parameter omit default values in repr * 👌 Added proper repr to Parameters * 🧪🩹 Fixed and reactivated pandas tests * 🩹📚 Changed read the docs config to work with python 3.10 * Fixed bug in interval item. * Fixed Parameters.copy. * Added test to check that initial parameters don't get overwritten. * Included review comments. * Updated changelog. * 🩹 Fixed integration benchmark * 👌Avoid redefining built-in type * 📚 Added change to changelog Co-authored-by: s-weigand <[email protected]> Co-authored-by: Sourcery AI <> Co-authored-by: Joris Snellenburg <[email protected]>
- Loading branch information
1 parent
c8d7722
commit ac99524
Showing
127 changed files
with
4,582 additions
and
5,674 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,7 +19,7 @@ jobs: | |
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
python-version: "3.10" | ||
- name: Run pre-commit | ||
uses: pre-commit/[email protected] | ||
|
||
|
@@ -29,10 +29,10 @@ jobs: | |
steps: | ||
- name: Check out repo | ||
uses: actions/checkout@v3 | ||
- name: Set up Python 3.8 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
python-version: "3.10" | ||
- name: Install check manifest | ||
run: python -m pip install check-manifest 'setuptools>=62.4.0' | ||
- name: Run check manifest | ||
|
@@ -47,10 +47,10 @@ jobs: | |
with: | ||
conda-channels: conda-forge | ||
activate-conda: false | ||
- name: Set up Python 3.8 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
python-version: "3.10" | ||
- name: Install dependencies | ||
run: | | ||
conda install -y pandoc | ||
|
@@ -72,10 +72,10 @@ jobs: | |
with: | ||
conda-channels: conda-forge | ||
activate-conda: false | ||
- name: Set up Python 3.8 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
python-version: "3.10" | ||
- name: Install dependencies | ||
run: | | ||
conda install -y pandoc | ||
|
@@ -96,10 +96,10 @@ jobs: | |
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.8 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
python-version: "3.10" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install -U pip wheel | ||
|
@@ -117,7 +117,7 @@ jobs: | |
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macOS-latest] | ||
python-version: [3.8, 3.9, "3.10"] | ||
python-version: ["3.10"] | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
@@ -147,10 +147,10 @@ jobs: | |
needs: [test, docs, docs-notebooks] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python 3.8 | ||
- name: Set up Python 3.10 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: 3.8 | ||
python-version: "3.10" | ||
- name: Install dependencies | ||
run: | | ||
python -m pip install -U pip wheel 'setuptools>=62.4.0' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
benchmark/benchmarks/integration/ex_two_datasets/models/model_lt_0.7.0.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
type: kinetic-spectrum | ||
|
||
dataset: | ||
dataset1: | ||
megacomplex: [complex1] | ||
initial_concentration: input1 | ||
irf: irf1 | ||
scale: scale.1 | ||
dataset2: | ||
megacomplex: [complex1] | ||
initial_concentration: input2 | ||
irf: irf1 | ||
scale: scale.2 | ||
|
||
megacomplex: | ||
complex1: | ||
k_matrix: [km1] | ||
|
||
k_matrix: | ||
km1: | ||
matrix: | ||
(s1, s1): "rates.k1" | ||
(s2, s2): "rates.k2" | ||
(s3, s3): "rates.k3" | ||
|
||
initial_concentration: | ||
input1: | ||
compartments: [s1, s2, s3] | ||
parameters: [inputs.1, inputs.2, inputs.3] | ||
input2: | ||
compartments: [s1, s2, s3] | ||
parameters: [inputs.1, inputs.7, inputs.8] | ||
|
||
irf: | ||
irf1: | ||
type: spectral-multi-gaussian | ||
center: [irf.center] | ||
width: [irf.width] | ||
irf1_no_dispersion: | ||
type: spectral-multi-gaussian | ||
center: [irf.center] | ||
width: [irf.width] | ||
|
||
# It works without equal_area_penalties but then the inputs cannot be estimated | ||
equal_area_penalties: | ||
- type: equal_area | ||
source: s1 | ||
source_intervals: [[300, 3000]] | ||
target: s2 | ||
target_intervals: [[300, 3000]] | ||
parameter: area.1 | ||
weight: 0.1 | ||
- type: equal_area | ||
source: s1 | ||
source_intervals: [[300, 3000]] | ||
target: s3 | ||
target_intervals: [[300, 3000]] | ||
parameter: area.1 | ||
weight: 0.1 | ||
# Example of weight application: | ||
# weights: | ||
# - datasets: [dataset1, dataset2] | ||
# global_interval: [100, 102] | ||
# model_interval: [301, 502] | ||
# value: 0.95 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.