pychemstation 0.5.2__py3-none-any.whl → 0.5.4__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.
@@ -0,0 +1,34 @@
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=u44g1hTluQ0yUG93Un-QAshScoDpgYRrZfFTgweP5tY,7386
8
+ pychemstation/control/hplc.py,sha256=huEUl90Ylvzvy2TXWUjhyDU4PazrK7Z51M8spquHvVg,6719
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=Eri52AnbE3BGthfrRSvYKYciquUzvHKo0lYUTySYYE8,10542
12
+ pychemstation/control/table/table_controller.py,sha256=F5lv1DlPkEDcFmtwVT-E9Kq075jnWIN-iZIM3_mTt5E,8115
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=cN51Ry2pammDdk85cabVH3qkchjKKIzZfAH87Poty80,2350
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=lLwT_QaVriivL5llkul6RxXxPriwUp1E-Y3G9fejvbo,2092
26
+ tests/test_comb.py,sha256=faF4764oJEZ2vhG9-zLmQxjATseipRKXrStehuDCXOI,5638
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=yIQGhUTehtHz6D1ai5W6AlP0zes2icF0VdQ0IGJ2CbQ,4901
30
+ pychemstation-0.5.4.dist-info/LICENSE,sha256=9bdF75gIf1MecZ7oymqWgJREVz7McXPG-mjqrTmzzD8,18658
31
+ pychemstation-0.5.4.dist-info/METADATA,sha256=TN5NWM9_QmES6TmIm_pXGvQxlNTQsHJDiP1wd1dRktA,3992
32
+ pychemstation-0.5.4.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
33
+ pychemstation-0.5.4.dist-info/top_level.txt,sha256=zXfKu_4nYWwPHo3OsuhshMNC3SPkcoTGCyODjURaghY,20
34
+ pychemstation-0.5.4.dist-info/RECORD,,
tests/constants.py CHANGED
@@ -1,12 +1,65 @@
1
+ import random
2
+
3
+ from pychemstation.utils.method_types import *
4
+ from pychemstation.utils.sequence_types import *
5
+
6
+ DEFAULT_METHOD = "GENERAL-POROSHELL-OPT"
7
+ DEFAULT_SEQUENCE = "LLETest"
1
8
 
2
9
  # CONSTANTS: paths only work in Hein group HPLC machine in room 242
3
10
  DEFAULT_COMMAND_PATH = "C:\\Users\\User\\Desktop\\Lucy\\"
4
- DEFAULT_METHOD = "GENERAL-POROSHELL-OPT"
5
- DEFAULT_TESTING_METHOD = "GENERAL-POROSHELL-MIN"
6
11
  DEFAULT_METHOD_DIR = "C:\\ChemStation\\1\\Methods\\"
7
12
  DATA_DIR = "C:\\Users\\Public\\Documents\\ChemStation\\3\\Data"
8
13
  SEQUENCE_DIR = "C:\\USERS\\PUBLIC\\DOCUMENTS\\CHEMSTATION\\3\\Sequence"
9
- DEFAULT_SEQUENCE = "hplc_testing"
10
- METHOD_EXAMPLE = "/Users/lucyhao/Codes/heinanalyticalcontrol/tests/methods/General-Poroshell.M"
11
14
 
