pychemstation 0.4.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.
Files changed (109) hide show
  1. ag_hplc_macro/__init__.py +3 -0
  2. ag_hplc_macro/analysis/__init__.py +1 -0
  3. ag_hplc_macro/analysis/base_spectrum.py +509 -0
  4. ag_hplc_macro/analysis/spec_utils.py +304 -0
  5. ag_hplc_macro/analysis/utils.py +63 -0
  6. ag_hplc_macro/control/__init__.py +5 -0
  7. ag_hplc_macro/control/chromatogram.py +128 -0
  8. ag_hplc_macro/control/hplc.py +673 -0
  9. ag_hplc_macro/generated/__init__.py +56 -0
  10. ag_hplc_macro/generated/dad_method.py +367 -0
  11. ag_hplc_macro/generated/pump_method.py +519 -0
  12. ag_hplc_macro/utils/__init__.py +2 -0
  13. ag_hplc_macro/utils/chemstation.py +290 -0
  14. ag_hplc_macro/utils/constants.py +15 -0
  15. ag_hplc_macro/utils/hplc_param_types.py +185 -0
  16. hein-analytical-control/__init__.py +3 -0
  17. hein-analytical-control/analysis/__init__.py +1 -0
  18. hein-analytical-control/analysis/base_spectrum.py +509 -0
  19. hein-analytical-control/analysis/spec_utils.py +304 -0
  20. hein-analytical-control/analysis/utils.py +63 -0
  21. hein-analytical-control/devices/Agilent/__init__.py +3 -0
  22. hein-analytical-control/devices/Agilent/chemstation.py +290 -0
  23. hein-analytical-control/devices/Agilent/chromatogram.py +129 -0
  24. hein-analytical-control/devices/Agilent/hplc.py +436 -0
  25. hein-analytical-control/devices/Agilent/hplc_param_types.py +141 -0
  26. hein-analytical-control/devices/Magritek/Spinsolve/__init__.py +0 -0
  27. hein-analytical-control/devices/Magritek/Spinsolve/commands.py +495 -0
  28. hein-analytical-control/devices/Magritek/Spinsolve/spectrum.py +822 -0
  29. hein-analytical-control/devices/Magritek/Spinsolve/spinsolve.py +425 -0
  30. hein-analytical-control/devices/Magritek/Spinsolve/utils/__init__.py +5 -0
  31. hein-analytical-control/devices/Magritek/Spinsolve/utils/connection.py +168 -0
  32. hein-analytical-control/devices/Magritek/Spinsolve/utils/constants.py +8 -0
  33. hein-analytical-control/devices/Magritek/Spinsolve/utils/exceptions.py +25 -0
  34. hein-analytical-control/devices/Magritek/Spinsolve/utils/parser.py +340 -0
  35. hein-analytical-control/devices/Magritek/Spinsolve/utils/shimming.py +55 -0
  36. hein-analytical-control/devices/Magritek/Spinsolve/utils/spinsolve_logging.py +43 -0
  37. hein-analytical-control/devices/Magritek/__init__.py +0 -0
  38. hein-analytical-control/devices/OceanOptics/IR/NIRQuest512.py +90 -0
  39. hein-analytical-control/devices/OceanOptics/IR/__init__.py +0 -0
  40. hein-analytical-control/devices/OceanOptics/IR/ir_spectrum.py +191 -0
  41. hein-analytical-control/devices/OceanOptics/Raman/__init__.py +0 -0
  42. hein-analytical-control/devices/OceanOptics/Raman/raman_control.py +46 -0
  43. hein-analytical-control/devices/OceanOptics/Raman/raman_spectrum.py +148 -0
  44. hein-analytical-control/devices/OceanOptics/UV/QEPro2192.py +90 -0
  45. hein-analytical-control/devices/OceanOptics/UV/__init__.py +0 -0
  46. hein-analytical-control/devices/OceanOptics/UV/uv_spectrum.py +227 -0
  47. hein-analytical-control/devices/OceanOptics/__init__.py +0 -0
  48. hein-analytical-control/devices/OceanOptics/oceanoptics.py +115 -0
  49. hein-analytical-control/devices/__init__.py +15 -0
  50. hein-analytical-control/generated/__init__.py +56 -0
  51. hein-analytical-control/generated/dad_method.py +367 -0
  52. hein-analytical-control/generated/pump_method.py +519 -0
  53. hein_analytical_control/__init__.py +3 -0
  54. hein_analytical_control/analysis/__init__.py +1 -0
  55. hein_analytical_control/analysis/base_spectrum.py +509 -0
  56. hein_analytical_control/analysis/spec_utils.py +304 -0
  57. hein_analytical_control/analysis/utils.py +63 -0
  58. hein_analytical_control/devices/Agilent/__init__.py +3 -0
  59. hein_analytical_control/devices/Agilent/chemstation.py +290 -0
  60. hein_analytical_control/devices/Agilent/chromatogram.py +129 -0
  61. hein_analytical_control/devices/Agilent/hplc.py +436 -0
  62. hein_analytical_control/devices/Agilent/hplc_param_types.py +141 -0
  63. hein_analytical_control/devices/Magritek/Spinsolve/__init__.py +0 -0
  64. hein_analytical_control/devices/Magritek/Spinsolve/commands.py +495 -0
  65. hein_analytical_control/devices/Magritek/Spinsolve/spectrum.py +822 -0
  66. hein_analytical_control/devices/Magritek/Spinsolve/spinsolve.py +425 -0
  67. hein_analytical_control/devices/Magritek/Spinsolve/utils/__init__.py +5 -0
  68. hein_analytical_control/devices/Magritek/Spinsolve/utils/connection.py +168 -0
  69. hein_analytical_control/devices/Magritek/Spinsolve/utils/constants.py +8 -0
  70. hein_analytical_control/devices/Magritek/Spinsolve/utils/exceptions.py +25 -0
  71. hein_analytical_control/devices/Magritek/Spinsolve/utils/parser.py +340 -0
  72. hein_analytical_control/devices/Magritek/Spinsolve/utils/shimming.py +55 -0
  73. hein_analytical_control/devices/Magritek/Spinsolve/utils/spinsolve_logging.py +43 -0
  74. hein_analytical_control/devices/Magritek/__init__.py +0 -0
  75. hein_analytical_control/devices/OceanOptics/IR/NIRQuest512.py +90 -0
  76. hein_analytical_control/devices/OceanOptics/IR/__init__.py +0 -0
  77. hein_analytical_control/devices/OceanOptics/IR/ir_spectrum.py +191 -0
  78. hein_analytical_control/devices/OceanOptics/Raman/__init__.py +0 -0
  79. hein_analytical_control/devices/OceanOptics/Raman/raman_control.py +46 -0
  80. hein_analytical_control/devices/OceanOptics/Raman/raman_spectrum.py +148 -0
  81. hein_analytical_control/devices/OceanOptics/UV/QEPro2192.py +90 -0
  82. hein_analytical_control/devices/OceanOptics/UV/__init__.py +0 -0
  83. hein_analytical_control/devices/OceanOptics/UV/uv_spectrum.py +227 -0
  84. hein_analytical_control/devices/OceanOptics/__init__.py +0 -0
  85. hein_analytical_control/devices/OceanOptics/oceanoptics.py +115 -0
  86. hein_analytical_control/devices/__init__.py +15 -0
  87. hein_analytical_control/generated/__init__.py +56 -0
  88. hein_analytical_control/generated/dad_method.py +367 -0
  89. hein_analytical_control/generated/pump_method.py +519 -0
  90. pychemstation/__init__.py +3 -0
  91. pychemstation/analysis/__init__.py +1 -0
  92. pychemstation/analysis/base_spectrum.py +509 -0
  93. pychemstation/analysis/spec_utils.py +304 -0
  94. pychemstation/analysis/utils.py +63 -0
  95. pychemstation/control/__init__.py +5 -0
  96. pychemstation/control/chromatogram.py +128 -0
  97. pychemstation/control/hplc.py +673 -0
  98. pychemstation/generated/__init__.py +56 -0
  99. pychemstation/generated/dad_method.py +367 -0
  100. pychemstation/generated/pump_method.py +519 -0
  101. pychemstation/utils/__init__.py +2 -0
  102. pychemstation/utils/chemstation.py +290 -0
  103. pychemstation/utils/constants.py +15 -0
  104. pychemstation/utils/hplc_param_types.py +185 -0
  105. pychemstation-0.4.7.dev1.dist-info/LICENSE +395 -0
  106. pychemstation-0.4.7.dev1.dist-info/METADATA +102 -0
  107. pychemstation-0.4.7.dev1.dist-info/RECORD +109 -0
  108. pychemstation-0.4.7.dev1.dist-info/WHEEL +5 -0
  109. pychemstation-0.4.7.dev1.dist-info/top_level.txt +1 -0
