pychemstation 0.5.7.dev1__tar.gz → 0.5.9__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.
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/PKG-INFO +1 -1
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/control/controllers/comm.py +4 -3
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/control/controllers/method.py +18 -2
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/control/controllers/sequence.py +10 -1
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/control/controllers/table_controller.py +7 -3
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/control/hplc.py +65 -14
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/utils/macro.py +3 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation.egg-info/PKG-INFO +1 -1
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/setup.py +1 -1
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/tests/constants.py +1 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/tests/test_comb.py +7 -9
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/LICENSE +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/README.md +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/__init__.py +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/analysis/__init__.py +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/analysis/base_spectrum.py +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/analysis/spec_utils.py +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/analysis/utils.py +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/control/__init__.py +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/control/controllers/__init__.py +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/generated/__init__.py +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/generated/dad_method.py +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/generated/pump_method.py +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/utils/__init__.py +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/utils/chromatogram.py +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/utils/method_types.py +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/utils/parsing.py +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/utils/sequence_types.py +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/utils/table_types.py +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/utils/tray_types.py +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation.egg-info/SOURCES.txt +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation.egg-info/dependency_links.txt +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation.egg-info/requires.txt +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation.egg-info/top_level.txt +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pyproject.toml +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/setup.cfg +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/tests/__init__.py +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/tests/test_comm.py +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/tests/test_method.py +0 -0
- {pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/tests/test_sequence.py +0 -0
@@ -12,6 +12,7 @@ Authors: Alexander Hammer, Hessam Mehr, Lucy Hao
|
|
12
12
|
import logging
|
13
13
|
import os
|
14
14
|
import time
|
15
|
+
from typing import Optional
|
15
16
|
|
16
17
|
from result import Result, Ok, Err
|
17
18
|
|
@@ -43,7 +44,7 @@ class CommunicationController:
|
|
43
44
|
self.cmd_no = 0
|
44
45
|
else:
|
45
46
|
raise FileNotFoundError(f"comm_dir: {comm_dir} not found.")
|
46
|
-
self._most_recent_hplc_status = None
|
47
|
+
self._most_recent_hplc_status: Optional[Status] = None
|
47
48
|
|
48
49
|
# Create files for Chemstation to communicate with Python
|
49
50
|
open(self.cmd_file, "a").close()
|
@@ -67,7 +68,7 @@ class CommunicationController:
|
|
67
68
|
else:
|
68
69
|
raise RuntimeError("Failed to get string")
|
69
70
|
|
70
|
-
def get_status(self) ->
|
71
|
+
def get_status(self) -> Status:
|
71
72
|
"""Get device status(es).
|
72
73
|
|
73
74
|
:return: list of ChemStation's current status
|
@@ -130,7 +131,7 @@ class CommunicationController:
|
|
130
131
|
:raises IOError: Could not read reply file.
|
131
132
|
:return: Potential ChemStation response
|
132
133
|
"""
|
133
|
-
err = None
|
134
|
+
err: Optional[Union[OSError, IndexError]] = None
|
134
135
|
for _ in range(num_attempts):
|
135
136
|
time.sleep(1)
|
136
137
|
|
{pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/control/controllers/method.py
RENAMED
@@ -21,13 +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
|
24
|
+
def check(self) -> str:
|
25
25
|
time.sleep(2)
|
26
26
|
self.send(Command.GET_METHOD_CMD)
|
27
27
|
time.sleep(2)
|
28
28
|
res = self.receive()
|
29
29
|
if res.is_ok():
|
30
30
|
return res.ok_value.string_response
|
31
|
+
return "ERROR"
|
31
32
|
|
32
33
|
def get_method_params(self) -> HPLCMethodParams:
|
33
34
|
return HPLCMethodParams(organic_modifier=self.controller.get_num_val(
|
@@ -136,7 +137,7 @@ class MethodController(TableController):
|
|
136
137
|
first_row=HPLCMethodParams(
|
137
138
|
organic_modifier=organic_modifier.percentage,
|
138
139
|
flow=method.flow,
|
139
|
-
maximum_run_time=method.stop_time),
|
140
|
+
maximum_run_time=method.stop_time.stop_time_value),
|
140
141
|
subsequent_rows=[
|
141
142
|
TimeTableEntry(
|
142
143
|
start_time=tte.time,
|
@@ -213,6 +214,11 @@ class MethodController(TableController):
|
|
213
214
|
self.sleepy_send(
|
214
215
|
f'NewColVal RCPMP1Method[1], "Timetable", "SolventCompositionPumpChannel2_Percentage", {row.organic_modifer}')
|
215
216
|
|
217
|
+
self.sleepy_send('InsTabRow RCPMP1Method[1], "Timetable"')
|
218
|
+
self.sleepy_send('SetTabText RCPMP1Method[1], "Timetable", 2, "Function", "Flow"')
|
219
|
+
self.sleepy_send(f'NewColVal RCPMP1Method[1], "Timetable", "FlowFlow", {row.flow}')
|
220
|
+
self.sleepy_send(f'SetTabVal RCPMP1Method[1], "Timetable", 2, "FlowFlow", {row.flow})')
|
221
|
+
|
216
222
|
self.send('Sleep 1')
|
217
223
|
self.sleepy_send("DownloadRCMethod PMP1")
|
218
224
|
self.send('Sleep 1')
|
@@ -230,8 +236,18 @@ class MethodController(TableController):
|
|
230
236
|
self.send("Sleep 1")
|
231
237
|
self.sleepy_send("DownloadRCMethod PMP1")
|
232
238
|
self.send("Sleep 1")
|
239
|
+
|
240
|
+
self.sleepy_send('InsTabRow RCPMP1Method[1], "Timetable"')
|
233
241
|
self.get_num_rows()
|
234
242
|
|
243
|
+
self.sleepy_send('SetTabText RCPMP1Method[1], "Timetable", Rows , "Function", "Flow"')
|
244
|
+
self.sleepy_send(f'SetTabVal RCPMP1Method[1], "Timetable", Rows , "FlowFlow", {row.flow}')
|
245
|
+
self.sleepy_send(f'SetTabVal RCPMP1Method[1], "Timetable", Rows , "Time", {row.start_time}')
|
246
|
+
|
247
|
+
self.send("Sleep 1")
|
248
|
+
self.sleepy_send("DownloadRCMethod PMP1")
|
249
|
+
self.send("Sleep 1")
|
250
|
+
|
235
251
|
def _update_param(self, method_param: Param):
|
236
252
|
"""Change a method parameter, changes what is visibly seen in Chemstation GUI.
|
237
253
|
(changes the first row in the timetable)
|
{pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/control/controllers/sequence.py
RENAMED
@@ -49,6 +49,15 @@ class SequenceController(TableController):
|
|
49
49
|
inj_source=inj_source,
|
50
50
|
sample_type=sample_type, )
|
51
51
|
|
52
|
+
def check(self) -> str:
|
53
|
+
time.sleep(2)
|
54
|
+
self.send(Command.GET_SEQUENCE_CMD)
|
55
|
+
time.sleep(2)
|
56
|
+
res = self.receive()
|
57
|
+
if res.is_ok():
|
58
|
+
return res.ok_value.string_response
|
59
|
+
return "ERROR"
|
60
|
+
|
52
61
|
def switch(self, seq_name: str):
|
53
62
|
"""
|
54
63
|
Switch to the specified sequence. The sequence name does not need the '.S' extension.
|
@@ -197,7 +206,7 @@ class SequenceController(TableController):
|
|
197
206
|
else:
|
198
207
|
self.data_files[-1].dir = self.fuzzy_match_most_recent_folder(folder_name).ok_value
|
199
208
|
|
200
|
-
def retrieve_recent_data_files(self):
|
209
|
+
def retrieve_recent_data_files(self) -> str:
|
201
210
|
sequence_data_files: SequenceDataFiles = self.data_files[-1]
|
202
211
|
return sequence_data_files.dir
|
203
212
|
|
@@ -19,12 +19,14 @@ from ...utils.sequence_types import SequenceDataFiles, SequenceTable
|
|
19
19
|
from ...utils.table_types import Table, TableOperation, RegisterFlag
|
20
20
|
|
21
21
|
|
22
|
+
TableType = Union[MethodTimetable, SequenceTable]
|
23
|
+
|
22
24
|
class TableController(abc.ABC):
|
23
25
|
|
24
26
|
def __init__(self, controller: CommunicationController, src: str, data_dir: str, table: Table):
|
25
27
|
self.controller = controller
|
26
28
|
self.table = table
|
27
|
-
self.table_state : Optional[
|
29
|
+
self.table_state : Optional[TableType] = None
|
28
30
|
|
29
31
|
if os.path.isdir(src):
|
30
32
|
self.src: str = src
|
@@ -154,6 +156,7 @@ class TableController(abc.ABC):
|
|
154
156
|
Checks if ChemStation has finished running and can read data back
|
155
157
|
|
156
158
|
: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
|
159
|
+
:param sequence: if you are running a sequence and want to read back data, the timeout period will be adjusted to be longer than the sequence's runtime
|
157
160
|
:return: Return True if data can be read back, else False.
|
158
161
|
"""
|
159
162
|
timeout = 10 * 60
|
@@ -166,7 +169,7 @@ class TableController(abc.ABC):
|
|
166
169
|
finished_run = polling.poll(
|
167
170
|
lambda: self.controller.check_if_running(),
|
168
171
|
timeout=timeout,
|
169
|
-
step=
|
172
|
+
step=50)
|
170
173
|
|
171
174
|
check_folder = self.fuzzy_match_most_recent_folder(most_recent_folder)
|
172
175
|
if check_folder.is_ok() and finished_run:
|
@@ -175,9 +178,10 @@ class TableController(abc.ABC):
|
|
175
178
|
finished_run = polling.poll(
|
176
179
|
lambda: self.controller.check_if_running(),
|
177
180
|
timeout=timeout,
|
178
|
-
step=
|
181
|
+
step=50)
|
179
182
|
if finished_run:
|
180
183
|
return check_folder
|
184
|
+
return check_folder
|
181
185
|
else:
|
182
186
|
return Err("Run did not complete as expected")
|
183
187
|
|
@@ -7,7 +7,7 @@ Authors: Lucy Hao
|
|
7
7
|
from typing import Union, Optional
|
8
8
|
|
9
9
|
from ..control.controllers import MethodController, SequenceController, CommunicationController
|
10
|
-
from ..utils.chromatogram import
|
10
|
+
from ..utils.chromatogram import AgilentChannelChromatogramData
|
11
11
|
from ..utils.macro import Command, HPLCRunningStatus, HPLCAvailStatus, HPLCErrorStatus, Response
|
12
12
|
from ..utils.method_types import MethodTimetable
|
13
13
|
from ..utils.sequence_types import SequenceTable, SequenceEntry
|
@@ -30,14 +30,15 @@ class HPLCController:
|
|
30
30
|
comm_dir: str,
|
31
31
|
data_dir: str,
|
32
32
|
method_dir: str,
|
33
|
-
sequence_dir: str
|
33
|
+
sequence_dir: str,
|
34
|
+
offline: bool = False):
|
34
35
|
"""Initialize HPLC controller. The `hplc_talk.mac` macro file must be loaded in the Chemstation software.
|
35
36
|
`comm_dir` must match the file path in the macro file.
|
36
37
|
|
37
38
|
:param comm_dir: Name of directory for communication, where ChemStation will read and write from. Can be any existing directory.
|
38
39
|
:raises FileNotFoundError: If either `data_dir`, `method_dir` or `comm_dir` is not a valid directory.
|
39
40
|
"""
|
40
|
-
self.comm = CommunicationController(comm_dir=comm_dir)
|
41
|
+
self.comm = CommunicationController(comm_dir=comm_dir) if not offline else None
|
41
42
|
self.method_controller = MethodController(controller=self.comm,
|
42
43
|
src=method_dir,
|
43
44
|
data_dir=data_dir,
|
@@ -49,12 +50,18 @@ class HPLCController:
|
|
49
50
|
method_dir=method_dir)
|
50
51
|
|
51
52
|
def send(self, cmd: Union[Command, str]):
|
53
|
+
if not self.comm:
|
54
|
+
raise RuntimeError("Communication controller must be initialized before sending command. It is currently in offline mode.")
|
52
55
|
self.comm.send(cmd)
|
53
56
|
|
54
57
|
def receive(self) -> Response:
|
58
|
+
if not self.comm:
|
59
|
+
raise RuntimeError("Communication controller must be initialized before sending command. It is currently in offline mode.")
|
55
60
|
return self.comm.receive().value
|
56
61
|
|
57
62
|
def status(self) -> Union[HPLCRunningStatus | HPLCAvailStatus | HPLCErrorStatus]:
|
63
|
+
if not self.comm:
|
64
|
+
raise RuntimeError("Communication controller must be initialized before sending command. It is currently in offline mode.")
|
58
65
|
return self.comm.get_status()
|
59
66
|
|
60
67
|
def switch_method(self, method_name: str):
|
@@ -67,6 +74,8 @@ class HPLCController:
|
|
67
74
|
:raises IndexError: Response did not have expected format. Try again.
|
68
75
|
:raises AssertionError: The desired method is not selected. Try again.
|
69
76
|
"""
|
77
|
+
if not self.comm:
|
78
|
+
raise RuntimeError("Communication controller must be initialized before sending command. It is currently in offline mode.")
|
70
79
|
self.method_controller.switch(method_name)
|
71
80
|
|
72
81
|
def switch_sequence(self, sequence_name: str):
|
@@ -76,9 +85,11 @@ class HPLCController:
|
|
76
85
|
|
77
86
|
:param sequence_name: The name of the sequence file
|
78
87
|
"""
|
88
|
+
if not self.comm:
|
89
|
+
raise RuntimeError("Communication controller must be initialized before sending command. It is currently in offline mode.")
|
79
90
|
self.sequence_controller.switch(sequence_name)
|
80
91
|
|
81
|
-
def run_method(self, experiment_name: str):
|
92
|
+
def run_method(self, experiment_name: str, stall_while_running: bool = True):
|
82
93
|
"""
|
83
94
|
This is the preferred method to trigger a run.
|
84
95
|
Starts the currently selected method, storing data
|
@@ -87,18 +98,23 @@ class HPLCController:
|
|
87
98
|
Device must be ready.
|
88
99
|
|
89
100
|
:param experiment_name: Name of the experiment
|
101
|
+
:param stall_while_running: whether this method should return or stall while HPLC runs.
|
90
102
|
"""
|
91
|
-
self.
|
103
|
+
if not self.comm:
|
104
|
+
raise RuntimeError("Communication controller must be initialized before sending command. It is currently in offline mode.")
|
105
|
+
self.method_controller.run(experiment_name, stall_while_running)
|
92
106
|
|
93
|
-
def run_sequence(self):
|
107
|
+
def run_sequence(self, stall_while_running: bool = True):
|
94
108
|
"""
|
95
109
|
Starts the currently loaded sequence, storing data
|
96
110
|
under the <data_dir>/<sequence table name> folder.
|
97
111
|
Device must be ready.
|
98
112
|
|
99
|
-
:param
|
113
|
+
:param stall_while_running: whether this method should return or stall while HPLC runs.
|
100
114
|
"""
|
101
|
-
self.
|
115
|
+
if not self.comm:
|
116
|
+
raise RuntimeError("Communication controller must be initialized before sending command. It is currently in offline mode.")
|
117
|
+
self.sequence_controller.run(stall_while_running=stall_while_running)
|
102
118
|
|
103
119
|
def edit_method(self, updated_method: MethodTimetable, save: bool = False):
|
104
120
|
"""Updated the currently loaded method in ChemStation with provided values.
|
@@ -106,6 +122,8 @@ class HPLCController:
|
|
106
122
|
:param updated_method: the method with updated values, to be sent to Chemstation to modify the currently loaded method.
|
107
123
|
:param save:
|
108
124
|
"""
|
125
|
+
if not self.comm:
|
126
|
+
raise RuntimeError("Communication controller must be initialized before sending command. It is currently in offline mode.")
|
109
127
|
self.method_controller.edit(updated_method, save)
|
110
128
|
|
111
129
|
def edit_sequence(self, updated_sequence: SequenceTable):
|
@@ -115,6 +133,8 @@ class HPLCController:
|
|
115
133
|
|
116
134
|
:param updated_sequence:
|
117
135
|
"""
|
136
|
+
if not self.comm:
|
137
|
+
raise RuntimeError("Communication controller must be initialized before sending command. It is currently in offline mode.")
|
118
138
|
self.sequence_controller.edit(updated_sequence)
|
119
139
|
|
120
140
|
def edit_sequence_row(self, row: SequenceEntry, num: int):
|
@@ -124,55 +144,86 @@ class HPLCController:
|
|
124
144
|
:param row: sequence row entry with updated information
|
125
145
|
:param row_num: the row to edit, based on -1-based indexing
|
126
146
|
"""
|
147
|
+
if not self.comm:
|
148
|
+
raise RuntimeError("Communication controller must be initialized before sending command. It is currently in offline mode.")
|
127
149
|
self.sequence_controller.edit_row(row, num)
|
128
150
|
|
129
|
-
def get_last_run_method_data(self) -> AgilentChannelChromatogramData:
|
151
|
+
def get_last_run_method_data(self, data: Optional[str] = None) -> AgilentChannelChromatogramData:
|
130
152
|
"""
|
131
153
|
Returns the last run method data.
|
132
154
|
"""
|
133
|
-
return self.method_controller.get_data()
|
155
|
+
return self.method_controller.get_data(custom_path=data)
|
134
156
|
|
135
|
-
def get_last_run_sequence_data(self) -> list[AgilentChannelChromatogramData]:
|
157
|
+
def get_last_run_sequence_data(self, data: Optional[str] = None) -> list[AgilentChannelChromatogramData]:
|
136
158
|
"""
|
137
159
|
Returns data for all rows in the last run sequence data.
|
138
160
|
"""
|
139
|
-
return self.sequence_controller.get_data()
|
161
|
+
return self.sequence_controller.get_data(custom_path=data)
|
162
|
+
|
163
|
+
def check_loaded_sequence(self) -> str:
|
164
|
+
"""
|
165
|
+
Returns the name of the currently loaded sequence.
|
166
|
+
"""
|
167
|
+
if not self.comm:
|
168
|
+
raise RuntimeError("Communication controller must be initialized before sending command. It is currently in offline mode.")
|
169
|
+
return self.sequence_controller.check()
|
140
170
|
|
141
171
|
def check_loaded_method(self) -> str:
|
142
|
-
|
172
|
+
"""
|
173
|
+
Returns the name of the currently loaded method.
|
174
|
+
"""
|
175
|
+
if not self.comm:
|
176
|
+
raise RuntimeError("Communication controller must be initialized before sending command. It is currently in offline mode.")
|
177
|
+
return self.method_controller.check()
|
143
178
|
|
144
179
|
def load_method(self) -> MethodTimetable:
|
145
180
|
"""
|
146
|
-
Returns the currently loaded method, including its timetable.
|
181
|
+
Returns all details of the currently loaded method, including its timetable.
|
147
182
|
"""
|
183
|
+
if not self.comm:
|
184
|
+
raise RuntimeError("Communication controller must be initialized before sending command. It is currently in offline mode.")
|
148
185
|
return self.method_controller.load()
|
149
186
|
|
150
187
|
def load_sequence(self) -> SequenceTable:
|
151
188
|
"""
|
152
189
|
Returns the currently loaded sequence.
|
153
190
|
"""
|
191
|
+
if not self.comm:
|
192
|
+
raise RuntimeError("Communication controller must be initialized before sending command. It is currently in offline mode.")
|
154
193
|
return self.sequence_controller.load()
|
155
194
|
|
156
195
|
def standby(self):
|
157
196
|
"""Switches all modules in standby mode. All lamps and pumps are switched off."""
|
197
|
+
if not self.comm:
|
198
|
+
raise RuntimeError("Communication controller must be initialized before sending command. It is currently in offline mode.")
|
158
199
|
self.send(Command.STANDBY_CMD)
|
159
200
|
|
160
201
|
def preprun(self):
|
161
202
|
""" Prepares all modules for run. All lamps and pumps are switched on."""
|
203
|
+
if not self.comm:
|
204
|
+
raise RuntimeError("Communication controller must be initialized before sending command. It is currently in offline mode.")
|
162
205
|
self.send(Command.PREPRUN_CMD)
|
163
206
|
|
164
207
|
def lamp_on(self):
|
165
208
|
"""Turns the UV lamp on."""
|
209
|
+
if not self.comm:
|
210
|
+
raise RuntimeError("Communication controller must be initialized before sending command. It is currently in offline mode.")
|
166
211
|
self.send(Command.LAMP_ON_CMD)
|
167
212
|
|
168
213
|
def lamp_off(self):
|
169
214
|
"""Turns the UV lamp off."""
|
215
|
+
if not self.comm:
|
216
|
+
raise RuntimeError("Communication controller must be initialized before sending command. It is currently in offline mode.")
|
170
217
|
self.send(Command.LAMP_OFF_CMD)
|
171
218
|
|
172
219
|
def pump_on(self):
|
173
220
|
"""Turns on the pump on."""
|
221
|
+
if not self.comm:
|
222
|
+
raise RuntimeError("Communication controller must be initialized before sending command. It is currently in offline mode.")
|
174
223
|
self.send(Command.PUMP_ON_CMD)
|
175
224
|
|
176
225
|
def pump_off(self):
|
177
226
|
"""Turns the pump off."""
|
227
|
+
if not self.comm:
|
228
|
+
raise RuntimeError("Communication controller must be initialized before sending command. It is currently in offline mode.")
|
178
229
|
self.send(Command.PUMP_OFF_CMD)
|
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
|
5
5
|
|
6
6
|
setuptools.setup(
|
7
7
|
name="pychemstation",
|
8
|
-
version="0.5.
|
8
|
+
version="0.5.9",
|
9
9
|
author="Lucy Hao",
|
10
10
|
author_email="lhao03@student.ubc.ca",
|
11
11
|
description="Library to interact with Chemstation software, primarily used in Hein lab",
|
@@ -28,16 +28,13 @@ class TestCombinations(unittest.TestCase):
|
|
28
28
|
first_row=HPLCMethodParams(
|
29
29
|
organic_modifier=5,
|
30
30
|
flow=0.65,
|
31
|
-
maximum_run_time=
|
31
|
+
maximum_run_time=4),
|
32
32
|
subsequent_rows=[
|
33
33
|
TimeTableEntry(
|
34
|
-
start_time=
|
35
|
-
organic_modifer=
|
36
|
-
flow=0.
|
37
|
-
|
38
|
-
start_time=0.5,
|
39
|
-
organic_modifer=98,
|
40
|
-
flow=0.55)])
|
34
|
+
start_time=3.5,
|
35
|
+
organic_modifer=100,
|
36
|
+
flow=0.65)],
|
37
|
+
name=DEFAULT_METHOD)
|
41
38
|
self.hplc_controller.edit_method(rand_method, save=True)
|
42
39
|
if run_too:
|
43
40
|
self.hplc_controller.run_method(experiment_name="changed_method")
|
@@ -97,7 +94,8 @@ class TestCombinations(unittest.TestCase):
|
|
97
94
|
TimeTableEntry(
|
98
95
|
start_time=0.50,
|
99
96
|
organic_modifer=99,
|
100
|
-
flow=0.34)]
|
97
|
+
flow=0.34)],
|
98
|
+
name=DEFAULT_METHOD)
|
101
99
|
self.hplc_controller.edit_method(rand_method, save=True)
|
102
100
|
|
103
101
|
self.hplc_controller.switch_sequence(sequence_name=DEFAULT_SEQUENCE)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation/control/controllers/__init__.py
RENAMED
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
|
{pychemstation-0.5.7.dev1 → pychemstation-0.5.9}/pychemstation.egg-info/dependency_links.txt
RENAMED
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
|