pychemstation 0.5.13.dev8__py3-none-any.whl → 0.5.14__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/devices/injector.py +106 -0
- pychemstation/control/controllers/tables/method.py +13 -4
- pychemstation/control/controllers/tables/ms.py +21 -0
- pychemstation/control/controllers/tables/table.py +26 -17
- pychemstation/control/hplc.py +18 -3
- pychemstation/utils/injector_types.py +27 -7
- pychemstation/utils/method_types.py +3 -1
- pychemstation/utils/table_types.py +18 -0
- {pychemstation-0.5.13.dev8.dist-info → pychemstation-0.5.14.dist-info}/METADATA +1 -1
- {pychemstation-0.5.13.dev8.dist-info → pychemstation-0.5.14.dist-info}/RECORD +19 -17
- tests/constants.py +2 -2
- tests/test_comb.py +1 -1
- tests/test_comm.py +1 -1
- tests/test_inj.py +48 -6
- tests/test_method.py +22 -2
- tests/test_sequence.py +1 -2
- {pychemstation-0.5.13.dev8.dist-info → pychemstation-0.5.14.dist-info}/LICENSE +0 -0
- {pychemstation-0.5.13.dev8.dist-info → pychemstation-0.5.14.dist-info}/WHEEL +0 -0
- {pychemstation-0.5.13.dev8.dist-info → pychemstation-0.5.14.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,106 @@
|
|
1
|
+
from ....control.controllers import CommunicationController
|
2
|
+
from .device import DeviceController
|
3
|
+
from ....utils.injector_types import *
|
4
|
+
from ....utils.table_types import Table, RegisterFlag
|
5
|
+
|
6
|
+
|
7
|
+
class InjectorController(DeviceController):
|
8
|
+
|
9
|
+
def __init__(self, controller: CommunicationController, table: Table):
|
10
|
+
super().__init__(controller, table)
|
11
|
+
|
12
|
+
def get_row(self, row: int) -> InjectorFunction:
|
13
|
+
def return_tray_loc() -> Tray:
|
14
|
+
pass
|
15
|
+
|
16
|
+
function = self.get_text(row, RegisterFlag.FUNCTION)
|
17
|
+
if function == "Wait":
|
18
|
+
return Wait(duration=self.get_num(row, RegisterFlag.TIME))
|
19
|
+
elif function == "Inject":
|
20
|
+
return Inject()
|
21
|
+
elif function == "Draw":
|
22
|
+
is_source = SourceType(self.get_text(row, RegisterFlag.DRAW_SOURCE))
|
23
|
+
is_volume = Mode(self.get_text(row, RegisterFlag.DRAW_VOLUME))
|
24
|
+
return Draw(amount=self.get_num(row, RegisterFlag.DRAW_VOLUME_VALUE) if is_volume == Mode.SET else None,
|
25
|
+
source=return_tray_loc() if is_source == SourceType.SPECIFIC_LOCATION else None)
|
26
|
+
elif function == "Remote":
|
27
|
+
return Remote(command=RemoteCommand(self.get_text(row, RegisterFlag.REMOTE)),
|
28
|
+
duration=self.get_num(row, RegisterFlag.REMOTE_DUR))
|
29
|
+
|
30
|
+
def load(self) -> InjectorTable:
|
31
|
+
rows = self.get_num_rows()
|
32
|
+
if rows.is_ok():
|
33
|
+
return InjectorTable(functions=[self.get_row(i + 1) for i in range(rows.ok_value.num_response)])
|
34
|
+
|
35
|
+
def edit(self, injector_table: InjectorTable):
|
36
|
+
self.delete_table()
|
37
|
+
res = self.get_num_rows()
|
38
|
+
while not res.is_err():
|
39
|
+
self.delete_table()
|
40
|
+
res = self.get_num_rows()
|
41
|
+
|
42
|
+
self.new_table()
|
43
|
+
self.get_num_rows()
|
44
|
+
|
45
|
+
columns_added = set()
|
46
|
+
|
47
|
+
def add_table_val(col_name: RegisterFlag, val: Union[str, int, float]):
|
48
|
+
nonlocal columns_added
|
49
|
+
if col_name in columns_added:
|
50
|
+
if isinstance(val, str):
|
51
|
+
self.edit_row_text(col_name=col_name, val=val)
|
52
|
+
else:
|
53
|
+
self.edit_row_num(col_name=col_name, val=val)
|
54
|
+
else:
|
55
|
+
if isinstance(val, str):
|
56
|
+
self.add_new_col_text(col_name=col_name, val=val)
|
57
|
+
else:
|
58
|
+
self.add_new_col_num(col_name=col_name, val=val)
|
59
|
+
columns_added.add(col_name)
|
60
|
+
|
61
|
+
def add_inject(inject: Inject):
|
62
|
+
add_table_val(col_name=RegisterFlag.FUNCTION, val=inject.__class__.__name__)
|
63
|
+
|
64
|
+
def add_draw(draw: Draw):
|
65
|
+
add_table_val(col_name=RegisterFlag.FUNCTION, val=draw.__class__.__name__)
|
66
|
+
add_table_val(col_name=RegisterFlag.DRAW_SPEED, val=SourceType.DEFAULT.value)
|
67
|
+
add_table_val(col_name=RegisterFlag.DRAW_OFFSET, val=SourceType.DEFAULT.value)
|
68
|
+
|
69
|
+
if draw.amount:
|
70
|
+
add_table_val(col_name=RegisterFlag.DRAW_VOLUME, val=Mode.SET.value)
|
71
|
+
add_table_val(col_name=RegisterFlag.DRAW_VOLUME_VALUE, val=draw.amount)
|
72
|
+
else:
|
73
|
+
add_table_val(col_name=RegisterFlag.DRAW_VOLUME, val=Mode.DEFAULT.value)
|
74
|
+
|
75
|
+
if draw.source:
|
76
|
+
add_table_val(col_name=RegisterFlag.DRAW_SOURCE, val=SourceType.SPECIFIC_LOCATION.value)
|
77
|
+
add_table_val(col_name=RegisterFlag.DRAW_LOCATION_UNIT, val=1)
|
78
|
+
add_table_val(col_name=RegisterFlag.DRAW_LOCATION_TRAY, val=1)
|
79
|
+
add_table_val(col_name=RegisterFlag.DRAW_LOCATION_ROW, val=1)
|
80
|
+
add_table_val(col_name=RegisterFlag.DRAW_LOCATION_COLUMN, val=1)
|
81
|
+
else:
|
82
|
+
add_table_val(col_name=RegisterFlag.DRAW_SOURCE, val=SourceType.DEFAULT.value)
|
83
|
+
|
84
|
+
def add_wait(wait: Wait):
|
85
|
+
add_table_val(col_name=RegisterFlag.FUNCTION, val=wait.__class__.__name__)
|
86
|
+
add_table_val(col_name=RegisterFlag.TIME, val=wait.duration)
|
87
|
+
|
88
|
+
def add_remote(remote: Remote):
|
89
|
+
add_table_val(col_name=RegisterFlag.FUNCTION, val=remote.__class__.__name__)
|
90
|
+
add_table_val(col_name=RegisterFlag.REMOTE, val=remote.command.value)
|
91
|
+
add_table_val(col_name=RegisterFlag.REMOTE_DUR, val=remote.duration)
|
92
|
+
|
93
|
+
for i, function in enumerate(injector_table.functions):
|
94
|
+
self.add_row()
|
95
|
+
if isinstance(function, Inject):
|
96
|
+
add_inject(function)
|
97
|
+
elif isinstance(function, Draw):
|
98
|
+
add_draw(function)
|
99
|
+
elif isinstance(function, Wait):
|
100
|
+
add_wait(function)
|
101
|
+
elif isinstance(function, Remote):
|
102
|
+
add_remote(function)
|
103
|
+
self.download()
|
104
|
+
|
105
|
+
def download(self):
|
106
|
+
pass
|
@@ -4,6 +4,7 @@ import time
|
|
4
4
|
from xsdata.formats.dataclass.parsers import XmlParser
|
5
5
|
|
6
6
|
from .table import TableController
|
7
|
+
from ..devices.injector import InjectorController
|
7
8
|
from ....control.controllers import CommunicationController
|
8
9
|
from ....generated import PumpMethod, DadMethod, SolventElement
|
9
10
|
from ....utils.chromatogram import TIME_FORMAT, AgilentChannelChromatogramData
|
@@ -17,7 +18,13 @@ class MethodController(TableController):
|
|
17
18
|
Class containing method related logic
|
18
19
|
"""
|
19
20
|
|
20
|
-
def __init__(self, controller: CommunicationController,
|
21
|
+
def __init__(self, controller: CommunicationController,
|
22
|
+
src: str,
|
23
|
+
data_dir: str,
|
24
|
+
table: Table,
|
25
|
+
offline: bool,
|
26
|
+
injector_controller: InjectorController):
|
27
|
+
self.injector_controller = injector_controller
|
21
28
|
super().__init__(controller, src, data_dir, table, offline=offline)
|
22
29
|
|
23
30
|
def check(self) -> str:
|
@@ -310,8 +317,6 @@ class MethodController(TableController):
|
|
310
317
|
|
311
318
|
:param experiment_name: Name of the experiment
|
312
319
|
"""
|
313
|
-
if not self.table_state:
|
314
|
-
self.table_state = self.load()
|
315
320
|
|
316
321
|
folder_name = ""
|
317
322
|
hplc_is_running = False
|
@@ -331,13 +336,17 @@ class MethodController(TableController):
|
|
331
336
|
self.data_files.append(os.path.join(self.data_dir, folder_name))
|
332
337
|
|
333
338
|
if stall_while_running:
|
339
|
+
|
340
|
+
if not self.table_state:
|
341
|
+
self.table_state = self.load()
|
342
|
+
|
334
343
|
run_completed = self.check_hplc_done_running(method=self.table_state)
|
335
344
|
if run_completed.is_ok():
|
336
345
|
self.data_files[-1] = run_completed.ok_value
|
337
346
|
else:
|
338
347
|
raise RuntimeError("Run error has occurred.")
|
339
348
|
else:
|
340
|
-
self.data_files[-1]
|
349
|
+
self.data_files[-1] = self.fuzzy_match_most_recent_folder(folder_name).ok_value
|
341
350
|
|
342
351
|
def retrieve_recent_data_files(self) -> str:
|
343
352
|
return self.data_files[-1]
|
@@ -0,0 +1,21 @@
|
|
1
|
+
from typing import Union
|
2
|
+
|
3
|
+
from ....control.controllers import CommunicationController
|
4
|
+
from ....control.controllers.tables.table import TableController
|
5
|
+
from ....utils.chromatogram import AgilentChannelChromatogramData
|
6
|
+
from ....utils.table_types import Table
|
7
|
+
|
8
|
+
|
9
|
+
class MassSpecController(TableController):
|
10
|
+
|
11
|
+
def __init__(self, controller: CommunicationController, src: str, data_dir: str, table: Table):
|
12
|
+
super().__init__(controller, src, data_dir, table)
|
13
|
+
|
14
|
+
def get_row(self, row: int):
|
15
|
+
pass
|
16
|
+
|
17
|
+
def retrieve_recent_data_files(self):
|
18
|
+
pass
|
19
|
+
|
20
|
+
def get_data(self) -> Union[list[AgilentChannelChromatogramData], AgilentChannelChromatogramData]:
|
21
|
+
pass
|
@@ -12,7 +12,6 @@ from typing import Union, Optional
|
|
12
12
|
import numpy as np
|
13
13
|
import polling
|
14
14
|
import rainbow as rb
|
15
|
-
from rainbow import DataFile
|
16
15
|
from result import Result, Ok, Err
|
17
16
|
|
18
17
|
from ....control.controllers.comm import CommunicationController
|
@@ -43,6 +42,9 @@ class TableController(abc.ABC):
|
|
43
42
|
self.table_state: Optional[TableType] = None
|
44
43
|
|
45
44
|
if not offline:
|
45
|
+
# Initialize row counter for table operations
|
46
|
+
self.send('Local Rows')
|
47
|
+
|
46
48
|
if os.path.isdir(src):
|
47
49
|
self.src: str = src
|
48
50
|
else:
|
@@ -53,24 +55,31 @@ class TableController(abc.ABC):
|
|
53
55
|
else:
|
54
56
|
raise FileNotFoundError(f"dir: {data_dir} not found.")
|
55
57
|
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
58
|
+
self.spectra: dict[str, Optional[AgilentHPLCChromatogram]] = {
|
59
|
+
"A": AgilentHPLCChromatogram(self.data_dir),
|
60
|
+
"B": AgilentHPLCChromatogram(self.data_dir),
|
61
|
+
"C": AgilentHPLCChromatogram(self.data_dir),
|
62
|
+
"D": AgilentHPLCChromatogram(self.data_dir),
|
63
|
+
"E": AgilentHPLCChromatogram(self.data_dir),
|
64
|
+
"F": AgilentHPLCChromatogram(self.data_dir),
|
65
|
+
"G": AgilentHPLCChromatogram(self.data_dir),
|
66
|
+
"H": AgilentHPLCChromatogram(self.data_dir),
|
67
|
+
}
|
68
|
+
else:
|
69
|
+
self.spectra: dict[str, Optional[AgilentHPLCChromatogram]] = {
|
70
|
+
"A": AgilentHPLCChromatogram(),
|
71
|
+
"B": AgilentHPLCChromatogram(),
|
72
|
+
"C": AgilentHPLCChromatogram(),
|
73
|
+
"D": AgilentHPLCChromatogram(),
|
74
|
+
"E": AgilentHPLCChromatogram(),
|
75
|
+
"F": AgilentHPLCChromatogram(),
|
76
|
+
"G": AgilentHPLCChromatogram(),
|
77
|
+
"H": AgilentHPLCChromatogram(),
|
78
|
+
}
|
67
79
|
self.data_files: Union[list[SequenceDataFiles], list[str]] = []
|
68
80
|
|
69
81
|
self.uv = None
|
70
82
|
|
71
|
-
# Initialize row counter for table operations
|
72
|
-
self.send('Local Rows')
|
73
|
-
|
74
83
|
def receive(self) -> Result[Response, str]:
|
75
84
|
for _ in range(10):
|
76
85
|
try:
|
@@ -96,7 +105,7 @@ class TableController(abc.ABC):
|
|
96
105
|
"""
|
97
106
|
self.send(Command.SLEEP_CMD.value.format(seconds=seconds))
|
98
107
|
|
99
|
-
def get_num(self, row: int, col_name: RegisterFlag) -> float:
|
108
|
+
def get_num(self, row: int, col_name: RegisterFlag) -> Union[int, float]:
|
100
109
|
return self.controller.get_num_val(TableOperation.GET_ROW_VAL.value.format(register=self.table.register,
|
101
110
|
table_name=self.table.name,
|
102
111
|
row=row,
|
@@ -279,7 +288,7 @@ class TableController(abc.ABC):
|
|
279
288
|
pass
|
280
289
|
|
281
290
|
def get_uv_spectrum(self, path: str):
|
282
|
-
data_uv
|
291
|
+
data_uv = rb.agilent.chemstation.parse_file(os.path.join(path, "DAD1.UV"))
|
283
292
|
zipped_data = zip(data_uv.ylabels, data_uv.data)
|
284
293
|
self.uv = {str(w_a[0]): ChromData(x=data_uv.xlabels, y=w_a[1]) for w_a in zipped_data}
|
285
294
|
|
pychemstation/control/hplc.py
CHANGED
@@ -6,8 +6,10 @@ Authors: Lucy Hao
|
|
6
6
|
|
7
7
|
from typing import Union, Optional
|
8
8
|
|
9
|
+
from .controllers.devices.injector import InjectorController
|
9
10
|
from ..control.controllers import MethodController, SequenceController, CommunicationController
|
10
11
|
from ..utils.chromatogram import AgilentChannelChromatogramData
|
12
|
+
from ..utils.injector_types import InjectorTable
|
11
13
|
from ..utils.macro import Command, HPLCRunningStatus, HPLCAvailStatus, HPLCErrorStatus, Response
|
12
14
|
from ..utils.method_types import MethodDetails
|
13
15
|
from ..utils.sequence_types import SequenceTable, SequenceEntry
|
@@ -27,8 +29,13 @@ class HPLCController:
|
|
27
29
|
)
|
28
30
|
|
29
31
|
INJECTOR_TABLE = Table(
|
30
|
-
register="
|
31
|
-
name="
|
32
|
+
register="RCWLS1Pretreatment[1]",
|
33
|
+
name="InstructionTable"
|
34
|
+
)
|
35
|
+
|
36
|
+
MSD_TABLE = Table(
|
37
|
+
register="MSACQINFO[1]",
|
38
|
+
name="SprayChamber"
|
32
39
|
)
|
33
40
|
|
34
41
|
def __init__(self,
|
@@ -48,7 +55,9 @@ class HPLCController:
|
|
48
55
|
src=method_dir,
|
49
56
|
data_dir=data_dir,
|
50
57
|
table=self.METHOD_TIMETABLE,
|
51
|
-
offline=offline
|
58
|
+
offline=offline,
|
59
|
+
injector_controller=InjectorController(controller=self.comm,
|
60
|
+
table=self.INJECTOR_TABLE))
|
52
61
|
self.sequence_controller = SequenceController(controller=self.comm,
|
53
62
|
src=sequence_dir,
|
54
63
|
data_dir=data_dir,
|
@@ -118,6 +127,9 @@ class HPLCController:
|
|
118
127
|
"""
|
119
128
|
self.sequence_controller.run(stall_while_running=stall_while_running)
|
120
129
|
|
130
|
+
def edit_injector_program(self, injector_table: InjectorTable):
|
131
|
+
self.method_controller.injector_controller.edit(injector_table=injector_table)
|
132
|
+
|
121
133
|
def edit_method(self, updated_method: MethodDetails, save: bool = False):
|
122
134
|
"""Updated the currently loaded method in ChemStation with provided values.
|
123
135
|
|
@@ -176,6 +188,9 @@ class HPLCController:
|
|
176
188
|
"""
|
177
189
|
return self.method_controller.check()
|
178
190
|
|
191
|
+
def load_injector_program(self) -> InjectorTable:
|
192
|
+
return self.method_controller.injector_controller.load()
|
193
|
+
|
179
194
|
def load_method(self) -> MethodDetails:
|
180
195
|
"""
|
181
196
|
Returns all details of the currently loaded method, including its timetable.
|
@@ -1,20 +1,29 @@
|
|
1
1
|
from dataclasses import dataclass
|
2
|
-
from
|
2
|
+
from enum import Enum
|
3
|
+
from typing import Union, Optional
|
3
4
|
|
4
5
|
from pychemstation.utils.tray_types import Tray
|
5
6
|
|
6
7
|
|
8
|
+
class SourceType(Enum):
|
9
|
+
DEFAULT = "ActualPosition"
|
10
|
+
SPECIFIC_LOCATION = "ActualPositionPlusLocation"
|
11
|
+
|
12
|
+
|
13
|
+
class Mode(Enum):
|
14
|
+
DEFAULT = "Default"
|
15
|
+
SET = "Set"
|
16
|
+
|
17
|
+
|
7
18
|
@dataclass
|
8
19
|
class Draw:
|
9
|
-
amount: float
|
10
|
-
source: Tray
|
11
|
-
speed: Any
|
12
|
-
offset: Any
|
20
|
+
amount: Optional[float] = None
|
21
|
+
source: Optional[Tray] = None
|
13
22
|
|
14
23
|
|
15
24
|
@dataclass
|
16
25
|
class Wait:
|
17
|
-
|
26
|
+
duration: int
|
18
27
|
|
19
28
|
|
20
29
|
@dataclass
|
@@ -22,7 +31,18 @@ class Inject:
|
|
22
31
|
pass
|
23
32
|
|
24
33
|
|
25
|
-
|
34
|
+
class RemoteCommand(Enum):
|
35
|
+
START = "START"
|
36
|
+
PREPARE = "PREPARE"
|
37
|
+
|
38
|
+
|
39
|
+
@dataclass
|
40
|
+
class Remote:
|
41
|
+
command: RemoteCommand
|
42
|
+
duration: int
|
43
|
+
|
44
|
+
|
45
|
+
InjectorFunction = Union[Draw, Wait, Inject, Remote]
|
26
46
|
|
27
47
|
|
28
48
|
@dataclass
|
@@ -4,6 +4,7 @@ from dataclasses import dataclass
|
|
4
4
|
from enum import Enum
|
5
5
|
from typing import Union, Any, Optional
|
6
6
|
|
7
|
+
from .injector_types import InjectorTable
|
7
8
|
from .table_types import RegisterFlag
|
8
9
|
from ..generated import Signal
|
9
10
|
|
@@ -36,7 +37,7 @@ class TimeTableEntry:
|
|
36
37
|
|
37
38
|
@dataclass
|
38
39
|
class MethodDetails:
|
39
|
-
"""An Agilent Chemstation method, TODO is to add MS parameters
|
40
|
+
"""An Agilent Chemstation method, TODO is to add MS parameters, injector parameters
|
40
41
|
|
41
42
|
:attribute name: the name of the method, should be the same as the Chemstation method name.
|
42
43
|
:attribute timetable: list of entries in the method timetable
|
@@ -49,6 +50,7 @@ class MethodDetails:
|
|
49
50
|
name: str
|
50
51
|
params: HPLCMethodParams
|
51
52
|
timetable: list[TimeTableEntry]
|
53
|
+
injector_program: Optional[InjectorTable] = None
|
52
54
|
stop_time: Optional[int] = None
|
53
55
|
post_time: Optional[int] = None
|
54
56
|
dad_wavelengthes: Optional[list[Signal]] = None
|
@@ -65,6 +65,24 @@ class RegisterFlag(Enum):
|
|
65
65
|
SAMPLE_TYPE = "SampleType"
|
66
66
|
DATA_FILE = "DataFileName"
|
67
67
|
|
68
|
+
# for Injector Table
|
69
|
+
## Draw
|
70
|
+
DRAW_SOURCE = "DrawSource"
|
71
|
+
DRAW_VOLUME = "DrawVolume_Mode"
|
72
|
+
DRAW_SPEED = "DrawSpeed_Mode"
|
73
|
+
DRAW_OFFSET = "DrawOffset_Mode"
|
74
|
+
DRAW_VOLUME_VALUE = "DrawVolume_Value"
|
75
|
+
DRAW_LOCATION_TRAY = "DrawLocationPlus_Tray"
|
76
|
+
DRAW_LOCATION_UNIT = "DrawLocationPlus_Unit"
|
77
|
+
DRAW_LOCATION_ROW = "DrawLocationPlus_Row"
|
78
|
+
DRAW_LOCATION_COLUMN = "DrawLocationPlus_Column"
|
79
|
+
## Inject
|
80
|
+
## Wait
|
81
|
+
## Remote
|
82
|
+
REMOTE = "RemoteLine"
|
83
|
+
REMOTE_DUR = "RemoteDuration"
|
84
|
+
|
85
|
+
|
68
86
|
|
69
87
|
@dataclass
|
70
88
|
class Table:
|
@@ -5,7 +5,7 @@ pychemstation/analysis/spec_utils.py,sha256=UOo9hJR3evJfmaohEEsyb7aq6X996ofuUfu-
|
|
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=IdHH4Yho5cJDDBLcc6k0XKDFDecghaY8NaA4dIU7KB8,9898
|
9
9
|
pychemstation/control/controllers/__init__.py,sha256=EM6LBNSTJqYVatmnvPq0P-S3q0POA88c-y64zL79I_I,252
|
10
10
|
pychemstation/control/controllers/comm.py,sha256=IU4I_Q42VNCNUlVi93MxCmw2EBY9hiBDkU9FxubKg3c,7441
|
11
11
|
pychemstation/control/controllers/method.py,sha256=XUclB7lQ_SIkquR58MBmmi9drHIPEq9AR8VprTLenvI,15503
|
@@ -14,11 +14,13 @@ pychemstation/control/controllers/table_controller.py,sha256=70ovnIjLKkJborS1ztk
|
|
14
14
|
pychemstation/control/controllers/devices/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
15
15
|
pychemstation/control/controllers/devices/column.py,sha256=SCpCnVFZFUM9LM51MbWkVcBRayN3WFxy7lz9gs2PYeY,348
|
16
16
|
pychemstation/control/controllers/devices/device.py,sha256=SF1JK93FjmACnYrlKvldX3gEeA21qnXZegeNhc9QJGQ,738
|
17
|
+
pychemstation/control/controllers/devices/injector.py,sha256=nm7fDu6HI3LHHpod8Bn6sCEnVnzojBxqhNhhzfaL-zk,4712
|
17
18
|
pychemstation/control/controllers/devices/pump.py,sha256=DJQh4lNXEraeC1CWrsKmsITOjuYlRI3tih_XRB3F1hg,1404
|
18
19
|
pychemstation/control/controllers/tables/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
19
|
-
pychemstation/control/controllers/tables/method.py,sha256=
|
20
|
+
pychemstation/control/controllers/tables/method.py,sha256=3GdAQ6Cwf20QL3v7eMkwNieWbJdtr9GN12USbSVl_iE,16426
|
21
|
+
pychemstation/control/controllers/tables/ms.py,sha256=JFD-tOhu8uRyKdl-E3-neRssii8MNqVRIlsrnFhNY_M,682
|
20
22
|
pychemstation/control/controllers/tables/sequence.py,sha256=vqwJeV38YWdFnaDXvZVOGYl-UCV9lmMbh8Fj5kQ3mqY,8815
|
21
|
-
pychemstation/control/controllers/tables/table.py,sha256=
|
23
|
+
pychemstation/control/controllers/tables/table.py,sha256=ipscw8kimreJR95g4DLkC9dBB-23kuPstsWtb14P1bU,12457
|
22
24
|
pychemstation/control/table/__init__.py,sha256=RgMN4uIWHdNUHpGRBWdzmzAbk7XEKl6Y-qtqWCxzSZU,124
|
23
25
|
pychemstation/control/table/method.py,sha256=THVoGomSXff_CTU3eAYme0BYwkPzab5UgZKsiZ29QSk,12196
|
24
26
|
pychemstation/control/table/sequence.py,sha256=Eri52AnbE3BGthfrRSvYKYciquUzvHKo0lYUTySYYE8,10542
|
@@ -28,23 +30,23 @@ pychemstation/generated/dad_method.py,sha256=0W8Z5WDtF5jpIcudMqb7XrkTnR2EGg_QOCs
|
|
28
30
|
pychemstation/generated/pump_method.py,sha256=sUhE2Oo00nzVcoONtq3EMWsN4wLSryXbG8f3EeViWKg,12174
|
29
31
|
pychemstation/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
30
32
|
pychemstation/utils/chromatogram.py,sha256=-q3_hL9GTyi4C95os7IwAiOrkTM4EXIiigm-nW9pFmM,3221
|
31
|
-
pychemstation/utils/injector_types.py,sha256=
|
33
|
+
pychemstation/utils/injector_types.py,sha256=DESgRec3FiMPE_h6yRAXyIF6VGJ_isFX9eFAjVZF-yI,756
|
32
34
|
pychemstation/utils/macro.py,sha256=OCQRRC-f46RlhenZfe7ldSgxBhzcZ5JlW3Ej-9OfeSI,2847
|
33
|
-
pychemstation/utils/method_types.py,sha256=
|
35
|
+
pychemstation/utils/method_types.py,sha256=3qxKeREl_97GnQ74qcA3kxibnvWI4ueb-6XZlxcV2Hg,1632
|
34
36
|
pychemstation/utils/parsing.py,sha256=bnFIsZZwFy9NKzVUf517yN-ogzQbm0hp_aho3KUD6Is,9317
|
35
37
|
pychemstation/utils/pump_types.py,sha256=HWQHxscGn19NTrfYBwQRCO2VcYfwyko7YfBO5uDhEm4,93
|
36
38
|
pychemstation/utils/sequence_types.py,sha256=4cNpmRdPLN5oGN7ozHgT21E65aBO8vV3ZcRXMOQ3EA8,1084
|
37
|
-
pychemstation/utils/table_types.py,sha256=
|
39
|
+
pychemstation/utils/table_types.py,sha256=R9eNIItASX1yd6wrsRu-F_Q88m-es_2UIySEuNNmizs,3074
|
38
40
|
pychemstation/utils/tray_types.py,sha256=MaHN36rhcEI5mAY95VU8hfP9HhAlngQvMYq-2oyC0hc,764
|
39
41
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
40
|
-
tests/constants.py,sha256=
|
41
|
-
tests/test_comb.py,sha256=
|
42
|
-
tests/test_comm.py,sha256=
|
43
|
-
tests/test_inj.py,sha256=
|
44
|
-
tests/test_method.py,sha256=
|
45
|
-
tests/test_sequence.py,sha256=
|
46
|
-
pychemstation-0.5.
|
47
|
-
pychemstation-0.5.
|
48
|
-
pychemstation-0.5.
|
49
|
-
pychemstation-0.5.
|
50
|
-
pychemstation-0.5.
|
42
|
+
tests/constants.py,sha256=55DOLpylLt12mb_gSgzEo-EYynwTmI2uH7PcrTM6Iq0,2455
|
43
|
+
tests/test_comb.py,sha256=TS-CbtiPbntL4u6E1gSZ6xquNp6cQxIFdJqUr2ak7PA,5515
|
44
|
+
tests/test_comm.py,sha256=iwl-Ey-xoytXmlNrjG84pDm82Ry_QUX6wY4gmVh4NDc,2516
|
45
|
+
tests/test_inj.py,sha256=5cV0LuLGUiV87u35uw41jinTA0W3rzLDS8mEqsX89kw,2710
|
46
|
+
tests/test_method.py,sha256=hrxCsLKhC_3PPL0As-deEucbmXNBYsS6qVb89iC7brg,3215
|
47
|
+
tests/test_sequence.py,sha256=vs5-dqkItRds_tPM2-N6MNJ37FB0nLRFaDzBV8d42i8,4880
|
48
|
+
pychemstation-0.5.14.dist-info/LICENSE,sha256=9bdF75gIf1MecZ7oymqWgJREVz7McXPG-mjqrTmzzD8,18658
|
49
|
+
pychemstation-0.5.14.dist-info/METADATA,sha256=I1AWqOUHHQx1pkAHt07af7yabN9q8xANT-Sxdt3LxTI,4371
|
50
|
+
pychemstation-0.5.14.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
|
51
|
+
pychemstation-0.5.14.dist-info/top_level.txt,sha256=zXfKu_4nYWwPHo3OsuhshMNC3SPkcoTGCyODjURaghY,20
|
52
|
+
pychemstation-0.5.14.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 = "hplc_testing"
|
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,7 +20,7 @@ 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\\
|
23
|
+
DATA_DIR_254 = "D:\\Chemstation\\1\\Data\\LC BO\\"
|
24
24
|
SEQUENCE_DIR_254 = "C:\\1\\Sequence\\"
|
25
25
|
|
26
26
|
HEIN_LAB_CONSTANTS_254 = [DEFAULT_COMMAND_PATH_254,
|
tests/test_comb.py
CHANGED
tests/test_comm.py
CHANGED
tests/test_inj.py
CHANGED
@@ -2,12 +2,14 @@ import os
|
|
2
2
|
import unittest
|
3
3
|
|
4
4
|
from pychemstation.control import HPLCController
|
5
|
+
from pychemstation.utils.injector_types import *
|
6
|
+
from pychemstation.utils.tray_types import FiftyFourVialPlate, Plate, Letter, Num
|
5
7
|
from tests.constants import *
|
6
8
|
|
7
9
|
|
8
10
|
class TestInj(unittest.TestCase):
|
9
11
|
def setUp(self):
|
10
|
-
path_constants = room(
|
12
|
+
path_constants = room(242)
|
11
13
|
for path in path_constants:
|
12
14
|
if not os.path.exists(path):
|
13
15
|
self.fail(
|
@@ -21,18 +23,58 @@ class TestInj(unittest.TestCase):
|
|
21
23
|
def test_load_inj(self):
|
22
24
|
self.hplc_controller.switch_method(DEFAULT_METHOD)
|
23
25
|
try:
|
24
|
-
|
25
|
-
self.assertTrue(gp_mtd.first_row.organic_modifier == 5)
|
26
|
+
self.hplc_controller.load_injector_program()
|
26
27
|
except Exception as e:
|
27
28
|
self.fail(f"Should have not failed, {e}")
|
28
29
|
|
29
30
|
def test_edit_inj(self):
|
30
|
-
self.hplc_controller.
|
31
|
-
|
31
|
+
self.hplc_controller.switch_method(DEFAULT_METHOD)
|
32
|
+
try:
|
33
|
+
injector_program = InjectorTable(
|
34
|
+
functions=[
|
35
|
+
Draw(
|
36
|
+
amount=0.3,
|
37
|
+
source=FiftyFourVialPlate(
|
38
|
+
plate=Plate.ONE,
|
39
|
+
letter=Letter.A,
|
40
|
+
num=Num.EIGHT)),
|
41
|
+
Remote(
|
42
|
+
command=RemoteCommand.PREPARE,
|
43
|
+
duration=10,
|
44
|
+
),
|
45
|
+
Wait(
|
46
|
+
duration=2
|
47
|
+
),
|
48
|
+
Inject(
|
49
|
+
|
50
|
+
)
|
51
|
+
]
|
52
|
+
)
|
53
|
+
self.hplc_controller.edit_injector_program(injector_program)
|
54
|
+
except Exception as e:
|
55
|
+
self.fail(f"Should have not failed: {e}")
|
56
|
+
|
57
|
+
def test_edit_inj_def(self):
|
58
|
+
self.hplc_controller.switch_method(DEFAULT_METHOD)
|
32
59
|
try:
|
33
|
-
|
60
|
+
injector_program = InjectorTable(
|
61
|
+
functions=[
|
62
|
+
Draw(
|
63
|
+
amount=0.3,
|
64
|
+
source=FiftyFourVialPlate(
|
65
|
+
plate=Plate.ONE,
|
66
|
+
letter=Letter.A,
|
67
|
+
num=Num.EIGHT)),
|
68
|
+
Inject(
|
69
|
+
|
70
|
+
)
|
71
|
+
]
|
72
|
+
)
|
73
|
+
|
74
|
+
self.hplc_controller.edit_injector_program(injector_program)
|
34
75
|
except Exception as e:
|
35
76
|
self.fail(f"Should have not failed: {e}")
|
36
77
|
|
78
|
+
|
37
79
|
if __name__ == '__main__':
|
38
80
|
unittest.main()
|
tests/test_method.py
CHANGED
@@ -7,7 +7,7 @@ from tests.constants import *
|
|
7
7
|
|
8
8
|
class TestMethod(unittest.TestCase):
|
9
9
|
def setUp(self):
|
10
|
-
path_constants = room(
|
10
|
+
path_constants = room(242)
|
11
11
|
for path in path_constants:
|
12
12
|
if not os.path.exists(path):
|
13
13
|
self.fail(
|
@@ -56,6 +56,26 @@ class TestMethod(unittest.TestCase):
|
|
56
56
|
except Exception as e:
|
57
57
|
self.fail(f"Should have not failed: {e}")
|
58
58
|
|
59
|
+
def test_run_10_times(self):
|
60
|
+
self.hplc_controller.method_controller.switch(DEFAULT_METHOD)
|
61
|
+
rand_method = MethodDetails(
|
62
|
+
name=DEFAULT_METHOD,
|
63
|
+
params=HPLCMethodParams(
|
64
|
+
organic_modifier=5,
|
65
|
+
flow=0.65),
|
66
|
+
timetable=[TimeTableEntry(
|
67
|
+
start_time=0.50,
|
68
|
+
organic_modifer=99,
|
69
|
+
flow=0.65)],
|
70
|
+
stop_time=1,
|
71
|
+
post_time=0)
|
72
|
+
self.hplc_controller.edit_method(rand_method, save=True)
|
73
|
+
try:
|
74
|
+
for _ in range(10):
|
75
|
+
self.hplc_controller.run_method(experiment_name="limiting_testing")
|
76
|
+
except Exception as e:
|
77
|
+
self.fail(f"Should have not failed: {e}")
|
78
|
+
|
59
79
|
|
60
80
|
if __name__ == '__main__':
|
61
|
-
unittest.main()
|
81
|
+
unittest.main()
|
tests/test_sequence.py
CHANGED
@@ -2,13 +2,12 @@ import os
|
|
2
2
|
import unittest
|
3
3
|
|
4
4
|
from pychemstation.control import HPLCController
|
5
|
-
from pychemstation.utils.sequence_types import *
|
6
5
|
from tests.constants import *
|
7
6
|
|
8
7
|
|
9
8
|
class TestSequence(unittest.TestCase):
|
10
9
|
def setUp(self):
|
11
|
-
path_constants = room(
|
10
|
+
path_constants = room(242)
|
12
11
|
for path in path_constants:
|
13
12
|
if not os.path.exists(path):
|
14
13
|
self.fail(
|
File without changes
|
File without changes
|
File without changes
|