12
- HEIN_LAB_CONSTANTS = [DEFAULT_COMMAND_PATH, DEFAULT_METHOD_DIR, DATA_DIR, SEQUENCE_DIR]
15
+ HEIN_LAB_CONSTANTS = [DEFAULT_COMMAND_PATH,
16
+ DEFAULT_METHOD_DIR,
17
+ DATA_DIR,
18
+ SEQUENCE_DIR]
19
+
20
+ # these CONSTANTS work in rm 254
21
+ DEFAULT_COMMAND_PATH_254 = "D:\\\git_repositories\\\hplc_comm\\"
22
+ DEFAULT_METHOD_DIR_254 = "D:\\Chemstation\\1\\Methods\\"
23
+ DATA_DIR_254 = "D:\\Chemstation\\1\\Data\\2024-12\\"
24
+ SEQUENCE_DIR_254 = "C:\\1\\Sequence\\"
25
+
26
+ HEIN_LAB_CONSTANTS_254 = [DEFAULT_COMMAND_PATH_254,
27
+ DEFAULT_METHOD_DIR_254,
28
+ DATA_DIR_254,
29
+ SEQUENCE_DIR_254]
30
+
31
+
32
+ def room(num: int):
33
+ if num == 242:
34
+ return HEIN_LAB_CONSTANTS
35
+ elif num == 254:
36
+ return HEIN_LAB_CONSTANTS_254
37
+
38
+
39
+ def gen_rand_method():
40
+ org_modifier = int(random.random() * 10)
41
+ max_run_time = int(random.random() * 10)
42
+ return MethodTimetable(
43
+ first_row=HPLCMethodParams(
44
+ organic_modifier=org_modifier,
45
+ flow=round(random.random(), 2),
46
+ maximum_run_time=max_run_time),
47
+ subsequent_rows=[
48
+ TimeTableEntry(
49
+ start_time=0.10,
50
+ organic_modifer=org_modifier,
51
+ flow=0.34),
52
+ TimeTableEntry(
53
+ start_time=1,
54
+ organic_modifer=100 - int(random.random() * 10),
55
+ flow=0.55)])
56
+
57
+
58
+ seq_entry = SequenceEntry(
59
+ vial_location=TenColumn.ONE,
60
+ method=DEFAULT_METHOD,
61
+ num_inj=int(random.random() * 10),
62
+ inj_vol=int(random.random() * 10),
63
+ sample_name="Test",
64
+ sample_type=SampleType(int(random.random() * 3)),
65
+ )
tests/test_comb.py ADDED
@@ -0,0 +1,143 @@
1
+ import os
2
+
3
+ import unittest
4
+
5
+ from pychemstation.control import HPLCController
6
+ from tests.constants import *
7
+
8
+ run_too = True
9
+
10
+
11
+ class TestCombinations(unittest.TestCase):
12
+ def setUp(self):
13
+ path_constants = room(254)
14
+ for path in path_constants:
15
+ if not os.path.exists(path):
16
+ self.fail(
17
+ f"{path} does not exist on your system. If you would like to run tests, please change this path.")
18
+
19
+ self.hplc_controller = HPLCController(comm_dir=path_constants[0],
20
+ method_dir=path_constants[1],
21
+ data_dir=path_constants[2],
22
+ sequence_dir=path_constants[3])
23
+
24
+ def test_run_method_after_update(self):
25
+ try:
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)
42
+ if run_too:
43
+ self.hplc_controller.run_method(experiment_name="changed_method")
44
+ except Exception as e:
45
+ self.fail(f"Should have not failed: {e}")
46
+
47
+ def test_run_after_table_edit(self):
48
+ try:
49
+ self.hplc_controller.switch_sequence(sequence_name=DEFAULT_SEQUENCE)
50
+ seq_table = self.hplc_controller.load_sequence()
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)
66
+ self.hplc_controller.edit_sequence(seq_table)
67
+ if run_too:
68
+ self.hplc_controller.run_sequence()
69
+ chrom = self.hplc_controller.get_last_run_sequence_data()
70
+ self.assertTrue(len(chrom) == 2)
71
+ except Exception as e:
72
+ self.fail("Failed")
73
+
74
+ def test_run_after_existing_row_edit(self):
75
+ try:
76
+ self.hplc_controller.switch_sequence(sequence_name=DEFAULT_SEQUENCE)
77
+ seq_table = self.hplc_controller.load_sequence()
78
+ self.hplc_controller.edit_sequence_row(seq_entry, 1)
79
+ if run_too:
80
+ self.hplc_controller.run_sequence()
81
+ chrom = self.hplc_controller.get_last_run_sequence_data()
82
+ self.assertTrue(len(chrom) == 2)
83
+ except Exception:
84
+ self.fail("Failed")
85
+
86
+ def test_update_method_update_seq_table_run(self):
87
+ try:
88
+ self.hplc_controller.method_controller.switch(DEFAULT_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)])
99
+ self.hplc_controller.edit_method(rand_method, save=True)
100
+
101
+ self.hplc_controller.switch_sequence(sequence_name=DEFAULT_SEQUENCE)
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
+ )
125
+
126
+ self.hplc_controller.edit_sequence(seq_table)
127
+ if run_too:
128
+ self.hplc_controller.preprun()
129
+ self.hplc_controller.run_sequence()
130
+ chrom = self.hplc_controller.get_last_run_sequence_data()
131
+ self.assertTrue(len(chrom) == 2)
132
+ except Exception:
133
+ self.fail("Failed")
134
+
135
+ def test_run_sequence(self):
136
+ try:
137
+ self.hplc_controller.switch_sequence(sequence_name=DEFAULT_SEQUENCE)
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)
142
+ except Exception:
143
+ self.fail("Failed")
tests/test_comm.py CHANGED
@@ -10,24 +10,25 @@ from tests.constants import *
10
10
  class TestComm(unittest.TestCase):