@@ -0,0 +1,290 @@
1
+ #!/usr/bin/python
2
+ # coding: utf-8
3
+
4
+ """
5
+ File parser for Chemstation files (*.ch)
6
+ Basically a port of the matlab script at:
7
+ https://github.com/chemplexity/chromatography/blob/master/Development/File%20Conversion/ImportAgilentFID.m
8
+
9
+ This file is a standalone file to parse the binary files created by Chemstation
10
+
11
+ I use it for file with version 130, genereted by an Agilent LC.
12
+ """
13
+
14
+ import struct
15
+ from struct import unpack
16
+ import numpy as np
17
+
18
+ # Constants used for binary file parsing
19
+ ENDIAN = ">"
20
+ STRING = ENDIAN + "{}s"
21
+ UINT8 = ENDIAN + "B"
22
+ UINT16 = ENDIAN + "H"
23
+ INT16 = ENDIAN + "h"
24
+ INT32 = ENDIAN + "i"
25
+ UINT32 = ENDIAN + "I"
26
+
27
+
28
+ def fread(fid, nelements, dtype):
29
+
30
+ """Equivalent to Matlab fread function"""
31
+
32
+ if dtype is str:
33
+ dt = np.uint8 # WARNING: assuming 8-bit ASCII for np.str!
34
+ else:
35
+ dt = dtype
36
+
37
+ data_array = np.fromfile(fid, dt, nelements)
38
+ data_array.shape = (nelements, 1)
39
+
40
+ return data_array
41
+
42
+
43
+ def parse_utf16_string(file_, encoding="UTF16"):
44
+
45
+ """Parse a pascal type UTF16 encoded string from a binary file object"""
46
+
47
+ # First read the expected number of CHARACTERS
48
+ string_length = unpack(UINT8, file_.read(1))[0]
49
+ # Then read and decode
50
+ parsed = unpack(STRING.format(2 * string_length), file_.read(2 * string_length))
51
+ return parsed[0].decode(encoding)
52
+
53
+
54
+ class cached_property(object):
55
+
56
+ """A property that is only computed once per instance and then replaces
57
+ itself with an ordinary attribute. Deleting the attribute resets the
58
+ property.
59
+
60
+ https://github.com/bottlepy/bottle/commit/fa7733e075da0d790d809aa3d2f53071897e6f76
61
+ """
62
+
63
+ def __init__(self, func):
64
+ self.__doc__ = getattr(func, "__doc__")
65
+ self.func = func
66
+
67
+ def __get__(self, obj, cls):
68
+ if obj is None:
69
+ return self
70
+ value = obj.__dict__[self.func.__name__] = self.func(obj)
71
+ return value
72
+
73
+
74
+ class CHFile(object):
75
+
76
+ """Class that implementats the Agilent .ch file format version
77
+ 130. Warning: Not all aspects of the file header is understood,
78
+ so there may and probably is information that is not parsed. See
79
+ _parse_header_status for an overview of which parts of the header
80
+ is understood.
81
+
82
+ Attributes:
83
+ values (numpy.array): The internsity values (y-value) or the
84
+ spectrum. The unit for the values is given in `metadata['units']`
85
+
86
+ metadata (dict): The extracted metadata
87
+
88
+ filepath (str): The filepath this object was loaded from
89
+ """
90
+
91
+ # Fields is a table of name, offset and type. Types 'x-time' and 'utf16'
92
+ # are specially handled, the rest are format arguments for struct unpack
93
+ fields = (
94
+ ("sequence_line_or_injection", 252, UINT16),
95
+ ("injection_or_sequence_line", 256, UINT16),
96
+ ("data_offset", 264, UINT32),
97
+ ("start_time", 282, "x-time"),
98
+ ("end_time", 286, "x-time"),
99
+ ("version_string", 326, "utf16"),
100
+ ("description", 347, "utf16"),
101
+ ("sample", 858, "utf16"),
102
+ ("operator", 1880, "utf16"),
103
+ ("date", 2391, "utf16"),
104
+ ("inlet", 2492, "utf16"),
105
+ ("instrument", 2533, "utf16"),
106
+ ("method", 2574, "utf16"),
107
+ ("software version", 3601, "utf16"),
108
+ ("software name", 3089, "utf16"),
109
+ ("software revision", 3802, "utf16"),
110
+ ("zero", 4110, INT32),
111
+ ("units", 4172, "utf16"),
112
+ ("detector", 4213, "utf16"),
113
+ ("yscaling", 4732, ENDIAN + "d"),
114
+ )
115
+
116
+ # The start position of the data
117
+ # Get it from metadata['data_offset'] * 512
118
+ data_start = 6144
119
+
120
+ # The versions of the file format supported by this implementation
121
+ supported_versions = {130}
122
+
123
+ def __init__(self, filepath):
124
+
125
+ self.filepath = filepath
126
+ self.metadata = {}
127
+ with open(self.filepath, "rb") as file_:
128
+ self._parse_header(file_)
129
+ self.values = self._parse_data(file_)
130
+
131
+ def _parse_header(self, file_):
132
+
133
+ """Parse the header"""
134
+
135
+ # Parse and check version
136
+ length = unpack(UINT8, file_.read(1))[0]
137
+ parsed = unpack(STRING.format(length), file_.read(length))
138
+ version = int(parsed[0])
139
+ if version not in self.supported_versions:
140
+ raise ValueError("Unsupported file version {}".format(version))
141
+ self.metadata["magic_number_version"] = version
142
+
143
+ # Parse all metadata fields
144
+ for name, offset, type_ in self.fields:
145
+ file_.seek(offset)
146
+ if type_ == "utf16":
147
+ self.metadata[name] = parse_utf16_string(file_)
148
+ elif type_ == "x-time":
149
+ self.metadata[name] = unpack(UINT32, file_.read(4))[0] / 60000
150
+ else:
151
+ self.metadata[name] = unpack(type_, file_.read(struct.calcsize(type_)))[
152
+ 0
153
+ ]
154
+
155
+ def _parse_header_status(self):
156
+
157
+ """Print known and unknown parts of the header"""
158
+
159
+ file_ = open(self.filepath, "rb")
160
+
161
+ print("Header parsing status")
162
+ # Map positions to fields for all the known fields
163
+ knowns = {item[1]: item for item in self.fields}
164
+ # A couple of places has a \x01 byte before a string, these we simply
165
+ # skip
166
+ skips = {325, 3600}
167
+ # Jump to after the magic number version
168
+ file_.seek(4)
169
+
170
+ # Initialize variables for unknown bytes
171
+ unknown_start = None
172
+ unknown_bytes = b""
173
+ # While we have not yet reached the data
174
+ while file_.tell() < self.data_start:
175
+ current_position = file_.tell()
176
+ # Just continue on skip bytes
177
+ if current_position in skips:
178
+ file_.read(1)
179
+ continue
180
+
181
+ # If we know about a data field that starts at this point
182
+ if current_position in knowns:
183
+ # If we have collected unknown bytes, print them out and reset
184
+ if unknown_bytes != b"":
185
+ print(
186
+ "Unknown at", unknown_start, repr(unknown_bytes.rstrip(b"\x00"))
187
+ )
188
+ unknown_bytes = b""
189
+ unknown_start = None
190
+
191
+ # Print out the position, type, name and value of the known
192
+ # value
193
+ print("Known field at {: >4},".format(current_position), end=" ")
194
+ name, _, type_ = knowns[current_position]
195
+ if type_ == "x-time":
196
+ print(
197
+ 'x-time, "{: <19}'.format(name + '"'),
198
+ unpack(ENDIAN + "f", file_.read(4))[0] / 60000,
199
+ )
200
+ elif type_ == "utf16":
201
+ print(
202
+ ' utf16, "{: <19}'.format(name + '"'), parse_utf16_string(file_)
203
+ )
204
+ else:
205
+ size = struct.calcsize(type_)
206
+ print(
207
+ '{: >6}, "{: <19}'.format(type_, name + '"'),
208
+ unpack(type_, file_.read(size))[0],
209
+ )
210
+
211
+ # We do not know about a data field at this position If we have
212
+ # already collected 4 zero bytes, assume that we are done with
213
+ # this unkonw field, print and reset
214
+ else:
215
+ if unknown_bytes[-4:] == b"\x00\x00\x00\x00":
216
+ print(
217
+ "Unknown at", unknown_start, repr(unknown_bytes.rstrip(b"\x00"))
218
+ )
219
+ unknown_bytes = b""
220
+ unknown_start = None
221
+
222
+ # Read one byte and save it
223
+ one_byte = file_.read(1)
224
+ if unknown_bytes == b"":
225
+ # Only start a new collection of unknown bytes, if this
226
+ # byte is not a zero byte
227
+ if one_byte != b"\x00":
228
+ unknown_bytes = one_byte
229
+ unknown_start = file_.tell() - 1
230
+ else:
231
+ unknown_bytes += one_byte
232
+
233
+ file_.close()
234
+
235
+ def _parse_data(self, file_):
236
+
237
+ """Parse the data. Decompress the delta-encoded data, and scale them
238
+ with y-scaling"""
239
+
240
+ scaling = self.metadata["yscaling"]
241
+
242
+ # Go to the end of the file
243
+ file_.seek(0, 2)
244
+ stop = file_.tell()
245
+
246
+ # Go to the start point of the data
247
+ file_.seek(self.data_start)
248
+
249
+ signal = []
250
+
251
+ buff = [0, 0, 0, 0]
252
+
253
+ while file_.tell() < stop:
254
+
255
+ buff[0] = fread(file_, 1, INT16)[0][0]
256
+ buff[1] = buff[3]
257
+
258
+ if buff[0] << 12 == 0:
259
+ break
260
+
261
+ for i in range(buff[0] & 4095):
262
+
263
+ buff[2] = fread(file_, 1, INT16)[0][0]
264
+
265
+ if buff[2] != -32768:
266
+ buff[1] = buff[1] + buff[2]
267
+ else:
268
+ buff[1] = fread(file_, 1, INT32)[0][0]
269
+
270
+ signal.append(buff[1])
271
+
272
+ buff[3] = buff[1]
273
+
274
+ signal = np.array(signal)
275
+ signal = signal * scaling
276
+
277
+ return signal
278
+
279
+ @cached_property
280
+ def times(self):
281
+
282
+ """The time values (x-value) for the data set in minutes"""
283
+
284
+ return np.linspace(
285
+ self.metadata["start_time"], self.metadata["end_time"], len(self.values)
286
+ )
287
+
288
+
289
+ if __name__ == "__main__":
290
+ CHFile("lcdiag.reg")
@@ -0,0 +1,15 @@
1
+ from pychemstation.utils.hplc_param_types import Table
2
+
3
+ # maximum command number
4
+ MAX_CMD_NO = 255
5
+
6
+ # tables
7
+ METHOD_TIMETABLE = Table(
8
+ register="RCPMP1Method[1]",
9
+ name="Timetable"
10
+ )
11
+
12
+ SEQUENCE_TABLE = Table(
13
+ register="_sequence[1]",
14
+ name="SeqTable1"
15
+ )
@@ -0,0 +1,185 @@
1
+ from dataclasses import dataclass
2
+ from enum import Enum
3
+ from typing import Union, Any, Optional
4
+
5
+ from pychemstation.generated import SolventElement, Signal
6
+
7
+
8
+ # Commands sent to the Chemstation Macro
9
+ # See https://www.agilent.com/cs/library/usermanuals/Public/MACROS.PDF
10
+ class Command(Enum):
11
+ def __str__(self):
12
+ return '%s' % self.value
13
+
14
+ RESET_COUNTER_CMD = "last_cmd_no = 0"
15
+ GET_STATUS_CMD = "response$ = AcqStatus$"
16
+ SLEEP_CMD = "Sleep {seconds}"
17
+ STANDBY_CMD = "Standby"
18
+ STOP_MACRO_CMD = "Stop"
19
+ PREPRUN_CMD = "PrepRun"
20
+ LAMP_ON_CMD = "LampAll ON"
21
+ LAMP_OFF_CMD = "LampAll OFF"
22
+ PUMP_ON_CMD = "PumpAll ON"
23
+ PUMP_OFF_CMD = "PumpAll OFF"
24
+ GET_METHOD_CMD = "response$ = _MethFile$"
25
+ SWITCH_METHOD_CMD = 'LoadMethod "{method_dir}", "{method_name}.M"'
26
+ START_METHOD_CMD = "StartMethod"
27
+ RUN_METHOD_CMD = 'RunMethod "{data_dir}",, "{experiment_name}_{timestamp}"'
28
+ STOP_METHOD_CMD = "StopMethod"
29
+ UPDATE_METHOD_CMD = 'UpdateMethod'
30
+ SWITCH_SEQUENCE_CMD = 'LoadSequence _SeqPath$, _SeqFile$'
31
+ SAVE_SEQUENCE_CMD = 'SaveSequence _SeqPath$, _SeqFile$'
32
+ GET_SEQUENCE_CMD = 'response$ = _SeqFile$'
33
+ RUN_SEQUENCE_CMD = 'RunSequence "{data_dir}",, "{experiment_name}_{timestamp}"'
34
+
35
+
36
+ class RegisterFlag(Enum):
37
+ def __str__(self):
38
+ return '%s' % self.value
39
+
40
+ # for table
41
+ NUM_ROWS = "NumberOfRows"
42
+
43
+ # for Method
44
+ SOLVENT_A_COMPOSITION = "PumpChannel_CompositionPercentage"
45
+ SOLVENT_B_COMPOSITION = "PumpChannel2_CompositionPercentage"
46
+ SOLVENT_C_COMPOSITION = "PumpChannel3_CompositionPercentage"
47
+ SOLVENT_D_COMPOSITION = "PumpChannel4_CompositionPercentage"
48
+ FLOW = "Flow"
49
+ MAX_TIME = "StopTime_Time"
50
+ COLUMN_OVEN_TEMP1 = "TemperatureControl_Temperature"
51
+ COLUMN_OVEN_TEMP2 = "TemperatureControl2_Temperature"
52
+ STOPTIME_MODE = "StopTime_Mode"
53
+ POSTIME_MODE = "PostTime_Mode"
54
+
55
+ # for Method Timetable
56
+ SOLVENT_COMPOSITION = "SolventComposition"
57
+
58
+ # for Sequence
59
+ VIAL_LOCATION = "Vial"
60
+ NAME = ""
61
+ METHOD = ""
62
+ INJ_VOL = ""
63
+
64
+
65
+ class TableOperation(Enum):
66
+ def __str__(self):
67
+ return '%s' % self.value
68
+
69
+ DELETE_TABLE = 'DelTab {register}, "{table_name}"'
70
+ CREATE_TABLE = 'NewTab {register}, "{table_name}"'
71
+ NEW_ROW = 'InsTabRow {register}, "{table_name}"'
72
+ EDIT_ROW_VAL = 'SetTabVal "{register}", "{table_name}", {row}, "{col_name}", {val}'
73
+ EDIT_ROW_TEXT = 'SetTabText "{register}", "{table_name}", {row}, "{col_name}", "{val}"'
74
+ GET_ROW_VAL = 'TabVal ("{register}", "{table_name}", {row}, "{col_name}")'
75
+ GET_ROW_TEXT = 'TabText ("{register}", "{table_name}", {row}, "{col_name}")'
76
+ GET_OBJ_HDR_VAL = '{internal_val} = TabHdrVal({register}, "{table_name}", "{col_name}")'
77
+ GET_OBJ_HDR_TEXT = ''
78
+ UPDATE_OBJ_HDR_VAL = 'SetObjHdrVal {register}, {register_flag}, {val}'
79
+ UPDATE_OBJ_HDR_TEXT = 'SetObjHdrText {register}, {register_flag}, {val}'
80
+ NEW_COL_TEXT = 'NewColText {register}, "{table_name}", "{col_name}", "{val}"'
81
+ NEW_COL_VAL = 'NewColVal {register}, "{table_name}", "{col_name}", {val}'
82
+
83
+
84
+ class PType(Enum):
85
+ STR = "str"
86
+ NUM = "num"
87
+
88
+
89
+ @dataclass
90
+ class Param:
91
+ ptype: PType
92
+ val: Union[float, int, str, Any]
93
+ chemstation_key: Union[RegisterFlag, list[RegisterFlag]]
94
+
95
+
96
+ @dataclass
97
+ class HPLCMethodParams:
98
+ organic_modifier: Param
99
+ flow: Param
100
+ temperature: Param
101
+ inj_vol: Param
102
+ equ_time: Param
103
+ maximum_run_time: Param
104
+
105
+
106
+ @dataclass
107
+ class Entry:
108
+ start_time: float
109
+ organic_modifer: float
110
+ flow: float
111
+
112
+
113
+ @dataclass
114
+ class SequenceEntry:
115
+ vial_location: Optional[int] = None
116
+ method: Optional[str] = None
117
+ inj_vol: Optional[int] = None
118
+ name: Optional[str] = None
119
+
120
+
121
+ @dataclass
122
+ class SequenceTable:
123
+ rows: list[SequenceEntry]
124
+
125
+
126
+ @dataclass
127
+ class MethodTimetable:
128
+ first_row: HPLCMethodParams
129
+ subsequent_rows: list[Entry]
130
+ dad_wavelengthes: Optional[list[Signal]] = None
131
+ organic_modifier: Optional[SolventElement] = None
132
+ modifier_a: Optional[SolventElement] = None
133
+
134
+
135
+ class HPLCRunningStatus(Enum):
136
+ @classmethod
137
+ def has_member_key(cls, key):
138
+ return key in cls.__members__
139
+
140
+ INJECTING = "INJECTING"
141
+ PREPARING = "PREPARING"
142
+ RUN = "RUN"
143
+ NOTREADY = "NOTREADY"
144
+ POSTRUN = "POSTRUN"
145
+ RAWDATA = "RAWDATA"
146
+ INITIALIZING = "INITIALIZING"
147
+ NOMODULE = "NOMODULE"
148
+
149
+
150
+ class HPLCAvailStatus(Enum):
151
+ @classmethod
152
+ def has_member_key(cls, key):
153
+ return key in cls.__members__
154
+
155
+ PRERUN = "PRERUN"
156
+ OFFLINE = "OFFLINE"
157
+ STANDBY = "STANDBY"
158
+
159
+
160
+ class HPLCErrorStatus(Enum):
161
+
162
+ @classmethod
163
+ def has_member_key(cls, key):
164
+ return key in cls.__members__
165
+
166
+ ERROR = "ERROR"
167
+ BREAK = "BREAK"
168
+ NORESPONSE = "NORESPONSE"
169
+ MALFORMED = "MALFORMED"
170
+
171
+
172
+ @dataclass
173
+ class Table:
174
+ register: str
175
+ name: str
176
+
177
+
178
+ def str_to_status(status: str) -> Union[HPLCAvailStatus, HPLCErrorStatus, HPLCRunningStatus]:
179
+ if HPLCErrorStatus.has_member_key(status):
180
+ return HPLCErrorStatus[status]
181
+ if HPLCRunningStatus.has_member_key(status):
182
+ return HPLCRunningStatus[status]
183
+ if HPLCAvailStatus.has_member_key(status):
184
+ return HPLCAvailStatus[status]
185
+ raise KeyError(status)
@@ -0,0 +1,3 @@
1
+ """
2
+ .. include:: ../README.md
3
+ """
@@ -0,0 +1 @@
1
+ from .base_spectrum import AbstractSpectrum