pychemstation 0.5.3.dev1__py3-none-any.whl → 0.5.5__py3-none-any.whl
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.
- pychemstation/control/__init__.py +0 -1
- pychemstation/control/comm.py +9 -5
- pychemstation/control/controllers/__init__.py +4 -0
- pychemstation/control/controllers/comm.py +206 -0
- pychemstation/control/controllers/method.py +274 -0
- pychemstation/control/controllers/sequence.py +211 -0
- pychemstation/control/controllers/table_controller.py +198 -0
- pychemstation/control/hplc.py +10 -11
- pychemstation/control/table/sequence.py +32 -39
- pychemstation/control/table/table_controller.py +33 -9
- pychemstation/utils/chromatogram.py +7 -26
- pychemstation/utils/table_types.py +1 -0
- {pychemstation-0.5.3.dev1.dist-info → pychemstation-0.5.5.dist-info}/METADATA +12 -9
- pychemstation-0.5.5.dist-info/RECORD +39 -0
- tests/constants.py +4 -4
- tests/test_comb.py +74 -60
- tests/test_sequence.py +48 -0
- pychemstation-0.5.3.dev1.dist-info/RECORD +0 -34
- {pychemstation-0.5.3.dev1.dist-info → pychemstation-0.5.5.dist-info}/LICENSE +0 -0
- {pychemstation-0.5.3.dev1.dist-info → pychemstation-0.5.5.dist-info}/WHEEL +0 -0
- {pychemstation-0.5.3.dev1.dist-info → pychemstation-0.5.5.dist-info}/top_level.txt +0 -0
@@ -6,6 +6,7 @@ Authors: Lucy Hao
|
|
6
6
|
|
7
7
|
import abc
|
8
8
|
import os
|
9
|
+
import time
|
9
10
|
from typing import Union, Optional
|
10
11
|
|
11
12
|
import polling
|
@@ -15,7 +16,7 @@ from ...control import CommunicationController
|
|
15
16
|
from ...utils.chromatogram import AgilentHPLCChromatogram
|
16
17
|
from ...utils.macro import Command, HPLCRunningStatus, Response
|
17
18
|
from ...utils.method_types import MethodTimetable
|
18
|
-
from ...utils.sequence_types import SequenceDataFiles
|
19
|
+
from ...utils.sequence_types import SequenceDataFiles, SequenceTable
|
19
20
|
from ...utils.table_types import Table, TableOperation, RegisterFlag
|
20
21
|
|
21
22
|
|
@@ -82,6 +83,11 @@ class TableController(abc.ABC):
|
|
82
83
|
def get_row(self, row: int):
|
83
84
|
pass
|
84
85
|
|
86
|
+
def delete_row(self, row: int):
|
87
|
+
self.sleepy_send(TableOperation.DELETE_ROW.value.format(register=self.table.register,
|
88
|
+
table_name=self.table.name,
|
89
|
+
row=row))
|
90
|
+
|
85
91
|
def add_row(self):
|
86
92
|
"""
|
87
93
|
Adds a row to the provided table for currently loaded method or sequence.
|
@@ -124,7 +130,7 @@ class TableController(abc.ABC):
|
|
124
130
|
res = self.controller.receive()
|
125
131
|
|
126
132
|
if res.is_ok():
|
127
|
-
self.send("Sleep 1")
|
133
|
+
self.send("Sleep 0.1")
|
128
134
|
self.send('Print Rows')
|
129
135
|
return res
|
130
136
|
else:
|
@@ -137,24 +143,42 @@ class TableController(abc.ABC):
|
|
137
143
|
max_tries=10)
|
138
144
|
return started_running
|
139
145
|
|
140
|
-
def check_hplc_done_running(self,
|
146
|
+
def check_hplc_done_running(self,
|
147
|
+
method: Optional[MethodTimetable] = None,
|
148
|
+
sequence: Optional[SequenceTable] = None) -> Result[str, str]:
|
141
149
|
"""
|
142
150
|
Checks if ChemStation has finished running and can read data back
|
143
151
|
|
144
152
|
:param method: if you are running a method and want to read back data, the timeout period will be adjusted to be longer than the method's runtime
|
145
153
|
:return: Return True if data can be read back, else False.
|
146
154
|
"""
|
147
|
-
timeout = 10 * 60
|
155
|
+
timeout = 10 * 60
|
156
|
+
if method:
|
157
|
+
timeout = ((method.first_row.maximum_run_time + 2) * 60)
|
158
|
+
if sequence:
|
159
|
+
timeout *= len(sequence.rows)
|
160
|
+
|
148
161
|
most_recent_folder = self.retrieve_recent_data_files()
|
149
162
|
finished_run = polling.poll(
|
150
|
-
lambda: self.controller.check_if_running(
|
163
|
+
lambda: self.controller.check_if_running(),
|
151
164
|
timeout=timeout,
|
152
|
-
step=
|
165
|
+
step=60
|
153
166
|
)
|
167
|
+
|
154
168
|
if finished_run:
|
155
|
-
|
156
|
-
|
157
|
-
|
169
|
+
if os.path.exists(most_recent_folder):
|
170
|
+
return Ok(most_recent_folder)
|
171
|
+
else:
|
172
|
+
subdirs = [x[0] for x in os.walk(self.data_dir)]
|
173
|
+
potential_folders = sorted(list(filter(lambda d: most_recent_folder in d, subdirs)))
|
174
|
+
parent_dirs = []
|
175
|
+
for folder in potential_folders:
|
176
|
+
path = os.path.normpath(folder)
|
177
|
+
split_folder = path.split(os.sep)
|
178
|
+
if most_recent_folder in split_folder[-1]:
|
179
|
+
parent_dirs.append(folder)
|
180
|
+
parent_dir = sorted(parent_dirs, reverse=True)[0]
|
181
|
+
return Ok(parent_dir)
|
158
182
|
else:
|
159
183
|
return Err("Run did not complete as expected")
|
160
184
|
|
@@ -1,17 +1,14 @@
|
|
1
1
|
"""Module for HPLC chromatogram data loading and manipulating"""
|
2
2
|
|
3
3
|
import os
|
4
|
-
import logging
|
5
4
|
import time
|
5
|
+
from dataclasses import dataclass
|
6
6
|
|
7
7
|
import numpy as np
|
8
8
|
|
9
9
|
from .parsing import CHFile
|
10
10
|
from ..analysis import AbstractSpectrum
|
11
11
|
|
12
|
-
# Chemstation data path
|
13
|
-
DATA_DIR = r"C:\Chem32\1\Data"
|
14
|
-
|
15
12
|
# standard filenames for spectral data
|
16
13
|
CHANNELS = {"A": "01", "B": "02", "C": "03", "D": "04"}
|
17
14
|
|
@@ -105,26 +102,10 @@ class AgilentHPLCChromatogram(AbstractSpectrum):
|
|
105
102
|
np.savez_compressed(npz_file, times=data.times, values=data.values)
|
106
103
|
return np.array(data.times), np.array(data.values)
|
107
104
|
|
108
|
-
def extract_peakarea(self, experiment_dir: str):
|
109
|
-
"""
|
110
|
-
Reads processed data from Chemstation report files.
|
111
105
|
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
# return data
|
119
|
-
pass
|
120
|
-
|
121
|
-
def default_processing(self):
|
122
|
-
"""
|
123
|
-
Processes the chromatogram in place.
|
124
|
-
"""
|
125
|
-
# trim first 5 min and last 3 min of run
|
126
|
-
self.trim(5, 25)
|
127
|
-
# parameters found to work best for chromatogram data
|
128
|
-
self.correct_baseline(lmbd=1e5, p=0.0001, n_iter=10)
|
129
|
-
# get all peaks in processed chromatogram
|
130
|
-
self.find_peaks()
|
106
|
+
@dataclass
|
107
|
+
class AgilentChannelChromatogramData:
|
108
|
+
A: AgilentHPLCChromatogram
|
109
|
+
B: AgilentHPLCChromatogram
|
110
|
+
C: AgilentHPLCChromatogram
|
111
|
+
D: AgilentHPLCChromatogram
|
@@ -9,6 +9,7 @@ class TableOperation(Enum):
|
|
9
9
|
DELETE_TABLE = 'DelTab {register}, "{table_name}"'
|
10
10
|
CREATE_TABLE = 'NewTab {register}, "{table_name}"'
|
11
11
|
NEW_ROW = 'InsTabRow {register}, "{table_name}"'
|
12
|
+
DELETE_ROW = 'DelTabRow {register}, "{table_name}", {row}'
|
12
13
|
EDIT_ROW_VAL = 'SetTabVal "{register}", "{table_name}", {row}, "{col_name}", {val}'
|
13
14
|
EDIT_ROW_TEXT = 'SetTabText "{register}", "{table_name}", {row}, "{col_name}", "{val}"'
|
14
15
|
GET_ROW_VAL = 'TabVal("{register}", "{table_name}", {row}, "{col_name}")'
|
@@ -1,8 +1,8 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pychemstation
|
3
|
-
Version: 0.5.
|
3
|
+
Version: 0.5.5
|
4
4
|
Summary: Library to interact with Chemstation software, primarily used in Hein lab
|
5
|
-
Home-page: https://gitlab.com/heingroup/pychemstation
|
5
|
+
Home-page: https://gitlab.com/heingroup/device-api/pychemstation
|
6
6
|
Author: Lucy Hao
|
7
7
|
Author-email: lhao03@student.ubc.ca
|
8
8
|
Classifier: Programming Language :: Python :: 3
|
@@ -12,6 +12,7 @@ Description-Content-Type: text/markdown
|
|
12
12
|
License-File: LICENSE
|
13
13
|
Requires-Dist: polling
|
14
14
|
Requires-Dist: seabreeze
|
15
|
+
Requires-Dist: xsdata
|
15
16
|
|
16
17
|
# Agilent HPLC Macro Control
|
17
18
|
|
@@ -40,7 +41,7 @@ pip install pychemstation
|
|
40
41
|
where you will put your
|
41
42
|
MACRO file(s).
|
42
43
|
3. Download the [
|
43
|
-
`hplc_talk.mac`](https://
|
44
|
+
`hplc_talk.mac`](https://gitlab.com/heingroup/device-api/pychemstation/-/blob/main/tests/hplc_talk.mac).
|
44
45
|
- On line 69, change the path name up to `\cmd` and `\reply`. For instance, you should have:
|
45
46
|
`MonitorFile "[my path]\cmd", "[my path]\reply"`
|
46
47
|
- and then add this file to the folder from the previous step.
|
@@ -77,13 +78,12 @@ hplc_controller = HPLCController(data_dir=DATA_DIR,
|
|
77
78
|
hplc_controller.preprun()
|
78
79
|
hplc_controller.switch_method(method_name=DEFAULT_METHOD)
|
79
80
|
hplc_controller.run_method(experiment_name="Run 10")
|
80
|
-
|
81
|
+
chrom = hplc_controller.get_last_run_method_data()
|
81
82
|
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
chromatogram_data.to_csv("Run 10.csv", index=False)
|
83
|
+
# afterwards, save, analyze or plot the data!
|
84
|
+
values = {"x": chrom.A.x, "y": chrom.A.y}
|
85
|
+
chromatogram_data = pd.DataFrame.from_dict(values)
|
86
|
+
chromatogram_data.to_csv("Run 10.csv", index=False)
|
87
87
|
```
|
88
88
|
|
89
89
|
## Adding your own MACROs
|
@@ -102,3 +102,6 @@ Lucy Hao
|
|
102
102
|
|
103
103
|
- Adapted from [**AnalyticalLabware**](https://github.com/croningp/analyticallabware), created by members in the Cronin
|
104
104
|
Group. Copyright © Cronin Group, used under the [CC-BY-4.0](https://creativecommons.org/licenses/by/4.0/) license.
|
105
|
+
- Adapted from the [MACROS](https://github.com/Bourne-Group/HPLCMethodOptimisationGUI)
|
106
|
+
used in [**Operator-free HPLC automated method development guided by Bayesian optimization**](https://pubs.rsc.org/en/content/articlelanding/2024/dd/d4dd00062e),
|
107
|
+
created by members in the Bourne Group. Copyright © Bourne Group, used under the [MIT](https://opensource.org/license/mit) license.
|
@@ -0,0 +1,39 @@
|
|
1
|
+
pychemstation/__init__.py,sha256=SpTl-Tg1B1HTyjNOE-8ue-N2wGnXN_2zl7RFUSxlkiM,33
|
2
|
+
pychemstation/analysis/__init__.py,sha256=EWoU47iyn9xGS-b44zK9eq50bSjOV4AC5dvt420YMI4,44
|
3
|
+
pychemstation/analysis/base_spectrum.py,sha256=FBvwzLtF9mdqW7f8ETY9G4cpfJ-SzbiSkZq9EtXcSXo,17045
|
4
|
+
pychemstation/analysis/spec_utils.py,sha256=8NZMV0dtfxZLARjWzM5ks0tgEYQv_SKUiZzba2IoKgw,10505
|
5
|
+
pychemstation/analysis/utils.py,sha256=ISupAOb_yqA4_DZRK9v18UL-XjUQccAicIJKb1VMnGg,2055
|
6
|
+
pychemstation/control/__init__.py,sha256=4xTy8X-mkn_PPZKr7w9rnj1wZhtmTesbQptPhpYmKXs,64
|
7
|
+
pychemstation/control/comm.py,sha256=u44g1hTluQ0yUG93Un-QAshScoDpgYRrZfFTgweP5tY,7386
|
8
|
+
pychemstation/control/hplc.py,sha256=L1-cBQ7-thuITx1Mqq3lYXo832nEQtRJEX7nlLvRYrg,6732
|
9
|
+
pychemstation/control/controllers/__init__.py,sha256=di3ytLIK-35XC_THw4IjNaOtCUTe7GuEOFb-obmREw4,166
|
10
|
+
pychemstation/control/controllers/comm.py,sha256=iltKMNfdp_8INA5Vss9asI2LxJam_Ro3YWBHBQFr4t0,7353
|
11
|
+
pychemstation/control/controllers/method.py,sha256=SoKwteVfalgP1z7aKPNlaUJ01Gsr0MIoa7f-c2sjDrE,12259
|
12
|
+
pychemstation/control/controllers/sequence.py,sha256=bHx15uSA0ZjAy6xpyxwhWUNP54WcEL0nJ24bzYCa4rc,10719
|
13
|
+
pychemstation/control/controllers/table_controller.py,sha256=N47eiowmmy9gi18fChNh-cW6z8bbRSF30pLzhnWG9_k,8227
|
14
|
+
pychemstation/control/table/__init__.py,sha256=RgMN4uIWHdNUHpGRBWdzmzAbk7XEKl6Y-qtqWCxzSZU,124
|
15
|
+
pychemstation/control/table/method.py,sha256=THVoGomSXff_CTU3eAYme0BYwkPzab5UgZKsiZ29QSk,12196
|
16
|
+
pychemstation/control/table/sequence.py,sha256=Eri52AnbE3BGthfrRSvYKYciquUzvHKo0lYUTySYYE8,10542
|
17
|
+
pychemstation/control/table/table_controller.py,sha256=F5lv1DlPkEDcFmtwVT-E9Kq075jnWIN-iZIM3_mTt5E,8115
|
18
|
+
pychemstation/generated/__init__.py,sha256=GAoZFAYbPVEJDkcOw3e1rgOqd7TCW0HyKNPM8OMehMg,1005
|
19
|
+
pychemstation/generated/dad_method.py,sha256=0W8Z5WDtF5jpIcudMqb7XrkTnR2EGg_QOCsHRFQ0rmM,8402
|
20
|
+
pychemstation/generated/pump_method.py,sha256=sUhE2Oo00nzVcoONtq3EMWsN4wLSryXbG8f3EeViWKg,12174
|
21
|
+
pychemstation/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
|
+
pychemstation/utils/chromatogram.py,sha256=KzhEQbxKbwOu4OjKa4XJFq2y08JUwMRoaupHrDR8cLM,3094
|
23
|
+
pychemstation/utils/macro.py,sha256=BAIcE_dppNffwrSqGq8gh0ccE9YAJfQFQZHXJgA1WtA,2586
|
24
|
+
pychemstation/utils/method_types.py,sha256=YngbyHg96JSFnvhm5Zd7wJvLTQPPQsLbvbyz3HlGLYY,862
|
25
|
+
pychemstation/utils/parsing.py,sha256=bnFIsZZwFy9NKzVUf517yN-ogzQbm0hp_aho3KUD6Is,9317
|
26
|
+
pychemstation/utils/sequence_types.py,sha256=3VqiUHsfFEdynAxfR-z8JIWBCo7PdnGwTvsk7sm7Ij8,1055
|
27
|
+
pychemstation/utils/table_types.py,sha256=cN51Ry2pammDdk85cabVH3qkchjKKIzZfAH87Poty80,2350
|
28
|
+
pychemstation/utils/tray_types.py,sha256=UUDED-IAf-8FmPVZezuWSiIQE_HgiZQMV2sTqu4oZw8,177
|
29
|
+
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
30
|
+
tests/constants.py,sha256=lLwT_QaVriivL5llkul6RxXxPriwUp1E-Y3G9fejvbo,2092
|
31
|
+
tests/test_comb.py,sha256=faF4764oJEZ2vhG9-zLmQxjATseipRKXrStehuDCXOI,5638
|
32
|
+
tests/test_comm.py,sha256=1ZZd0UrIBOKe91wzA-XI-gSRgXmId9mLWYSMeche82Y,2973
|
33
|
+
tests/test_method.py,sha256=uCPpZVYKPz1CNWwhmBo_8TH0ku2V0ZpDZJj3f8iINB4,2440
|
34
|
+
tests/test_sequence.py,sha256=yIQGhUTehtHz6D1ai5W6AlP0zes2icF0VdQ0IGJ2CbQ,4901
|
35
|
+
pychemstation-0.5.5.dist-info/LICENSE,sha256=9bdF75gIf1MecZ7oymqWgJREVz7McXPG-mjqrTmzzD8,18658
|
36
|
+
pychemstation-0.5.5.dist-info/METADATA,sha256=sAsryhHjIHyT6y10BQP2rEUh49dLJ_2wCchNgQ1M4JY,4307
|
37
|
+
pychemstation-0.5.5.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
38
|
+
pychemstation-0.5.5.dist-info/top_level.txt,sha256=zXfKu_4nYWwPHo3OsuhshMNC3SPkcoTGCyODjURaghY,20
|
39
|
+
pychemstation-0.5.5.dist-info/RECORD,,
|
tests/constants.py
CHANGED
@@ -4,7 +4,7 @@ from pychemstation.utils.method_types import *
|
|
4
4
|
from pychemstation.utils.sequence_types import *
|
5
5
|
|
6
6
|
DEFAULT_METHOD = "GENERAL-POROSHELL-OPT"
|
7
|
-
DEFAULT_SEQUENCE = "
|
7
|
+
DEFAULT_SEQUENCE = "LLETest"
|
8
8
|
|
9
9
|
# CONSTANTS: paths only work in Hein group HPLC machine in room 242
|
10
10
|
DEFAULT_COMMAND_PATH = "C:\\Users\\User\\Desktop\\Lucy\\"
|
@@ -20,8 +20,8 @@ HEIN_LAB_CONSTANTS = [DEFAULT_COMMAND_PATH,
|
|
20
20
|
# these CONSTANTS work in rm 254
|
21
21
|
DEFAULT_COMMAND_PATH_254 = "D:\\\git_repositories\\\hplc_comm\\"
|
22
22
|
DEFAULT_METHOD_DIR_254 = "D:\\Chemstation\\1\\Methods\\"
|
23
|
-
DATA_DIR_254 = "D:\\Chemstation\\1\\Data"
|
24
|
-
SEQUENCE_DIR_254 = "C:\\1\\Sequence"
|
23
|
+
DATA_DIR_254 = "D:\\Chemstation\\1\\Data\\2024-12\\"
|
24
|
+
SEQUENCE_DIR_254 = "C:\\1\\Sequence\\"
|
25
25
|
|
26
26
|
HEIN_LAB_CONSTANTS_254 = [DEFAULT_COMMAND_PATH_254,
|
27
27
|
DEFAULT_METHOD_DIR_254,
|
@@ -42,7 +42,7 @@ def gen_rand_method():
|
|
42
42
|
return MethodTimetable(
|
43
43
|
first_row=HPLCMethodParams(
|
44
44
|
organic_modifier=org_modifier,
|
45
|
-
flow=random.random(),
|
45
|
+
flow=round(random.random(), 2),
|
46
46
|
maximum_run_time=max_run_time),
|
47
47
|
subsequent_rows=[
|
48
48
|
TimeTableEntry(
|
tests/test_comb.py
CHANGED
@@ -5,9 +5,7 @@ import unittest
|
|
5
5
|
from pychemstation.control import HPLCController
|
6
6
|
from tests.constants import *
|
7
7
|
|
8
|
-
run_too =
|
9
|
-
|
10
|
-
|
8
|
+
run_too = True
|
11
9
|
|
12
10
|
|
13
11
|
class TestCombinations(unittest.TestCase):
|
@@ -24,11 +22,23 @@ class TestCombinations(unittest.TestCase):
|
|
24
22
|
sequence_dir=path_constants[3])
|
25
23
|
|
26
24
|
def test_run_method_after_update(self):
|
27
|
-
self.hplc_controller.method_controller.switch(DEFAULT_METHOD)
|
28
|
-
|
29
25
|
try:
|
30
|
-
|
31
|
-
|
26
|
+
self.hplc_controller.method_controller.switch(DEFAULT_METHOD)
|
27
|
+
rand_method = MethodTimetable(
|
28
|
+
first_row=HPLCMethodParams(
|
29
|
+
organic_modifier=5,
|
30
|
+
flow=0.65,
|
31
|
+
maximum_run_time=2),
|
32
|
+
subsequent_rows=[
|
33
|
+
TimeTableEntry(
|
34
|
+
start_time=0.10,
|
35
|
+
organic_modifer=5,
|
36
|
+
flow=0.34),
|
37
|
+
TimeTableEntry(
|
38
|
+
start_time=1,
|
39
|
+
organic_modifer=98,
|
40
|
+
flow=0.55)])
|
41
|
+
self.hplc_controller.edit_method(rand_method, save=True)
|
32
42
|
if run_too:
|
33
43
|
self.hplc_controller.run_method(experiment_name="changed_method")
|
34
44
|
except Exception as e:
|
@@ -38,13 +48,24 @@ class TestCombinations(unittest.TestCase):
|
|
38
48
|
try:
|
39
49
|
self.hplc_controller.switch_sequence(sequence_name=DEFAULT_SEQUENCE)
|
40
50
|
seq_table = self.hplc_controller.load_sequence()
|
41
|
-
seq_table.rows
|
42
|
-
|
43
|
-
|
44
|
-
|
51
|
+
seq_table.rows.append(SequenceEntry(
|
52
|
+
vial_location=TenColumn.ONE,
|
53
|
+
method=DEFAULT_METHOD,
|
54
|
+
num_inj=3,
|
55
|
+
inj_vol=4,
|
56
|
+
sample_name="Sampel1",
|
57
|
+
sample_type=SampleType.SAMPLE,
|
58
|
+
))
|
59
|
+
seq_table.rows[0] = SequenceEntry(
|
60
|
+
vial_location=TenColumn.ONE,
|
61
|
+
method=DEFAULT_METHOD,
|
62
|
+
num_inj=3,
|
63
|
+
inj_vol=4,
|
64
|
+
sample_name="Sampel2",
|
65
|
+
sample_type=SampleType.SAMPLE)
|
45
66
|
self.hplc_controller.edit_sequence(seq_table)
|
46
67
|
if run_too:
|
47
|
-
self.hplc_controller.run_sequence(
|
68
|
+
self.hplc_controller.run_sequence()
|
48
69
|
chrom = self.hplc_controller.get_last_run_sequence_data()
|
49
70
|
self.assertTrue(len(chrom) == 2)
|
50
71
|
except Exception as e:
|
@@ -56,7 +77,7 @@ class TestCombinations(unittest.TestCase):
|
|
56
77
|
seq_table = self.hplc_controller.load_sequence()
|
57
78
|
self.hplc_controller.edit_sequence_row(seq_entry, 1)
|
58
79
|
if run_too:
|
59
|
-
self.hplc_controller.run_sequence(
|
80
|
+
self.hplc_controller.run_sequence()
|
60
81
|
chrom = self.hplc_controller.get_last_run_sequence_data()
|
61
82
|
self.assertTrue(len(chrom) == 2)
|
62
83
|
except Exception:
|
@@ -65,65 +86,58 @@ class TestCombinations(unittest.TestCase):
|
|
65
86
|
def test_update_method_update_seq_table_run(self):
|
66
87
|
try:
|
67
88
|
self.hplc_controller.method_controller.switch(DEFAULT_METHOD)
|
68
|
-
rand_method =
|
89
|
+
rand_method = MethodTimetable(
|
90
|
+
first_row=HPLCMethodParams(
|
91
|
+
organic_modifier=5,
|
92
|
+
flow=0.65,
|
93
|
+
maximum_run_time=2),
|
94
|
+
subsequent_rows=[
|
95
|
+
TimeTableEntry(
|
96
|
+
start_time=0.50,
|
97
|
+
organic_modifer=99,
|
98
|
+
flow=0.34)])
|
69
99
|
self.hplc_controller.edit_method(rand_method, save=True)
|
70
100
|
|
71
101
|
self.hplc_controller.switch_sequence(sequence_name=DEFAULT_SEQUENCE)
|
72
|
-
seq_table =
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
seq_table.rows[0].inj_source = InjectionSource.HIP_ALS
|
96
|
-
seq_table.rows[0].method = DEFAULT_METHOD
|
97
|
-
seq_table.rows[1].vial_location = TenColumn.TWO
|
98
|
-
seq_table.rows[1].inj_source = InjectionSource.HIP_ALS
|
99
|
-
seq_table.rows[1].method = DEFAULT_METHOD
|
102
|
+
seq_table = SequenceTable(
|
103
|
+
name=DEFAULT_SEQUENCE,
|
104
|
+
rows=[
|
105
|
+
SequenceEntry(
|
106
|
+
vial_location=8320,
|
107
|
+
sample_name="WM-01-001_Cr-Org",
|
108
|
+
method=DEFAULT_METHOD,
|
109
|
+
inj_source=InjectionSource.HIP_ALS,
|
110
|
+
inj_vol=2,
|
111
|
+
num_inj=1,
|
112
|
+
sample_type=SampleType.SAMPLE
|
113
|
+
),
|
114
|
+
SequenceEntry(
|
115
|
+
vial_location=8448,
|
116
|
+
sample_name="WM-01-001_Cr-Aq",
|
117
|
+
method=DEFAULT_METHOD,
|
118
|
+
inj_source=InjectionSource.HIP_ALS,
|
119
|
+
inj_vol=2,
|
120
|
+
num_inj=1,
|
121
|
+
sample_type=SampleType.SAMPLE
|
122
|
+
),
|
123
|
+
]
|
124
|
+
)
|
100
125
|
|
101
126
|
self.hplc_controller.edit_sequence(seq_table)
|
102
|
-
self.hplc_controller.edit_sequence_row(
|
103
|
-
SequenceEntry(
|
104
|
-
vial_location=TenColumn.ONE,
|
105
|
-
method=DEFAULT_METHOD,
|
106
|
-
num_inj=3,
|
107
|
-
inj_vol=4,
|
108
|
-
sample_name="Blank",
|
109
|
-
sample_type=SampleType.BLANK,
|
110
|
-
)
|
111
|
-
)
|
112
127
|
if run_too:
|
113
|
-
self.hplc_controller.
|
128
|
+
self.hplc_controller.preprun()
|
129
|
+
self.hplc_controller.run_sequence()
|
114
130
|
chrom = self.hplc_controller.get_last_run_sequence_data()
|
115
131
|
self.assertTrue(len(chrom) == 2)
|
116
132
|
except Exception:
|
117
133
|
self.fail("Failed")
|
118
134
|
|
119
|
-
def
|
135
|
+
def test_run_sequence(self):
|
120
136
|
try:
|
121
137
|
self.hplc_controller.switch_sequence(sequence_name=DEFAULT_SEQUENCE)
|
122
|
-
|
123
|
-
self.hplc_controller.
|
124
|
-
|
125
|
-
|
126
|
-
chrom = self.hplc_controller.get_last_run_sequence_data()
|
127
|
-
self.assertTrue(len(chrom) == 2)
|
138
|
+
self.hplc_controller.preprun()
|
139
|
+
self.hplc_controller.run_sequence()
|
140
|
+
chrom = self.hplc_controller.get_last_run_sequence_data()
|
141
|
+
self.assertTrue(len(chrom) == 2)
|
128
142
|
except Exception:
|
129
143
|
self.fail("Failed")
|
tests/test_sequence.py
CHANGED
@@ -63,6 +63,54 @@ class TestSequence(unittest.TestCase):
|
|
63
63
|
sample_name="Sampel2",
|
64
64
|
sample_type=SampleType.SAMPLE,
|
65
65
|
inj_source=InjectionSource.HIP_ALS
|
66
|
+
),
|
67
|
+
SequenceEntry(
|
68
|
+
vial_location=TenColumn.TEN,
|
69
|
+
method=DEFAULT_METHOD,
|
70
|
+
num_inj=3,
|
71
|
+
inj_vol=4,
|
72
|
+
sample_name="Sampel2",
|
73
|
+
sample_type=SampleType.SAMPLE,
|
74
|
+
inj_source=InjectionSource.HIP_ALS
|
75
|
+
),
|
76
|
+
SequenceEntry(
|
77
|
+
vial_location=TenColumn.THREE,
|
78
|
+
method=DEFAULT_METHOD,
|
79
|
+
num_inj=3,
|
80
|
+
inj_vol=4,
|
81
|
+
sample_name="Sampel2",
|
82
|
+
sample_type=SampleType.SAMPLE,
|
83
|
+
inj_source=InjectionSource.HIP_ALS
|
84
|
+
)
|
85
|
+
]
|
86
|
+
)
|
87
|
+
self.hplc_controller.edit_sequence(seq_table)
|
88
|
+
except Exception:
|
89
|
+
self.fail("Should have not occured")
|
90
|
+
|
91
|
+
def test_edit_entire_table_less_rows(self):
|
92
|
+
self.hplc_controller.switch_sequence(sequence_name=DEFAULT_SEQUENCE)
|
93
|
+
try:
|
94
|
+
seq_table = SequenceTable(
|
95
|
+
name=DEFAULT_SEQUENCE,
|
96
|
+
rows=[
|
97
|
+
SequenceEntry(
|
98
|
+
vial_location=TenColumn.TEN,
|
99
|
+
method=DEFAULT_METHOD,
|
100
|
+
num_inj=3,
|
101
|
+
inj_vol=4,
|
102
|
+
sample_name="Sampel2",
|
103
|
+
sample_type=SampleType.SAMPLE,
|
104
|
+
inj_source=InjectionSource.HIP_ALS
|
105
|
+
),
|
106
|
+
SequenceEntry(
|
107
|
+
vial_location=TenColumn.THREE,
|
108
|
+
method=DEFAULT_METHOD,
|
109
|
+
num_inj=3,
|
110
|
+
inj_vol=4,
|
111
|
+
sample_name="Sampel2",
|
112
|
+
sample_type=SampleType.SAMPLE,
|
113
|
+
inj_source=InjectionSource.HIP_ALS
|
66
114
|
)
|
67
115
|
]
|
68
116
|
)
|
@@ -1,34 +0,0 @@
|
|
1
|
-
pychemstation/__init__.py,sha256=SpTl-Tg1B1HTyjNOE-8ue-N2wGnXN_2zl7RFUSxlkiM,33
|
2
|
-
pychemstation/analysis/__init__.py,sha256=EWoU47iyn9xGS-b44zK9eq50bSjOV4AC5dvt420YMI4,44
|
3
|
-
pychemstation/analysis/base_spectrum.py,sha256=FBvwzLtF9mdqW7f8ETY9G4cpfJ-SzbiSkZq9EtXcSXo,17045
|
4
|
-
pychemstation/analysis/spec_utils.py,sha256=8NZMV0dtfxZLARjWzM5ks0tgEYQv_SKUiZzba2IoKgw,10505
|
5
|
-
pychemstation/analysis/utils.py,sha256=ISupAOb_yqA4_DZRK9v18UL-XjUQccAicIJKb1VMnGg,2055
|
6
|
-
pychemstation/control/__init__.py,sha256=aH9cPf-ljrVeVhN0K3cyEcAavmPXCjhhOnpLNf8qLqE,106
|
7
|
-
pychemstation/control/comm.py,sha256=19RaKugJ7TbBfW-OM8fHxf90cfXCiDnNnZWPAOiWpGQ,7266
|
8
|
-
pychemstation/control/hplc.py,sha256=r1N8kf5o1kAoY1taALvLJoIxNEbuOYsjwZ8eljrMZRM,6763
|
9
|
-
pychemstation/control/table/__init__.py,sha256=RgMN4uIWHdNUHpGRBWdzmzAbk7XEKl6Y-qtqWCxzSZU,124
|
10
|
-
pychemstation/control/table/method.py,sha256=THVoGomSXff_CTU3eAYme0BYwkPzab5UgZKsiZ29QSk,12196
|
11
|
-
pychemstation/control/table/sequence.py,sha256=iTpk1oiGByut7MSFDHKpTlKUCYzXENOB6EMSKaWJWVY,10651
|
12
|
-
pychemstation/control/table/table_controller.py,sha256=eq9P213Jslr1gJnjZEuvyQ4TpgrxdIXFXHwtQbJkrg0,7131
|
13
|
-
pychemstation/generated/__init__.py,sha256=GAoZFAYbPVEJDkcOw3e1rgOqd7TCW0HyKNPM8OMehMg,1005
|
14
|
-
pychemstation/generated/dad_method.py,sha256=0W8Z5WDtF5jpIcudMqb7XrkTnR2EGg_QOCsHRFQ0rmM,8402
|
15
|
-
pychemstation/generated/pump_method.py,sha256=sUhE2Oo00nzVcoONtq3EMWsN4wLSryXbG8f3EeViWKg,12174
|
16
|
-
pychemstation/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
17
|
-
pychemstation/utils/chromatogram.py,sha256=35nvEh6prVsWO6lMHYgGuidUOFHv954_7MNf0Az3Fz4,3759
|
18
|
-
pychemstation/utils/macro.py,sha256=BAIcE_dppNffwrSqGq8gh0ccE9YAJfQFQZHXJgA1WtA,2586
|
19
|
-
pychemstation/utils/method_types.py,sha256=YngbyHg96JSFnvhm5Zd7wJvLTQPPQsLbvbyz3HlGLYY,862
|
20
|
-
pychemstation/utils/parsing.py,sha256=bnFIsZZwFy9NKzVUf517yN-ogzQbm0hp_aho3KUD6Is,9317
|
21
|
-
pychemstation/utils/sequence_types.py,sha256=3VqiUHsfFEdynAxfR-z8JIWBCo7PdnGwTvsk7sm7Ij8,1055
|
22
|
-
pychemstation/utils/table_types.py,sha256=HAxAsqmyWsCqGwhg4LadGlX6ubacsd8tjXXz-6DL2nI,2287
|
23
|
-
pychemstation/utils/tray_types.py,sha256=UUDED-IAf-8FmPVZezuWSiIQE_HgiZQMV2sTqu4oZw8,177
|
24
|
-
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
25
|
-
tests/constants.py,sha256=CqahQtWK0NSGIpoCOY_uoN4BwR6TFtaX9wPAkPkG9BE,2074
|
26
|
-
tests/test_comb.py,sha256=IrCqsGEBdrAqoGBQuKiJiaGRW9Ym9UNlVjPA9gc2UrA,5431
|
27
|
-
tests/test_comm.py,sha256=1ZZd0UrIBOKe91wzA-XI-gSRgXmId9mLWYSMeche82Y,2973
|
28
|
-
tests/test_method.py,sha256=uCPpZVYKPz1CNWwhmBo_8TH0ku2V0ZpDZJj3f8iINB4,2440
|
29
|
-
tests/test_sequence.py,sha256=w_WQj97hlaZtcW1Zibzlrq0p179c-4-otM-ik_1EXME,2937
|
30
|
-
pychemstation-0.5.3.dev1.dist-info/LICENSE,sha256=9bdF75gIf1MecZ7oymqWgJREVz7McXPG-mjqrTmzzD8,18658
|
31
|
-
pychemstation-0.5.3.dev1.dist-info/METADATA,sha256=YIbggvShXX-YxNtMFlMXfJIIB0LanjwtYBLz7O5Ttdw,3964
|
32
|
-
pychemstation-0.5.3.dev1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
33
|
-
pychemstation-0.5.3.dev1.dist-info/top_level.txt,sha256=zXfKu_4nYWwPHo3OsuhshMNC3SPkcoTGCyODjURaghY,20
|
34
|
-
pychemstation-0.5.3.dev1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|