11
11
 
12
12
  def setUp(self):
13
- for path in HEIN_LAB_CONSTANTS:
13
+ path_constants = room(254)
14
+ for path in path_constants:
14
15
  if not os.path.exists(path):
15
16
  self.fail(
16
17
  f"{path} does not exist on your system. If you would like to run tests, please change this path.")
17
18
 
18
- self.hplc_controller = HPLCController(data_dir=DATA_DIR,
19
- comm_dir=DEFAULT_COMMAND_PATH,
20
- method_dir=DEFAULT_METHOD_DIR,
21
- sequence_dir=SEQUENCE_DIR)
19
+ self.hplc_controller = HPLCController(comm_dir=path_constants[0],
20
+ method_dir=path_constants[1],
21
+ data_dir=path_constants[2],
22
+ sequence_dir=path_constants[3])
22
23
 
23
24
  def test_status_check_standby(self):
24
25
  self.hplc_controller.standby()
25
- self.assertTrue(self.hplc_controller.status()[0] in [HPLCAvailStatus.STANDBY, HPLCRunningStatus.NOTREADY])
26
+ self.assertTrue(self.hplc_controller.status() in [HPLCAvailStatus.STANDBY, HPLCRunningStatus.NOTREADY])
26
27
 
27
28
  def test_status_check_preprun(self):
28
29
  self.hplc_controller.preprun()
29
- self.assertTrue(self.hplc_controller.status()[0] in [HPLCAvailStatus.PRERUN, HPLCAvailStatus.STANDBY,
30
- HPLCRunningStatus.NOTREADY])
30
+ self.assertTrue(self.hplc_controller.status() in [HPLCAvailStatus.PRERUN, HPLCAvailStatus.STANDBY,
31
+ HPLCRunningStatus.NOTREADY])
31
32
 
32
33
  def test_send_command(self):
33
34
  try:
@@ -39,6 +40,17 @@ class TestComm(unittest.TestCase):
39
40
  try:
40
41
  self.hplc_controller.send("Local TestNum")
41
42
  self.hplc_controller.send("TestNum = 0")
43
+ self.hplc_controller.send("Print TestNum")
44
+ self.hplc_controller.send("response_num = TestNum")
45
+ self.hplc_controller.send("Print num_response")
46
+ except Exception as e:
47
+ self.fail(f"Should not throw error: {e}")
48
+
49
+ def test_get_num(self):
50
+ try:
51
+ self.hplc_controller.send("response_num = 10")
52
+ res = self.hplc_controller.receive().num_response
53
+ self.assertEqual(res, 10)
42
54
  except Exception as e:
43
55
  self.fail(f"Should not throw error: {e}")
44
56
 
@@ -47,7 +59,7 @@ class TestComm(unittest.TestCase):
47
59
  self.hplc_controller.switch_method(method_name=DEFAULT_METHOD)
48
60
  self.hplc_controller.send(Command.GET_METHOD_CMD)
49
61
  res = self.hplc_controller.receive()
50
- self.assertTrue(DEFAULT_METHOD in res)
62
+ self.assertTrue(DEFAULT_METHOD in res.string_response)
51
63
  except Exception as e:
52
64
  self.fail(f"Should not throw error: {e}")
53
65
 
tests/test_method.py CHANGED
@@ -2,51 +2,50 @@ import os
2
2
  import unittest
3
3
 
4
4
  from pychemstation.control import HPLCController
5
- from pychemstation.utils.method_types import *
6
5
  from tests.constants import *
7
6
 
8
7
 
9
8
  class TestMethod(unittest.TestCase):
10
9
  def setUp(self):
11
- for path in HEIN_LAB_CONSTANTS:
10
+ path_constants = room(254)
11
+ for path in path_constants:
12
12
  if not os.path.exists(path):
13
13
  self.fail(
14
14
  f"{path} does not exist on your system. If you would like to run tests, please change this path.")
15
15
 
16
- self.hplc_controller = HPLCController(data_dir=DATA_DIR,
17
- comm_dir=DEFAULT_COMMAND_PATH,
18
- method_dir=DEFAULT_METHOD_DIR,
19
- sequence_dir=SEQUENCE_DIR)
16
+ self.hplc_controller = HPLCController(comm_dir=path_constants[0],
17
+ method_dir=path_constants[1],
18
+ data_dir=path_constants[2],
19
+ sequence_dir=path_constants[3])
20
20
 
