Skip to content

Commit

Permalink
Merge pull request #25 from JuBiotech/finish-raw-data
Browse files Browse the repository at this point in the history
Add and re-arrange raw data
  • Loading branch information
Y0dler authored Oct 13, 2024
2 parents 0c081d9 + 5617d6c commit 64482a9
Show file tree
Hide file tree
Showing 178 changed files with 1,552 additions and 75 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -605,3 +605,4 @@ idata_summary_*.xlsx
idata_*
*Sandbox*.ipynb
!/docs/source/notebooks/*.png
!/docs/source/notebooks/paper raw data/**/*.npy
18 changes: 3 additions & 15 deletions docs/source/markdown/Installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,8 @@ If you have already installed Miniconda, you can install Mamba on top of it but
The newest conda version should also work, just replace `mamba` with `conda` in step 2.)
```

2. Create a new Python environment (replace "name_of_environment" with your desired name) in the command line via
2. Create a new Python environment in the command line using the provided [`environment.yml`](https://github.com/JuBiotech/peak-performance/blob/main/environment.yml) file from the repo.
Download `environment.yml` first, then navigate to its location on the command line interface and run the following command:
```
mamba create -c conda-forge -n name_of_environment pymc nutpie arviz jupyter matplotlib openpyxl "python=3.10"
```
3. Install PeakPerformance:
- __Recommended__: Clone the PeakPerformance repository, then open the command line, navigate to your local clone, activate the Python environment created in the previous step, and install PeakPerformance via
```
pip install -e .
```
- __Alternative a__: Activate the Python environment created in the previous step and install PeakPerformance via PyPI using
```
pip install peak-performance
```
- __Alternative b__: Download the latest Python wheel, then open the command line, navigate to the directory containing the wheel, activate the Python environment created above, and install PeakPerformance via
```
pip install name_of_wheel.whl
mamba env create -f environment.yml
```
1,483 changes: 1,483 additions & 0 deletions docs/source/notebooks/Create_results_in_figure_2.ipynb

Large diffs are not rendered by default.

33 changes: 14 additions & 19 deletions docs/source/notebooks/Create_validation_plot_from_raw_data.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,13 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"%load_ext autoreload\n",
"%autoreload 2\n",
"\n",
"import arviz as az\n",
"import json\n",
"import numpy as np\n",
"import pandas\n",
"import pymc as pm\n",
"from matplotlib import pyplot as plt\n",
"from pathlib import Path"
]
Expand All @@ -31,33 +26,33 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#### 1) Preparation of evaluation of synthetic data (test 1)"
"# Preparation of evaluation of synthetic data (test 1)"
]
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"with open('test1_all_data.txt', 'r') as file:\n",
"with open(Path(\"./paper raw data/test1_all_data.txt\"), \"r\") as file:\n",
" all_data = json.loads(file.read())"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"#### 2) Prepartion of border-line cases normal vs. skew normal (test 2)"
"# Prepartion of border-line cases normal vs. skew normal (test 2)"
]
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
"df = pandas.read_excel(\"test2_summary.xlsx\")\n",
"df = pandas.read_excel(Path(\"./paper raw data/test2_summary.xlsx\"))\n",
"df_normal = df[(df.loc[:, \"model\"] == \"normal\") & (df.loc[:, \"Unnamed: 0\"].isin([\"area\", \"height\"]))]\n",
"df_normal.reset_index(inplace=True)\n",
"df_skew = df[(df.loc[:, \"model\"] == \"skew_normal\") & (df.loc[:, \"Unnamed: 0\"].isin([\"area\", \"height\"]))]\n",
Expand All @@ -78,16 +73,16 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#### 3) Prepartion of comparison to MultiQuant (test 3)"
"# Prepartion of comparison to MultiQuant (test 3)"
]
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 6,
"metadata": {},
"outputs": [],
"source": [
"df_comparison_total = pandas.read_excel(\"test3_df_comparison.xlsx\")\n",
"df_comparison_total = pandas.read_excel(Path(\"./paper raw data/test3_df_comparison.xlsx\"))\n",
"df_comparison_single = df_comparison_total[~df_comparison_total[\"PP experiment\"].isin([23, 24])]\n",
"df_comparison_double = df_comparison_total[df_comparison_total[\"PP experiment\"].isin([23, 24])]"
]
Expand All @@ -96,12 +91,12 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"#### 4) Plotting in one graph (for PeakPerformance paper)"
"# Plotting in one graph (for PeakPerformance paper)"
]
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 7,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -224,14 +219,14 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 8,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Last updated: 2024-10-11T17:56:34.996952+02:00\n",
"Last updated: 2024-10-13T15:10:41.315414+02:00\n",
"\n"
]
}
Expand Down
76 changes: 35 additions & 41 deletions docs/source/notebooks/Processing_test_1_raw_data.ipynb
Original file line number Diff line number Diff line change
@@ -1,51 +1,45 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Process raw data from synthetic tests"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"%load_ext autoreload\n",
"%autoreload 2\n",
"\n",
"import arviz as az\n",
"import json\n",
"import numpy as np\n",
"import pandas\n",
"import pymc as pm\n",
"from matplotlib import pyplot as plt\n",
"from pathlib import Path"
]
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
"raw_data_files = [\n",
" \"Normal model_normal data_noise level 0.6.xlsx\",\n",
" \"Normal model_normal data_noise level 1.2.xlsx\",\n",
" \"Normal model_skew normal data_noise level 0.6.xlsx\",\n",
" \"Skew normal model_skew normal data_noise level 0.6.xlsx\",\n",
" \"Skew normal model_skew normal data_noise level 1.2.xlsx\",\n",
" \"Skew normal model_normal data_noise level 0.6.xlsx\",\n",
" Path(\"./paper raw data/synthetic data sets for validation/Normal model_normal data_noise level 0.6.xlsx\"),\n",
" Path(\"./paper raw data/synthetic data sets for validation/Normal model_normal data_noise level 1.2.xlsx\"),\n",
" Path(\"./paper raw data/synthetic data sets for validation/Normal model_skew normal data_noise level 0.6.xlsx\"),\n",
" Path(\"./paper raw data/synthetic data sets for validation/Skew normal model_skew normal data_noise level 0.6.xlsx\"),\n",
" Path(\"./paper raw data/synthetic data sets for validation/Skew normal model_skew normal data_noise level 1.2.xlsx\"),\n",
" Path(\"./paper raw data/synthetic data sets for validation/Skew normal model_normal data_noise level 0.6.xlsx\"),\n",
"]\n",
"\n",
"parameters = [\"mean\", \"std\", \"area\", \"height\", \"alpha\", \"baseline_intercept\", \"baseline_slope\"]"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### Prepare data in df_results"
]
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 5,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -149,7 +143,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 6,
"metadata": {},
"outputs": [
{
Expand All @@ -159,9 +153,9 @@
"model: normal, data: normal, noise level: 0.6\n",
"model: normal, data: normal, noise level: 1.2\n",
"model: normal, data: skew normal, noise level: 0.6\n",
"model: skew normal, data: normal, noise level: 0.6\n",
"model: skew normal, data: skew normal, noise level: 0.6\n",
"model: skew normal, data: skew normal, noise level: 1.2\n"
"model: skew normal, data: skew normal, noise level: 1.2\n",
"model: skew normal, data: normal, noise level: 0.6\n"
]
}
],
Expand All @@ -180,7 +174,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 7,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -191,7 +185,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 8,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -221,14 +215,6 @@
" 0.1425229338854569,\n",
" 0.029251994462966387,\n",
" 0.02178598822049324]],\n",
" 'normal data, skew normal model': [[0.9993873333333333,\n",
" 1.145324094260921,\n",
" 1.0038603930164334,\n",
" 1.0021702322498285],\n",
" [0.025492314214288193,\n",
" 0.06460165579288266,\n",
" 0.0295645094605588,\n",
" 0.022277250178015084]],\n",
" 'skew normal data, skew normal model': [[1.0003276666666665,\n",
" 1.0178059537564914,\n",
" 0.9995769654521169,\n",
Expand All @@ -244,10 +230,18 @@
" [0.029588612507556917,\n",
" 0.13828870506270582,\n",
" 0.050852728197426554,\n",
" 0.03782158437972263]]}"
" 0.03782158437972263]],\n",
" 'normal data, skew normal model': [[0.9993873333333333,\n",
" 1.145324094260921,\n",
" 1.0038603930164334,\n",
" 1.0021702322498285],\n",
" [0.025492314214288193,\n",
" 0.06460165579288266,\n",
" 0.0295645094605588,\n",
" 0.022277250178015084]]}"
]
},
"execution_count": 6,
"execution_count": 8,
"metadata": {},
"output_type": "execute_result"
}
Expand Down Expand Up @@ -275,7 +269,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 9,
"metadata": {},
"outputs": [
{
Expand All @@ -284,7 +278,7 @@
"dict_keys(['normal data, normal model', 'normal data (higher noise), normal model', 'skew normal data, normal model', 'skew normal data, skew normal model', 'skew normal data (higher noise), skew normal model', 'normal data, skew normal model'])"
]
},
"execution_count": 7,
"execution_count": 9,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -297,7 +291,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 10,
"metadata": {},
"outputs": [],
"source": [
Expand All @@ -309,14 +303,14 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 11,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"Last updated: 2024-10-11T18:34:57.629742+02:00\n",
"Last updated: 2024-10-13T15:03:43.532805+02:00\n",
"\n"
]
}
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
File renamed without changes.
16 changes: 16 additions & 0 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: pp_env
channels:
- conda-forge
dependencies:
- arviz
- jupyter
- matplotlib
- numba
- numpy
- nutpie
- openpyxl
- pip
- pymc
- python=3.11
- pip:
- peak-performance

0 comments on commit 64482a9

Please sign in to comment.