avoca 0.11.2__tar.gz → 0.11.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {avoca-0.11.2 → avoca-0.11.3}/PKG-INFO +1 -1
- {avoca-0.11.2 → avoca-0.11.3}/avoca/bindings/gcwerks.py +7 -1
- avoca-0.11.3/examples/get_tanks.ipynb +168 -0
- {avoca-0.11.2 → avoca-0.11.3}/pyproject.toml +1 -1
- {avoca-0.11.2 → avoca-0.11.3}/.gitignore +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/.gitlab-ci.yml +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/.readthedocs.yaml +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/.vscode/settings.json +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/LICENCE.txt +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/README.md +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/__init__.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/bindings/__init__.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/bindings/ebas.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/bindings/ebas_flags.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/bindings/gcwerks-report.conf +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/bindings/gcwerks_gui.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/bindings/nabel.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/bindings/qa_tool.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/bindings/synspec.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/export_nas.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/flagging.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/flags.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/io.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/logging.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/manager.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/qa_class/__init__.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/qa_class/abstract.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/qa_class/concs.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/qa_class/generate_classes_doc.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/qa_class/invalid.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/qa_class/rt.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/qa_class/test.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/qa_class/zscore.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/requirements.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/settings.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/testing/__init__.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/testing/df.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/utils/__init__.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/utils/flags_doc.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/avoca/utils/torch_models.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/data/.avoca/config.yaml +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/data/CH0001G.20240219123300.20240307132229.online_gc.NMHC.air.16d.61mn.CH01L_Agilent_GC-MS-MEDUSA_Medusa-12_JFJ.CH01L_gc_ms.lev0.nas +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/data/tests/missing_area_cols.csv +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/data/voc_jan2jun_2023.csv +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/docs/Makefile +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/docs/make.bat +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/docs/source/bindings/ebas.md +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/docs/source/bindings/gcwerks.md +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/docs/source/bindings/index.rst +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/docs/source/bindings/qa_tool.md +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/docs/source/conf.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/docs/source/index.rst +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/docs/source/quickstart.ipynb +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/examples/config.yaml +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/examples/convert_synspec_to_gcwerks.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/examples/data_qa.ipynb +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/examples/data_qa_gcwerks.ipynb +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/examples/export_gc_werks.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/examples/export_gc_werks_secondary_peaks.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/examples/read_nas.ipynb +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/tests/bindings/gcwerks.dat +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/tests/bindings/test_gcwerks.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/tests/bindings/test_qatool.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/tests/test_assigners.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/tests/test_flagging.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/tests/test_io.py +0 -0
- {avoca-0.11.2 → avoca-0.11.3}/tests/test_manager.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: avoca
|
|
3
|
-
Version: 0.11.
|
|
3
|
+
Version: 0.11.3
|
|
4
4
|
Summary: @voc@: Quality assessement of measurement data
|
|
5
5
|
Project-URL: Homepage, https://gitlab.com/empa503/atmospheric-measurements/avoca
|
|
6
6
|
Project-URL: Bug Tracker, https://gitlab.com/empa503/atmospheric-measurements/avoca/-/issues
|
|
@@ -93,8 +93,9 @@ flag_values = {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
# Show the flags and the columns they are applied to
|
|
96
|
-
|
|
96
|
+
flags_allowed = list(flag_values.keys())
|
|
97
97
|
# Add the last values allowed in the columns
|
|
98
|
+
flags_known = flags_allowed.copy()
|
|
98
99
|
flags_known.extend(
|
|
99
100
|
[
|
|
100
101
|
"n", # From nan
|
|
@@ -122,6 +123,7 @@ allowed_vars = [
|
|
|
122
123
|
"C",
|
|
123
124
|
"ht",
|
|
124
125
|
"w",
|
|
126
|
+
"RL.report",
|
|
125
127
|
"norm_ht",
|
|
126
128
|
"norm_a",
|
|
127
129
|
"C_ht",
|
|
@@ -221,6 +223,10 @@ def read_gcwerks(
|
|
|
221
223
|
# Last character is the flag
|
|
222
224
|
flags: pd.Series = serie_str.str[-1]
|
|
223
225
|
if col[1] in cols_float:
|
|
226
|
+
# Remove the flag value when given
|
|
227
|
+
serie_str = serie_str.apply(
|
|
228
|
+
lambda x: x[:-1] if x[-1] in flags_allowed else x
|
|
229
|
+
)
|
|
224
230
|
# Convert the serie to numeric
|
|
225
231
|
df[col] = pd.to_numeric(serie_str, errors="coerce")
|
|
226
232
|
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
{
|
|
2
|
+
"cells": [
|
|
3
|
+
{
|
|
4
|
+
"cell_type": "code",
|
|
5
|
+
"execution_count": null,
|
|
6
|
+
"id": "cbff1d1a",
|
|
7
|
+
"metadata": {},
|
|
8
|
+
"outputs": [],
|
|
9
|
+
"source": [
|
|
10
|
+
"%load_ext autoreload\n",
|
|
11
|
+
"%autoreload 2"
|
|
12
|
+
]
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"cell_type": "code",
|
|
16
|
+
"execution_count": null,
|
|
17
|
+
"id": "5564964a",
|
|
18
|
+
"metadata": {},
|
|
19
|
+
"outputs": [],
|
|
20
|
+
"source": [
|
|
21
|
+
"import pandas as pd \n",
|
|
22
|
+
"\n",
|
|
23
|
+
"from avoca.bindings.gcwerks import read_gcwerks, export\n",
|
|
24
|
+
"\n",
|
|
25
|
+
"from pathlib import Path\n",
|
|
26
|
+
"from datetime import datetime\n"
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
"cell_type": "code",
|
|
31
|
+
"execution_count": null,
|
|
32
|
+
"id": "bba5e278",
|
|
33
|
+
"metadata": {},
|
|
34
|
+
"outputs": [],
|
|
35
|
+
"source": [
|
|
36
|
+
"\n",
|
|
37
|
+
"\n",
|
|
38
|
+
"workdir = Path('./KSJ_flask')\n",
|
|
39
|
+
"workdir.mkdir(exist_ok=True)\n",
|
|
40
|
+
"temp_file = workdir / 'sevoflurane.dat'\n",
|
|
41
|
+
"export(\n",
|
|
42
|
+
" workdir=workdir,\n",
|
|
43
|
+
" gcdir=\"/agage/empa-medusa\", \n",
|
|
44
|
+
" compounds=['sevoflurane'], \n",
|
|
45
|
+
" out_file=temp_file, \n",
|
|
46
|
+
" date_start=datetime(2010, 1, 1),\n",
|
|
47
|
+
" variables=['C', 'RL.report' ]\n",
|
|
48
|
+
" \n",
|
|
49
|
+
")\n",
|
|
50
|
+
"df_gcwerks = read_gcwerks(temp_file, runtypes=['tank'])\n",
|
|
51
|
+
"df_gcwerks"
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
"cell_type": "code",
|
|
56
|
+
"execution_count": null,
|
|
57
|
+
"id": "dcffbe3e",
|
|
58
|
+
"metadata": {},
|
|
59
|
+
"outputs": [],
|
|
60
|
+
"source": [
|
|
61
|
+
"mini_archive_file = \"/agage/empa-medusa/logs/hardware.log/MiniArchive2013\"\n",
|
|
62
|
+
"lines = []\n",
|
|
63
|
+
"\n",
|
|
64
|
+
"columns = [\n",
|
|
65
|
+
" 'measurement_time',\n",
|
|
66
|
+
" 'sample_id',\n",
|
|
67
|
+
" 'tank_id',\n",
|
|
68
|
+
" 'tank_material',\n",
|
|
69
|
+
" 'pressure',\n",
|
|
70
|
+
" 'lon',\n",
|
|
71
|
+
" 'lat',\n",
|
|
72
|
+
" 'sampling_time',\n",
|
|
73
|
+
" 'station', \n",
|
|
74
|
+
" 'filling_method', \n",
|
|
75
|
+
" 'sampling_volume',\n",
|
|
76
|
+
" 'operator',\n",
|
|
77
|
+
"]\n",
|
|
78
|
+
"with open(mini_archive_file, 'r') as f:\n",
|
|
79
|
+
" for i, line in enumerate(f):\n",
|
|
80
|
+
" if line.startswith('#'):\n",
|
|
81
|
+
" continue\n",
|
|
82
|
+
" if line.strip() == '':\n",
|
|
83
|
+
" continue\n",
|
|
84
|
+
" values = line.strip().split()\n",
|
|
85
|
+
" if len(values) < len(columns):\n",
|
|
86
|
+
" print(f\"Skipping line {line} with insufficient values: {line.strip()}\")\n",
|
|
87
|
+
" continue\n",
|
|
88
|
+
" lines.append(values[:len(columns)])\n",
|
|
89
|
+
"\n",
|
|
90
|
+
"lines\n",
|
|
91
|
+
"df = pd.DataFrame(lines, columns=columns)\n",
|
|
92
|
+
"df"
|
|
93
|
+
]
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
"cell_type": "code",
|
|
97
|
+
"execution_count": null,
|
|
98
|
+
"id": "1abc794d",
|
|
99
|
+
"metadata": {},
|
|
100
|
+
"outputs": [],
|
|
101
|
+
"source": [
|
|
102
|
+
"df['tank_material'].unique()\n",
|
|
103
|
+
"df['sampling_time'] = pd.to_datetime(df['sampling_time'], format='%Y%m%d')\n",
|
|
104
|
+
"df['measurement_time'] = pd.to_datetime(df['measurement_time'], format='%y%m%d.%H%M')\n",
|
|
105
|
+
"df_ksg = df.loc[df['station'] == 'KSG']\n",
|
|
106
|
+
"df_ksg"
|
|
107
|
+
]
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"cell_type": "code",
|
|
111
|
+
"execution_count": null,
|
|
112
|
+
"id": "8664c16a",
|
|
113
|
+
"metadata": {},
|
|
114
|
+
"outputs": [],
|
|
115
|
+
"source": [
|
|
116
|
+
"df_gcwerks_ksg = df_gcwerks.loc[df_gcwerks[('-', 'sample')].str.startswith('KSG')].copy()\n",
|
|
117
|
+
"\n",
|
|
118
|
+
"# access the string from 3:9 of the column \n",
|
|
119
|
+
"df_gcwerks_ksg['sampling_time'] = pd.to_datetime(df_gcwerks_ksg[('-', 'sample')].str[3:9], format='%y%m%d')\n",
|
|
120
|
+
"df_gcwerks_ksg"
|
|
121
|
+
]
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
"cell_type": "code",
|
|
125
|
+
"execution_count": null,
|
|
126
|
+
"id": "dbc981ad",
|
|
127
|
+
"metadata": {},
|
|
128
|
+
"outputs": [],
|
|
129
|
+
"source": [
|
|
130
|
+
"df_gcwerks_ksg"
|
|
131
|
+
]
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
"cell_type": "code",
|
|
135
|
+
"execution_count": null,
|
|
136
|
+
"id": "b5a49cd0",
|
|
137
|
+
"metadata": {},
|
|
138
|
+
"outputs": [],
|
|
139
|
+
"source": [
|
|
140
|
+
"plt.figure(figsize=(10, 6))\n",
|
|
141
|
+
"df_gcwerks_ksg.plot(x='sampling_time', y=('sevoflurane', 'C'), kind='scatter', title='KSG Sevoflurane Concentration')\n",
|
|
142
|
+
"plt.savefig(workdir / 'KSG_sevoflurane_concentration.png')\n",
|
|
143
|
+
"plt.show()"
|
|
144
|
+
]
|
|
145
|
+
}
|
|
146
|
+
],
|
|
147
|
+
"metadata": {
|
|
148
|
+
"kernelspec": {
|
|
149
|
+
"display_name": "Python 3",
|
|
150
|
+
"language": "python",
|
|
151
|
+
"name": "python3"
|
|
152
|
+
},
|
|
153
|
+
"language_info": {
|
|
154
|
+
"codemirror_mode": {
|
|
155
|
+
"name": "ipython",
|
|
156
|
+
"version": 3
|
|
157
|
+
},
|
|
158
|
+
"file_extension": ".py",
|
|
159
|
+
"mimetype": "text/x-python",
|
|
160
|
+
"name": "python",
|
|
161
|
+
"nbconvert_exporter": "python",
|
|
162
|
+
"pygments_lexer": "ipython3",
|
|
163
|
+
"version": "3.12.4"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"nbformat": 4,
|
|
167
|
+
"nbformat_minor": 5
|
|
168
|
+
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|