21
-
22
-
23
- def test_load_method_details(self):
21
+ def test_load_method_from_disk(self):
24
22
  self.hplc_controller.switch_method(DEFAULT_METHOD)
25
23
  try:
26
- gp_mtd = self.hplc_controller.method_controller.load(DEFAULT_METHOD)
27
- self.assertTrue(gp_mtd.first_row.organic_modifier.val == 5)
24
+ gp_mtd = self.hplc_controller.method_controller.load_from_disk(DEFAULT_METHOD)
25
+ self.assertTrue(gp_mtd.first_row.organic_modifier == 5)
28
26
  except Exception as e:
29
27
  self.fail(f"Should have not failed, {e}")
30
28
 
31
- def test_method_update_timetable(self):
29
+ def test_edit_method(self):
30
+ self.hplc_controller.method_controller.switch(DEFAULT_METHOD)
31
+ new_method = gen_rand_method()
32
+ try:
33
+ self.hplc_controller.edit_method(new_method)
34
+ except Exception as e:
35
+ self.fail(f"Should have not failed: {e}")
36
+
37
+ def test_load_method(self):
32
38
  self.hplc_controller.method_controller.switch(DEFAULT_METHOD)
33
- new_method = MethodTimetable(
34
- first_row=HPLCMethodParams(
35
- organic_modifier=7,
36
- flow=0.44,
37
- maximum_run_time=2,
38
- temperature=15),
39
- subsequent_rows=[
40
- TimeTableEntry(
41
- start_time=0.10,
42
- organic_modifer=7,
43
- flow=0.34),
44
- TimeTableEntry(
45
- start_time=1,
46
- organic_modifer=99,
47
- flow=0.55)])
39
+ new_method = gen_rand_method()
48
40
  try:
49
41
  self.hplc_controller.edit_method(new_method)
42
+ loaded_method = self.hplc_controller.load_method()
43
+ self.assertEqual(new_method.first_row.organic_modifier,
44
+ loaded_method.first_row.organic_modifier)
45
+ self.assertEqual(new_method.subsequent_rows,
46
+ loaded_method.subsequent_rows)
47
+ self.assertEqual(new_method.first_row.flow,
48
+ loaded_method.first_row.flow)
50
49
  except Exception as e:
51
50
  self.fail(f"Should have not failed: {e}")
52
51
 
@@ -58,7 +57,5 @@ class TestMethod(unittest.TestCase):
58
57
  self.fail(f"Should have not failed: {e}")
59
58
 
60
59
 
61
-
62
-
63
60
  if __name__ == '__main__':
64
61
  unittest.main()
tests/test_sequence.py CHANGED
@@ -8,15 +8,16 @@ from tests.constants import *
8
8
 
9
9
  class TestSequence(unittest.TestCase):
10
10
  def setUp(self):
11
- for path in HEIN_LAB_CONSTANTS:
11
+ path_constants = room(254)
12
+ for path in path_constants:
12
13
  if not os.path.exists(path):
13
14
  self.fail(
14
15
  f"{path} does not exist on your system. If you would like to run tests, please change this path.")
15
16
 
16
- self.hplc_controller = HPLCController(data_dir=DATA_DIR,
17
- comm_dir=DEFAULT_COMMAND_PATH,
18
- method_dir=DEFAULT_METHOD_DIR,
19
- sequence_dir=SEQUENCE_DIR)
17
+ self.hplc_controller = HPLCController(comm_dir=path_constants[0],
18
+ method_dir=path_constants[1],
19
+ data_dir=path_constants[2],
20
+ sequence_dir=path_constants[3])
20
21
 
21
22
  def test_switch(self):
22
23
  try:
@@ -26,77 +27,100 @@ class TestSequence(unittest.TestCase):
26
27
 
27
28
  def test_edit_row(self):
28
29
  self.hplc_controller.switch_sequence(sequence_name=DEFAULT_SEQUENCE)
