pychemstation 0.10.0__py3-none-any.whl → 0.10.1__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/README.md +132 -0
- pychemstation/control/controllers/README.md +1 -0
- {pychemstation-0.10.0.dist-info → pychemstation-0.10.1.dist-info}/METADATA +11 -9
- {pychemstation-0.10.0.dist-info → pychemstation-0.10.1.dist-info}/RECORD +6 -31
- {pychemstation-0.10.0.dist-info → pychemstation-0.10.1.dist-info}/WHEEL +1 -2
- pychemstation/analysis/spec_utils.py +0 -304
- pychemstation/analysis/utils.py +0 -63
- pychemstation/control/comm.py +0 -206
- pychemstation/control/controllers/devices/column.py +0 -12
- pychemstation/control/controllers/devices/dad.py +0 -0
- pychemstation/control/controllers/devices/pump.py +0 -43
- pychemstation/control/controllers/method.py +0 -338
- pychemstation/control/controllers/sequence.py +0 -190
- pychemstation/control/controllers/table_controller.py +0 -266
- pychemstation/control/table/__init__.py +0 -3
- pychemstation/control/table/method.py +0 -274
- pychemstation/control/table/sequence.py +0 -210
- pychemstation/control/table/table_controller.py +0 -201
- pychemstation-0.10.0.dist-info/top_level.txt +0 -2
- tests/__init__.py +0 -0
- tests/constants.py +0 -134
- tests/test_comb.py +0 -136
- tests/test_comm.py +0 -65
- tests/test_inj.py +0 -39
- tests/test_method.py +0 -99
- tests/test_nightly.py +0 -80
- tests/test_offline_stable.py +0 -69
- tests/test_online_stable.py +0 -275
- tests/test_proc_rep.py +0 -52
- tests/test_runs_stable.py +0 -225
- tests/test_sequence.py +0 -125
- tests/test_stable.py +0 -276
- {pychemstation-0.10.0.dist-info → pychemstation-0.10.1.dist-info}/licenses/LICENSE +0 -0
tests/test_stable.py
DELETED
@@ -1,276 +0,0 @@
|
|
1
|
-
import unittest
|
2
|
-
|
3
|
-
from pychemstation.utils.macro import *
|
4
|
-
from pychemstation.utils.tray_types import *
|
5
|
-
from tests.constants import *
|
6
|
-
|
7
|
-
|
8
|
-
class TestStable(unittest.TestCase):
|
9
|
-
|
10
|
-
def setUp(self):
|
11
|
-
self.hplc_controller = set_up_utils(242)
|
12
|
-
|
13
|
-
def test_status_check_standby(self):
|
14
|
-
self.hplc_controller.standby()
|
15
|
-
self.assertTrue(self.hplc_controller.status() in [HPLCAvailStatus.STANDBY, HPLCRunningStatus.NOTREADY])
|
16
|
-
|
17
|
-
def test_status_check_preprun(self):
|
18
|
-
self.hplc_controller.preprun()
|
19
|
-
self.assertTrue(self.hplc_controller.status() in [HPLCAvailStatus.PRERUN, HPLCAvailStatus.STANDBY,
|
20
|
-
HPLCRunningStatus.NOTREADY])
|
21
|
-
|
22
|
-
def test_send_command(self):
|
23
|
-
try:
|
24
|
-
self.hplc_controller.send(Command.GET_METHOD_CMD)
|
25
|
-
except Exception as e:
|
26
|
-
self.fail(f"Should not throw error: {e}")
|
27
|
-
|
28
|
-
def test_send_str(self):
|
29
|
-
try:
|
30
|
-
self.hplc_controller.send("Local TestNum")
|
31
|
-
self.hplc_controller.send("TestNum = 0")
|
32
|
-
self.hplc_controller.send("Print TestNum")
|
33
|
-
self.hplc_controller.send("response_num = TestNum")
|
34
|
-
self.hplc_controller.send("Print response_num")
|
35
|
-
except Exception as e:
|
36
|
-
self.fail(f"Should not throw error: {e}")
|
37
|
-
|
38
|
-
def test_get_num(self):
|
39
|
-
try:
|
40
|
-
self.hplc_controller.send("response_num = 10")
|
41
|
-
res = self.hplc_controller.receive().num_response
|
42
|
-
self.assertEqual(res, 10)
|
43
|
-
except Exception as e:
|
44
|
-
self.fail(f"Should not throw error: {e}")
|
45
|
-
|
46
|
-
def test_get_response(self):
|
47
|
-
try:
|
48
|
-
self.hplc_controller.switch_method(method_name=DEFAULT_METHOD)
|
49
|
-
self.hplc_controller.send(Command.GET_METHOD_CMD)
|
50
|
-
res = self.hplc_controller.receive()
|
51
|
-
self.assertTrue(DEFAULT_METHOD in res.string_response)
|
52
|
-
except Exception as e:
|
53
|
-
self.fail(f"Should not throw error: {e}")
|
54
|
-
|
55
|
-
def test_edit_method(self):
|
56
|
-
self.hplc_controller.method_controller.switch(DEFAULT_METHOD)
|
57
|
-
new_method = MethodDetails(name=DEFAULT_METHOD + ".M",
|
58
|
-
timetable=[TimeTableEntry(start_time=1.0,
|
59
|
-
organic_modifer=20.0,
|
60
|
-
flow=0.65),
|
61
|
-
TimeTableEntry(start_time=2.0,
|
62
|
-
organic_modifer=30.0,
|
63
|
-
flow=0.65),
|
64
|
-
TimeTableEntry(start_time=2.5,
|
65
|
-
organic_modifer=60.0,
|
66
|
-
flow=0.65),
|
67
|
-
TimeTableEntry(start_time=3.0,
|
68
|
-
organic_modifer=80.0,
|
69
|
-
flow=0.65),
|
70
|
-
TimeTableEntry(start_time=3.5,
|
71
|
-
organic_modifer=100.0,
|
72
|
-
flow=0.65)],
|
73
|
-
stop_time=4.0,
|
74
|
-
post_time=1.0,
|
75
|
-
params=HPLCMethodParams(organic_modifier=5.0, flow=0.65))
|
76
|
-
try:
|
77
|
-
self.hplc_controller.edit_method(new_method)
|
78
|
-
self.assertEqual(new_method, self.hplc_controller.load_method())
|
79
|
-
except Exception as e:
|
80
|
-
self.fail(f"Should have not failed: {e}")
|
81
|
-
|
82
|
-
def test_load_method(self):
|
83
|
-
self.hplc_controller.method_controller.switch(DEFAULT_METHOD)
|
84
|
-
new_method = gen_rand_method()
|
85
|
-
try:
|
86
|
-
self.hplc_controller.edit_method(new_method)
|
87
|
-
loaded_method = self.hplc_controller.load_method()
|
88
|
-
self.assertEqual(new_method.params.organic_modifier,
|
89
|
-
loaded_method.params.organic_modifier)
|
90
|
-
self.assertEqual(new_method.timetable[0].organic_modifer,
|
91
|
-
loaded_method.timetable[0].organic_modifer)
|
92
|
-
self.assertEqual(round(new_method.params.flow, 2),
|
93
|
-
round(loaded_method.params.flow, 2))
|
94
|
-
except Exception as e:
|
95
|
-
self.fail(f"Should have not failed: {e}")
|
96
|
-
|
97
|
-
def test_switch(self):
|
98
|
-
try:
|
99
|
-
self.hplc_controller.switch_sequence(sequence_name=DEFAULT_SEQUENCE)
|
100
|
-
except Exception as e:
|
101
|
-
self.fail(f"Should have not expected: {e}")
|
102
|
-
|
103
|
-
def test_read(self):
|
104
|
-
try:
|
105
|
-
self.hplc_controller.switch_sequence(sequence_name=DEFAULT_SEQUENCE)
|
106
|
-
table = self.hplc_controller.load_sequence()
|
107
|
-
self.assertTrue(table)
|
108
|
-
except Exception as e:
|
109
|
-
self.fail(f"Should have not expected: {e}")
|
110
|
-
|
111
|
-
def test_edit_entire_table(self):
|
112
|
-
self.hplc_controller.switch_sequence(sequence_name=DEFAULT_SEQUENCE)
|
113
|
-
seq_folder = self.hplc_controller.sequence_controller.src
|
114
|
-
meth_path = os.path.join(seq_folder, DEFAULT_METHOD)
|
115
|
-
try:
|
116
|
-
seq_table = SequenceTable(
|
117
|
-
name=DEFAULT_SEQUENCE,
|
118
|
-
rows=[
|
119
|
-
SequenceEntry(
|
120
|
-
vial_location=TenVialColumn.ONE,
|
121
|
-
method=meth_path,
|
122
|
-
num_inj=3,
|
123
|
-
inj_vol=4,
|
124
|
-
sample_name="Sampel1",
|
125
|
-
sample_type=SampleType.SAMPLE,
|
126
|
-
inj_source=InjectionSource.HIP_ALS
|
127
|
-
),
|
128
|
-
SequenceEntry(
|
129
|
-
vial_location=FiftyFourVialPlate(plate=Plate.ONE, letter=Letter.A, num=Num.ONE),
|
130
|
-
method=meth_path,
|
131
|
-
num_inj=3,
|
132
|
-
inj_vol=4,
|
133
|
-
sample_name="Sampel2",
|
134
|
-
sample_type=SampleType.SAMPLE,
|
135
|
-
inj_source=InjectionSource.HIP_ALS
|
136
|
-
),
|
137
|
-
SequenceEntry(
|
138
|
-
vial_location=FiftyFourVialPlate(plate=Plate.ONE, letter=Letter.A, num=Num.TWO),
|
139
|
-
method=meth_path,
|
140
|
-
num_inj=3,
|
141
|
-
inj_vol=4,
|
142
|
-
sample_name="Sampel2",
|
143
|
-
sample_type=SampleType.SAMPLE,
|
144
|
-
inj_source=InjectionSource.HIP_ALS
|
145
|
-
),
|
146
|
-
SequenceEntry(
|
147
|
-
vial_location=FiftyFourVialPlate(plate=Plate.ONE, letter=Letter.A, num=Num.THREE),
|
148
|
-
method=meth_path,
|
149
|
-
num_inj=3,
|
150
|
-
inj_vol=4,
|
151
|
-
sample_name="Sampel2",
|
152
|
-
sample_type=SampleType.SAMPLE,
|
153
|
-
inj_source=InjectionSource.HIP_ALS
|
154
|
-
)
|
155
|
-
]
|
156
|
-
)
|
157
|
-
self.hplc_controller.edit_sequence(seq_table)
|
158
|
-
self.assertEqual(seq_table,
|
159
|
-
self.hplc_controller.load_sequence())
|
160
|
-
except Exception:
|
161
|
-
self.fail("Should have not occured")
|
162
|
-
|
163
|
-
def test_edit_entire_table_less_rows(self):
|
164
|
-
self.hplc_controller.switch_sequence(sequence_name=DEFAULT_SEQUENCE)
|
165
|
-
try:
|
166
|
-
seq_table = SequenceTable(
|
167
|
-
name=DEFAULT_SEQUENCE,
|
168
|
-
rows=[
|
169
|
-
SequenceEntry(
|
170
|
-
vial_location=TenVialColumn.TEN,
|
171
|
-
method=DEFAULT_METHOD,
|
172
|
-
num_inj=3,
|
173
|
-
inj_vol=4,
|
174
|
-
sample_name="Sampel2",
|
175
|
-
sample_type=SampleType.SAMPLE,
|
176
|
-
inj_source=InjectionSource.HIP_ALS
|
177
|
-
),
|
178
|
-
SequenceEntry(
|
179
|
-
vial_location=TenVialColumn.THREE,
|
180
|
-
method=DEFAULT_METHOD,
|
181
|
-
num_inj=3,
|
182
|
-
inj_vol=4,
|
183
|
-
sample_name="Sampel2",
|
184
|
-
sample_type=SampleType.SAMPLE,
|
185
|
-
inj_source=InjectionSource.HIP_ALS
|
186
|
-
)
|
187
|
-
]
|
188
|
-
)
|
189
|
-
self.hplc_controller.edit_sequence(seq_table)
|
190
|
-
except Exception:
|
191
|
-
self.fail("Should have not occured")
|
192
|
-
|
193
|
-
def test_load(self):
|
194
|
-
try:
|
195
|
-
seq = self.hplc_controller.load_sequence()
|
196
|
-
self.assertTrue(len(seq.rows) > 0)
|
197
|
-
except Exception as e:
|
198
|
-
self.fail(f"Should have not expected: {e}")
|
199
|
-
|
200
|
-
def test_tray_nums(self):
|
201
|
-
vial_locations = [
|
202
|
-
FiftyFourVialPlate.from_str('P1-A7'),
|
203
|
-
FiftyFourVialPlate.from_str('P1-B4'),
|
204
|
-
FiftyFourVialPlate.from_str('P1-C2'),
|
205
|
-
FiftyFourVialPlate.from_str('P1-D8'),
|
206
|
-
FiftyFourVialPlate.from_str('P1-E3'),
|
207
|
-
FiftyFourVialPlate.from_str('P1-F5'),
|
208
|
-
# plate 2
|
209
|
-
FiftyFourVialPlate.from_str('P2-A7'),
|
210
|
-
FiftyFourVialPlate.from_str('P2-B2'),
|
211
|
-
FiftyFourVialPlate.from_str('P2-C1'),
|
212
|
-
FiftyFourVialPlate.from_str('P2-D8'),
|
213
|
-
FiftyFourVialPlate.from_str('P2-E3'),
|
214
|
-
FiftyFourVialPlate.from_str('P2-F6'),
|
215
|
-
]
|
216
|
-
seq_table = SequenceTable(
|
217
|
-
name=DEFAULT_SEQUENCE,
|
218
|
-
rows=[
|
219
|
-
SequenceEntry(
|
220
|
-
vial_location=v,
|
221
|
-
method=DEFAULT_METHOD,
|
222
|
-
num_inj=3,
|
223
|
-
inj_vol=4,
|
224
|
-
sample_name="Sampel2",
|
225
|
-
sample_type=SampleType.SAMPLE,
|
226
|
-
inj_source=InjectionSource.HIP_ALS
|
227
|
-
) for v in vial_locations
|
228
|
-
]
|
229
|
-
)
|
230
|
-
self.hplc_controller.edit_sequence(seq_table)
|
231
|
-
loaded_table = self.hplc_controller.load_sequence()
|
232
|
-
for i in range(len(vial_locations)):
|
233
|
-
self.assertTrue(vial_locations[i].value()
|
234
|
-
== seq_table.rows[i].vial_location.value()
|
235
|
-
== loaded_table.rows[i].vial_location.value())
|
236
|
-
|
237
|
-
def test_tray_nums_only(self):
|
238
|
-
vial_locations = [
|
239
|
-
# plate 2
|
240
|
-
FiftyFourVialPlate.from_str('P2-A7'),
|
241
|
-
FiftyFourVialPlate.from_str('P2-B2'),
|
242
|
-
FiftyFourVialPlate.from_str('P2-C1'),
|
243
|
-
FiftyFourVialPlate.from_str('P2-D8'),
|
244
|
-
FiftyFourVialPlate.from_str('P2-E3'),
|
245
|
-
FiftyFourVialPlate.from_str('P2-F6'),
|
246
|
-
# plate 1
|
247
|
-
FiftyFourVialPlate.from_str('P1-A7'),
|
248
|
-
FiftyFourVialPlate.from_str('P1-B4'),
|
249
|
-
FiftyFourVialPlate.from_str('P1-C2'),
|
250
|
-
FiftyFourVialPlate.from_str('P1-D8'),
|
251
|
-
FiftyFourVialPlate.from_str('P1-E3'),
|
252
|
-
FiftyFourVialPlate.from_str('P1-F5'),
|
253
|
-
]
|
254
|
-
|
255
|
-
for i in range(len(vial_locations)):
|
256
|
-
self.assertEqual(vial_locations[i], FiftyFourVialPlate.from_int(vial_locations[i].value()))
|
257
|
-
|
258
|
-
def test_get_last_run_sequence(self):
|
259
|
-
path = "C:\\Users\\Public\\Documents\\ChemStation\\3\\Data\\hplc_testing 2025-03-24 16-28-16"
|
260
|
-
folder_name = "hplc_testing 2025-03-24 16-28"
|
261
|
-
self.hplc_controller.sequence_controller.data_files.append(SequenceDataFiles(dir=folder_name,
|
262
|
-
sequence_name=DEFAULT_SEQUENCE))
|
263
|
-
try:
|
264
|
-
most_recent_folder = self.hplc_controller.sequence_controller.retrieve_recent_data_files()
|
265
|
-
check_folder = self.hplc_controller.sequence_controller.fuzzy_match_most_recent_folder(
|
266
|
-
most_recent_folder=most_recent_folder)
|
267
|
-
self.assertEqual(check_folder.ok_value, path)
|
268
|
-
self.hplc_controller.sequence_controller.data_files[-1].dir = check_folder.ok_value
|
269
|
-
chrom = self.hplc_controller.get_last_run_sequence_data()
|
270
|
-
self.assertTrue(chrom)
|
271
|
-
except Exception:
|
272
|
-
self.fail()
|
273
|
-
|
274
|
-
|
275
|
-
if __name__ == '__main__':
|
276
|
-
unittest.main()
|
File without changes
|