pychemstation 0.5.6.dev1__py3-none-any.whl → 0.5.7.dev1__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/controllers/comm.py +3 -2
- pychemstation/control/controllers/method.py +17 -2
- pychemstation/control/controllers/sequence.py +7 -5
- pychemstation/control/controllers/table_controller.py +4 -0
- pychemstation/control/hplc.py +3 -0
- pychemstation/utils/chromatogram.py +4 -0
- pychemstation/utils/method_types.py +2 -0
- pychemstation/utils/table_types.py +3 -0
- {pychemstation-0.5.6.dev1.dist-info → pychemstation-0.5.7.dev1.dist-info}/METADATA +1 -1
- {pychemstation-0.5.6.dev1.dist-info → pychemstation-0.5.7.dev1.dist-info}/RECORD +14 -14
- tests/test_comb.py +3 -1
- {pychemstation-0.5.6.dev1.dist-info → pychemstation-0.5.7.dev1.dist-info}/LICENSE +0 -0
- {pychemstation-0.5.6.dev1.dist-info → pychemstation-0.5.7.dev1.dist-info}/WHEEL +0 -0
- {pychemstation-0.5.6.dev1.dist-info → pychemstation-0.5.7.dev1.dist-info}/top_level.txt +0 -0
@@ -9,7 +9,7 @@ been processed.
|
|
9
9
|
|
10
10
|
Authors: Alexander Hammer, Hessam Mehr, Lucy Hao
|
11
11
|
"""
|
12
|
-
|
12
|
+
import logging
|
13
13
|
import os
|
14
14
|
import time
|
15
15
|
|
@@ -97,6 +97,7 @@ class CommunicationController:
|
|
97
97
|
time.sleep(30)
|
98
98
|
self.set_status()
|
99
99
|
hplc_actually_avail = isinstance(self._most_recent_hplc_status, HPLCAvailStatus)
|
100
|
+
logging.info("Still running")
|
100
101
|
return hplc_avail and hplc_actually_avail
|
101
102
|
|
102
103
|
def _send(self, cmd: str, cmd_no: int, num_attempts=5) -> None:
|
@@ -183,7 +184,7 @@ class CommunicationController:
|
|
183
184
|
num_response_prefix = "Numerical Responses:"
|
184
185
|
str_response_prefix = "String Responses:"
|
185
186
|
possible_response = self._receive(self.cmd_no)
|
186
|
-
if
|
187
|
+
if possible_response.is_ok():
|
187
188
|
lines = possible_response.value.splitlines()
|
188
189
|
for line in lines:
|
189
190
|
if str_response_prefix in line and num_response_prefix in line:
|
@@ -21,6 +21,14 @@ class MethodController(TableController):
|
|
21
21
|
def __init__(self, controller: CommunicationController, src: str, data_dir: str, table: Table):
|
22
22
|
super().__init__(controller, src, data_dir, table)
|
23
23
|
|
24
|
+
def check_loaded_method(self):
|
25
|
+
time.sleep(2)
|
26
|
+
self.send(Command.GET_METHOD_CMD)
|
27
|
+
time.sleep(2)
|
28
|
+
res = self.receive()
|
29
|
+
if res.is_ok():
|
30
|
+
return res.ok_value.string_response
|
31
|
+
|
24
32
|
def get_method_params(self) -> HPLCMethodParams:
|
25
33
|
return HPLCMethodParams(organic_modifier=self.controller.get_num_val(
|
26
34
|
cmd=TableOperation.GET_OBJ_HDR_VAL.value.format(
|
@@ -50,8 +58,12 @@ class MethodController(TableController):
|
|
50
58
|
def load(self) -> MethodTimetable:
|
51
59
|
rows = self.get_num_rows()
|
52
60
|
if rows.is_ok():
|
61
|
+
self.send(Command.GET_METHOD_CMD)
|
62
|
+
res = self.receive()
|
63
|
+
method_name = res.ok_value.string_response
|
53
64
|
timetable_rows = [self.get_row(r + 1) for r in range(int(rows.ok_value.num_response))]
|
54
65
|
self.table_state = MethodTimetable(
|
66
|
+
name=method_name,
|
55
67
|
first_row=self.get_method_params(),
|
56
68
|
subsequent_rows=timetable_rows)
|
57
69
|
return self.table_state
|
@@ -124,8 +136,7 @@ class MethodController(TableController):
|
|
124
136
|
first_row=HPLCMethodParams(
|
125
137
|
organic_modifier=organic_modifier.percentage,
|
126
138
|
flow=method.flow,
|
127
|
-
maximum_run_time=method.stop_time,
|
128
|
-
temperature=-1),
|
139
|
+
maximum_run_time=method.stop_time),
|
129
140
|
subsequent_rows=[
|
130
141
|
TimeTableEntry(
|
131
142
|
start_time=tte.time,
|
@@ -146,6 +157,7 @@ class MethodController(TableController):
|
|
146
157
|
|
147
158
|
:param updated_method: the method with updated values, to be sent to Chemstation to modify the currently loaded method.
|
148
159
|
"""
|
160
|
+
self.table_state = updated_method
|
149
161
|
initial_organic_modifier: Param = Param(val=updated_method.first_row.organic_modifier,
|
150
162
|
chemstation_key=RegisterFlag.SOLVENT_B_COMPOSITION,
|
151
163
|
ptype=PType.NUM)
|
@@ -255,6 +267,9 @@ class MethodController(TableController):
|
|
255
267
|
|
256
268
|
:param experiment_name: Name of the experiment
|
257
269
|
"""
|
270
|
+
if not self.table_state:
|
271
|
+
self.table_state = self.load()
|
272
|
+
|
258
273
|
timestamp = time.strftime(TIME_FORMAT)
|
259
274
|
self.send(Command.RUN_METHOD_CMD.value.format(data_dir=self.data_dir,
|
260
275
|
experiment_name=experiment_name,
|
@@ -73,7 +73,7 @@ class SequenceController(TableController):
|
|
73
73
|
|
74
74
|
:param sequence_table:
|
75
75
|
"""
|
76
|
-
|
76
|
+
self.table_state = sequence_table
|
77
77
|
rows = self.get_num_rows()
|
78
78
|
if rows.is_ok():
|
79
79
|
existing_row_num = rows.value.num_response
|
@@ -177,17 +177,19 @@ class SequenceController(TableController):
|
|
177
177
|
under the <data_dir>/<sequence table name> folder.
|
178
178
|
Device must be ready.
|
179
179
|
"""
|
180
|
+
if not self.table_state:
|
181
|
+
self.table_state = self.load()
|
182
|
+
|
180
183
|
timestamp = time.strftime(SEQUENCE_TIME_FORMAT)
|
181
|
-
seq_table = self.load()
|
182
184
|
self.send(Command.RUN_SEQUENCE_CMD.value)
|
183
185
|
|
184
186
|
if self.check_hplc_is_running():
|
185
|
-
folder_name = f"{
|
187
|
+
folder_name = f"{self.table_state.name} {timestamp}"
|
186
188
|
self.data_files.append(SequenceDataFiles(dir=folder_name,
|
187
|
-
sequence_name=
|
189
|
+
sequence_name=self.table_state.name))
|
188
190
|
|
189
191
|
if stall_while_running:
|
190
|
-
run_completed = self.check_hplc_done_running(sequence=
|
192
|
+
run_completed = self.check_hplc_done_running(sequence=self.table_state)
|
191
193
|
if run_completed.is_ok():
|
192
194
|
self.data_files[-1].dir = run_completed.value
|
193
195
|
else:
|
@@ -41,6 +41,10 @@ class TableController(abc.ABC):
|
|
41
41
|
"B": AgilentHPLCChromatogram(self.data_dir),
|
42
42
|
"C": AgilentHPLCChromatogram(self.data_dir),
|
43
43
|
"D": AgilentHPLCChromatogram(self.data_dir),
|
44
|
+
"E": AgilentHPLCChromatogram(self.data_dir),
|
45
|
+
"F": AgilentHPLCChromatogram(self.data_dir),
|
46
|
+
"G": AgilentHPLCChromatogram(self.data_dir),
|
47
|
+
"H": AgilentHPLCChromatogram(self.data_dir),
|
44
48
|
}
|
45
49
|
|
46
50
|
self.data_files: Union[list[SequenceDataFiles], list[str]] = []
|
pychemstation/control/hplc.py
CHANGED
@@ -138,6 +138,9 @@ class HPLCController:
|
|
138
138
|
"""
|
139
139
|
return self.sequence_controller.get_data()
|
140
140
|
|
141
|
+
def check_loaded_method(self) -> str:
|
142
|
+
return self.method_controller.check_loaded_method()
|
143
|
+
|
141
144
|
def load_method(self) -> MethodTimetable:
|
142
145
|
"""
|
143
146
|
Returns the currently loaded method, including its timetable.
|
@@ -6,6 +6,7 @@ from .table_types import RegisterFlag
|
|
6
6
|
from ..generated import Signal, SolventElement
|
7
7
|
|
8
8
|
|
9
|
+
|
9
10
|
class PType(Enum):
|
10
11
|
STR = "str"
|
11
12
|
NUM = "num"
|
@@ -34,6 +35,7 @@ class TimeTableEntry:
|
|
34
35
|
|
35
36
|
@dataclass
|
36
37
|
class MethodTimetable:
|
38
|
+
name: str
|
37
39
|
first_row: HPLCMethodParams
|
38
40
|
subsequent_rows: list[TimeTableEntry]
|
39
41
|
dad_wavelengthes: Optional[list[Signal]] = None
|
@@ -5,12 +5,12 @@ pychemstation/analysis/spec_utils.py,sha256=8NZMV0dtfxZLARjWzM5ks0tgEYQv_SKUiZzb
|
|
5
5
|
pychemstation/analysis/utils.py,sha256=ISupAOb_yqA4_DZRK9v18UL-XjUQccAicIJKb1VMnGg,2055
|
6
6
|
pychemstation/control/__init__.py,sha256=4xTy8X-mkn_PPZKr7w9rnj1wZhtmTesbQptPhpYmKXs,64
|
7
7
|
pychemstation/control/comm.py,sha256=u44g1hTluQ0yUG93Un-QAshScoDpgYRrZfFTgweP5tY,7386
|
8
|
-
pychemstation/control/hplc.py,sha256=
|
8
|
+
pychemstation/control/hplc.py,sha256=s600b9Oq_muO3uNilMpvSfP4XQIl5A07QzppmdOMPmc,6835
|
9
9
|
pychemstation/control/controllers/__init__.py,sha256=di3ytLIK-35XC_THw4IjNaOtCUTe7GuEOFb-obmREw4,166
|
10
|
-
pychemstation/control/controllers/comm.py,sha256
|
11
|
-
pychemstation/control/controllers/method.py,sha256=
|
12
|
-
pychemstation/control/controllers/sequence.py,sha256=
|
13
|
-
pychemstation/control/controllers/table_controller.py,sha256=
|
10
|
+
pychemstation/control/controllers/comm.py,sha256=-fJqPcis30fbWS07Tiv68lRFk7ALKC8OitcEBQ_xDTE,7409
|
11
|
+
pychemstation/control/controllers/method.py,sha256=dzP8mvgVOOpeAPMp4PLNYxqvaBrGkAe3lPfHWZaD2uk,13290
|
12
|
+
pychemstation/control/controllers/sequence.py,sha256=Oi74EhVSgbDVQBxPvITvK5Eo52Ugtz_xCHFYCIq_4Oo,11070
|
13
|
+
pychemstation/control/controllers/table_controller.py,sha256=U7oa_mwIKsySASMVWx-heD6C6tVkf5Yb26ksu9x5lQQ,8876
|
14
14
|
pychemstation/control/table/__init__.py,sha256=RgMN4uIWHdNUHpGRBWdzmzAbk7XEKl6Y-qtqWCxzSZU,124
|
15
15
|
pychemstation/control/table/method.py,sha256=THVoGomSXff_CTU3eAYme0BYwkPzab5UgZKsiZ29QSk,12196
|
16
16
|
pychemstation/control/table/sequence.py,sha256=Eri52AnbE3BGthfrRSvYKYciquUzvHKo0lYUTySYYE8,10542
|
@@ -19,21 +19,21 @@ pychemstation/generated/__init__.py,sha256=GAoZFAYbPVEJDkcOw3e1rgOqd7TCW0HyKNPM8
|
|
19
19
|
pychemstation/generated/dad_method.py,sha256=0W8Z5WDtF5jpIcudMqb7XrkTnR2EGg_QOCsHRFQ0rmM,8402
|
20
20
|
pychemstation/generated/pump_method.py,sha256=sUhE2Oo00nzVcoONtq3EMWsN4wLSryXbG8f3EeViWKg,12174
|
21
21
|
pychemstation/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
22
|
-
pychemstation/utils/chromatogram.py,sha256
|
22
|
+
pychemstation/utils/chromatogram.py,sha256=-q3_hL9GTyi4C95os7IwAiOrkTM4EXIiigm-nW9pFmM,3221
|
23
23
|
pychemstation/utils/macro.py,sha256=BAIcE_dppNffwrSqGq8gh0ccE9YAJfQFQZHXJgA1WtA,2586
|
24
|
-
pychemstation/utils/method_types.py,sha256=
|
24
|
+
pychemstation/utils/method_types.py,sha256=Hyd_Kxf-ygKW7LlOtEhGG-uujwFPE1w-orqyxcDz17E,877
|
25
25
|
pychemstation/utils/parsing.py,sha256=bnFIsZZwFy9NKzVUf517yN-ogzQbm0hp_aho3KUD6Is,9317
|
26
26
|
pychemstation/utils/sequence_types.py,sha256=3VqiUHsfFEdynAxfR-z8JIWBCo7PdnGwTvsk7sm7Ij8,1055
|
27
|
-
pychemstation/utils/table_types.py,sha256=
|
27
|
+
pychemstation/utils/table_types.py,sha256=H67-7I96X8Zkm2HygHYttYwG_XuNDmV2AKZW10yZbiA,2418
|
28
28
|
pychemstation/utils/tray_types.py,sha256=UUDED-IAf-8FmPVZezuWSiIQE_HgiZQMV2sTqu4oZw8,177
|
29
29
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
30
30
|
tests/constants.py,sha256=lLwT_QaVriivL5llkul6RxXxPriwUp1E-Y3G9fejvbo,2092
|
31
|
-
tests/test_comb.py,sha256=
|
31
|
+
tests/test_comb.py,sha256=pfPpw2wKuF7_v39SOmT4tbbarqBa7NfcRTUVdLLsvWw,5769
|
32
32
|
tests/test_comm.py,sha256=1ZZd0UrIBOKe91wzA-XI-gSRgXmId9mLWYSMeche82Y,2973
|
33
33
|
tests/test_method.py,sha256=uCPpZVYKPz1CNWwhmBo_8TH0ku2V0ZpDZJj3f8iINB4,2440
|
34
34
|
tests/test_sequence.py,sha256=yIQGhUTehtHz6D1ai5W6AlP0zes2icF0VdQ0IGJ2CbQ,4901
|
35
|
-
pychemstation-0.5.
|
36
|
-
pychemstation-0.5.
|
37
|
-
pychemstation-0.5.
|
38
|
-
pychemstation-0.5.
|
39
|
-
pychemstation-0.5.
|
35
|
+
pychemstation-0.5.7.dev1.dist-info/LICENSE,sha256=9bdF75gIf1MecZ7oymqWgJREVz7McXPG-mjqrTmzzD8,18658
|
36
|
+
pychemstation-0.5.7.dev1.dist-info/METADATA,sha256=-JJQIwuYuatng6sohJy6y7-7WV8UBUOSJgMqkoi8OZ8,4312
|
37
|
+
pychemstation-0.5.7.dev1.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
38
|
+
pychemstation-0.5.7.dev1.dist-info/top_level.txt,sha256=zXfKu_4nYWwPHo3OsuhshMNC3SPkcoTGCyODjURaghY,20
|
39
|
+
pychemstation-0.5.7.dev1.dist-info/RECORD,,
|
tests/test_comb.py
CHANGED
@@ -41,6 +41,8 @@ class TestCombinations(unittest.TestCase):
|
|
41
41
|
self.hplc_controller.edit_method(rand_method, save=True)
|
42
42
|
if run_too:
|
43
43
|
self.hplc_controller.run_method(experiment_name="changed_method")
|
44
|
+
chrom = self.hplc_controller.get_last_run_method_data()
|
45
|
+
self.assertEqual(len(chrom.__dict__), 8)
|
44
46
|
except Exception as e:
|
45
47
|
self.fail(f"Should have not failed: {e}")
|
46
48
|
|
@@ -138,6 +140,6 @@ class TestCombinations(unittest.TestCase):
|
|
138
140
|
self.hplc_controller.preprun()
|
139
141
|
self.hplc_controller.run_sequence()
|
140
142
|
chrom = self.hplc_controller.get_last_run_sequence_data()
|
141
|
-
self.assertTrue(len(chrom) ==
|
143
|
+
self.assertTrue(len(chrom) == 1)
|
142
144
|
except Exception:
|
143
145
|
self.fail("Failed")
|
File without changes
|
File without changes
|
File without changes
|