29
- self.hplc_controller.edit_sequence_row(SequenceEntry(
30
- vial_location=10,
31
- method="C:\\ChemStation\\1\\Methods\\General-Poroshell",
32
- num_inj=3,
33
- inj_vol=4,
34
- sample_name="Blank",
35
- sample_type=SampleType.BLANK,
36
- inj_source=InjectionSource.HIP_ALS
37
- ), 1)
30
+ try:
31
+ self.hplc_controller.edit_sequence_row(SequenceEntry(
32
+ vial_location=TenColumn.TEN,
33
+ method=DEFAULT_METHOD,
34
+ num_inj=3,
35
+ inj_vol=4,
36
+ sample_name="Blank",
37
+ sample_type=SampleType.BLANK,
38
+ inj_source=InjectionSource.HIP_ALS
39
+ ), 1)
40
+ except Exception:
41
+ self.fail("Should have not failed")
38
42
 
39
43
  def test_edit_entire_table(self):
40
44
  self.hplc_controller.switch_sequence(sequence_name=DEFAULT_SEQUENCE)
41
- seq_table = SequenceTable(
42
- name=DEFAULT_SEQUENCE,
43
- rows=[
44
- SequenceEntry(
45
- vial_location=3,
46
- method="C:\\ChemStation\\1\\Methods\\General-Poroshell",
47
- num_inj=3,
48
- inj_vol=4,
49
- sample_name="Control",
50
- sample_type=SampleType.CONTROL,
51
- inj_source=InjectionSource.MANUAL
52
- ),
53
- SequenceEntry(
54
- vial_location=1,
55
- method="C:\\ChemStation\\1\\Methods\\General-Poroshell",
56
- num_inj=1,
57
- inj_vol=1,
58
- sample_name="Sample",
59
- sample_type=SampleType.SAMPLE,
60
- inj_source=InjectionSource.AS_METHOD
61
- ),
62
- SequenceEntry(
63
- vial_location=10,
64
- method="C:\\ChemStation\\1\\Methods\\General-Poroshell",
65
- num_inj=3,
66
- inj_vol=4,
67
- sample_name="Blank",
68
- sample_type=SampleType.BLANK,
69
- inj_source=InjectionSource.HIP_ALS
70
- ),
71
- ]
72
- )
73
- self.hplc_controller.edit_sequence(seq_table)
45
+ try:
46
+ seq_table = SequenceTable(
47
+ name=DEFAULT_SEQUENCE,
48
+ rows=[
49
+ SequenceEntry(
50
+ vial_location=TenColumn.ONE,
51
+ method=DEFAULT_METHOD,
52
+ num_inj=3,
53
+ inj_vol=4,
54
+ sample_name="Sampel1",
55
+ sample_type=SampleType.SAMPLE,
56
+ inj_source=InjectionSource.HIP_ALS
57
+ ),
58
+ SequenceEntry(
59
+ vial_location=TenColumn.TWO,
60
+ method=DEFAULT_METHOD,
61
+ num_inj=3,
62
+ inj_vol=4,
63
+ sample_name="Sampel2",
64
+ sample_type=SampleType.SAMPLE,
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")
74
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
114
+ )
115
+ ]
116
+ )
117
+ self.hplc_controller.edit_sequence(seq_table)
118
+ except Exception:
119
+ self.fail("Should have not occured")
75
120
 
76
- def test_run(self):
77
- # self.hplc_controller.switch_sequence(sequence_name=DEFAULT_SEQUENCE)
78
- seq_table = SequenceTable(
79
- name=DEFAULT_SEQUENCE,
80
- rows=[
81
- SequenceEntry(
82
- vial_location=1,
83
- method="C:\\ChemStation\\1\\Methods\\" + DEFAULT_METHOD,
84
- num_inj=1,
85
- inj_vol=1,
86
- sample_name="Test",
87
- sample_type=SampleType.BLANK
88
- ),
89
- SequenceEntry(
90
- vial_location=2,
91
- method="C:\\ChemStation\\1\\Methods\\" + DEFAULT_METHOD,
92
- num_inj=1,
93
- inj_vol=1,
94
- sample_name="Test2",
95
- sample_type=SampleType.BLANK
96
- ),
97
- ]
98
- )
99
- self.hplc_controller.edit_sequence(seq_table)
100
- self.hplc_controller.run_sequence(seq_table)
101
- chrom = self.hplc_controller.get_last_run_sequence_data()
102
- self.assertTrue(len(chrom) == 2)
121
+ def test_load(self):
122
+ try:
123
+ seq = self.hplc_controller.load_sequence()
124
+ self.assertTrue(len(seq.rows) > 0)
125
+ except Exception as e:
126
+ self.fail(f"Should have not expected: {e}")
.DS_Store DELETED
Binary file