pychemstation 0.5.6.dev1__tar.gz → 0.5.7.dev1__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.
Files changed (40) hide show
  1. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/PKG-INFO +1 -1
  2. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation/control/controllers/comm.py +3 -2
  3. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation/control/controllers/method.py +17 -2
  4. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation/control/controllers/sequence.py +7 -5
  5. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation/control/controllers/table_controller.py +4 -0
  6. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation/control/hplc.py +3 -0
  7. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation/utils/chromatogram.py +4 -0
  8. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation/utils/method_types.py +2 -0
  9. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation/utils/table_types.py +3 -0
  10. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation.egg-info/PKG-INFO +1 -1
  11. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/setup.py +1 -1
  12. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/tests/test_comb.py +3 -1
  13. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/LICENSE +0 -0
  14. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/README.md +0 -0
  15. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation/__init__.py +0 -0
  16. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation/analysis/__init__.py +0 -0
  17. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation/analysis/base_spectrum.py +0 -0
  18. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation/analysis/spec_utils.py +0 -0
  19. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation/analysis/utils.py +0 -0
  20. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation/control/__init__.py +0 -0
  21. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation/control/controllers/__init__.py +0 -0
  22. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation/generated/__init__.py +0 -0
  23. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation/generated/dad_method.py +0 -0
  24. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation/generated/pump_method.py +0 -0
  25. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation/utils/__init__.py +0 -0
  26. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation/utils/macro.py +0 -0
  27. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation/utils/parsing.py +0 -0
  28. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation/utils/sequence_types.py +0 -0
  29. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation/utils/tray_types.py +0 -0
  30. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation.egg-info/SOURCES.txt +0 -0
  31. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation.egg-info/dependency_links.txt +0 -0
  32. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation.egg-info/requires.txt +0 -0
  33. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pychemstation.egg-info/top_level.txt +0 -0
  34. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/pyproject.toml +0 -0
  35. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/setup.cfg +0 -0
  36. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/tests/__init__.py +0 -0
  37. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/tests/constants.py +0 -0
  38. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/tests/test_comm.py +0 -0
  39. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/tests/test_method.py +0 -0
  40. {pychemstation-0.5.6.dev1 → pychemstation-0.5.7.dev1}/tests/test_sequence.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pychemstation
3
- Version: 0.5.6.dev1
3
+ Version: 0.5.7.dev1
4
4
  Summary: Library to interact with Chemstation software, primarily used in Hein lab
5
5
  Home-page: https://gitlab.com/heingroup/device-api/pychemstation
6
6
  Author: Lucy Hao
@@ -9,7 +9,7 @@ been processed.
9
9
 
10
10
  Authors: Alexander Hammer, Hessam Mehr, Lucy Hao
11
11
  """
12
-
12
+ import logging
13
13
  import os
14
14
  import time
15
15
 
@@ -97,6 +97,7 @@ class CommunicationController:
97
97
  time.sleep(30)
98
98
  self.set_status()
99
99
  hplc_actually_avail = isinstance(self._most_recent_hplc_status, HPLCAvailStatus)
100
+ logging.info("Still running")
100
101
  return hplc_avail and hplc_actually_avail
101
102
 
102
103
  def _send(self, cmd: str, cmd_no: int, num_attempts=5) -> None:
@@ -183,7 +184,7 @@ class CommunicationController:
183
184
  num_response_prefix = "Numerical Responses:"
184
185
  str_response_prefix = "String Responses:"
185
186
  possible_response = self._receive(self.cmd_no)
186
- if Ok(possible_response):
187
+ if possible_response.is_ok():
187
188
  lines = possible_response.value.splitlines()
188
189
  for line in lines:
189
190
  if str_response_prefix in line and num_response_prefix in line:
@@ -21,6 +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 check_loaded_method(self):
25
+ time.sleep(2)
26
+ self.send(Command.GET_METHOD_CMD)
27
+ time.sleep(2)
28
+ res = self.receive()
29
+ if res.is_ok():
30
+ return res.ok_value.string_response
31
+
24
32
  def get_method_params(self) -> HPLCMethodParams:
25
33
  return HPLCMethodParams(organic_modifier=self.controller.get_num_val(
26
34
  cmd=TableOperation.GET_OBJ_HDR_VAL.value.format(
@@ -50,8 +58,12 @@ class MethodController(TableController):
50
58
  def load(self) -> MethodTimetable:
51
59
  rows = self.get_num_rows()
52
60
  if rows.is_ok():
61
+ self.send(Command.GET_METHOD_CMD)
62
+ res = self.receive()
63
+ method_name = res.ok_value.string_response
53
64
  timetable_rows = [self.get_row(r + 1) for r in range(int(rows.ok_value.num_response))]
54
65
  self.table_state = MethodTimetable(
66
+ name=method_name,
55
67
  first_row=self.get_method_params(),
56
68
  subsequent_rows=timetable_rows)
57
69
  return self.table_state
@@ -124,8 +136,7 @@ class MethodController(TableController):
124
136
  first_row=HPLCMethodParams(
125
137
  organic_modifier=organic_modifier.percentage,
126
138
  flow=method.flow,
127
- maximum_run_time=method.stop_time,
128
- temperature=-1),
139
+ maximum_run_time=method.stop_time),
129
140
  subsequent_rows=[
130
141
  TimeTableEntry(
131
142
  start_time=tte.time,
@@ -146,6 +157,7 @@ class MethodController(TableController):
146
157
 
147
158
  :param updated_method: the method with updated values, to be sent to Chemstation to modify the currently loaded method.
148
159
  """
160
+ self.table_state = updated_method
149
161
  initial_organic_modifier: Param = Param(val=updated_method.first_row.organic_modifier,
150
162
  chemstation_key=RegisterFlag.SOLVENT_B_COMPOSITION,
151
163
  ptype=PType.NUM)
@@ -255,6 +267,9 @@ class MethodController(TableController):
255
267
 
256
268
  :param experiment_name: Name of the experiment
257
269
  """
270
+ if not self.table_state:
271
+ self.table_state = self.load()
272
+
258
273
  timestamp = time.strftime(TIME_FORMAT)
259
274
  self.send(Command.RUN_METHOD_CMD.value.format(data_dir=self.data_dir,
260
275
  experiment_name=experiment_name,
@@ -73,7 +73,7 @@ class SequenceController(TableController):
73
73
 
74
74
  :param sequence_table:
75
75
  """
76
-
76
+ self.table_state = sequence_table
77
77
  rows = self.get_num_rows()
78
78
  if rows.is_ok():
79
79
  existing_row_num = rows.value.num_response
@@ -177,17 +177,19 @@ class SequenceController(TableController):
177
177
  under the <data_dir>/<sequence table name> folder.
178
178
  Device must be ready.
179
179
  """
180
+ if not self.table_state:
181
+ self.table_state = self.load()
182
+
180
183
  timestamp = time.strftime(SEQUENCE_TIME_FORMAT)
181
- seq_table = self.load()
182
184
  self.send(Command.RUN_SEQUENCE_CMD.value)
183
185
 
184
186
  if self.check_hplc_is_running():
185
- folder_name = f"{seq_table.name} {timestamp}"
187
+ folder_name = f"{self.table_state.name} {timestamp}"
186
188
  self.data_files.append(SequenceDataFiles(dir=folder_name,
187
- sequence_name=seq_table.name))
189
+ sequence_name=self.table_state.name))
188
190
 
189
191
  if stall_while_running:
190
- run_completed = self.check_hplc_done_running(sequence=seq_table)
192
+ run_completed = self.check_hplc_done_running(sequence=self.table_state)
191
193
  if run_completed.is_ok():
192
194
  self.data_files[-1].dir = run_completed.value
193
195
  else:
@@ -41,6 +41,10 @@ class TableController(abc.ABC):
41
41
  "B": AgilentHPLCChromatogram(self.data_dir),
42
42
  "C": AgilentHPLCChromatogram(self.data_dir),
43
43
  "D": AgilentHPLCChromatogram(self.data_dir),
44
+ "E": AgilentHPLCChromatogram(self.data_dir),
45
+ "F": AgilentHPLCChromatogram(self.data_dir),
46
+ "G": AgilentHPLCChromatogram(self.data_dir),
47
+ "H": AgilentHPLCChromatogram(self.data_dir),
44
48
  }
45
49
 
46
50
  self.data_files: Union[list[SequenceDataFiles], list[str]] = []
@@ -138,6 +138,9 @@ class HPLCController:
138
138
  """
139
139
  return self.sequence_controller.get_data()
140
140
 
141
+ def check_loaded_method(self) -> str:
142
+ return self.method_controller.check_loaded_method()
143
+
141
144
  def load_method(self) -> MethodTimetable:
142
145
  """
143
146
  Returns the currently loaded method, including its timetable.
@@ -109,3 +109,7 @@ class AgilentChannelChromatogramData:
109
109
  B: AgilentHPLCChromatogram
110
110
  C: AgilentHPLCChromatogram
111
111
  D: AgilentHPLCChromatogram
112
+ E: AgilentHPLCChromatogram
113
+ F: AgilentHPLCChromatogram
114
+ G: AgilentHPLCChromatogram
115
+ H: AgilentHPLCChromatogram
@@ -6,6 +6,7 @@ from .table_types import RegisterFlag
6
6
  from ..generated import Signal, SolventElement
7
7
 
8
8
 
9
+
9
10
  class PType(Enum):
10
11
  STR = "str"
11
12
  NUM = "num"
@@ -34,6 +35,7 @@ class TimeTableEntry:
34
35
 
35
36
  @dataclass
36
37
  class MethodTimetable:
38
+ name: str
37
39
  first_row: HPLCMethodParams
38
40
  subsequent_rows: list[TimeTableEntry]
39
41
  dad_wavelengthes: Optional[list[Signal]] = None
@@ -46,6 +46,9 @@ class RegisterFlag(Enum):
46
46
 
47
47
  # for Method Timetable
48
48
  SOLVENT_COMPOSITION = "SolventComposition"
49
+ PRESSURE = "Pressure"
50
+ EXTERNAL_CONTACT = "ExternalContact"
51
+
49
52
 
50
53
  # for Sequence
51
54
  VIAL_LOCATION = "Vial"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pychemstation
3
- Version: 0.5.6.dev1
3
+ Version: 0.5.7.dev1
4
4
  Summary: Library to interact with Chemstation software, primarily used in Hein lab
5
5
  Home-page: https://gitlab.com/heingroup/device-api/pychemstation
6
6
  Author: Lucy Hao
@@ -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.6.dev1",
8
+ version="0.5.7.dev1",
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",
@@ -41,6 +41,8 @@ class TestCombinations(unittest.TestCase):
41
41
  self.hplc_controller.edit_method(rand_method, save=True)
42
42
  if run_too:
43
43
  self.hplc_controller.run_method(experiment_name="changed_method")
44
+ chrom = self.hplc_controller.get_last_run_method_data()
45
+ self.assertEqual(len(chrom.__dict__), 8)
44
46
  except Exception as e:
45
47
  self.fail(f"Should have not failed: {e}")
46
48
 
@@ -138,6 +140,6 @@ class TestCombinations(unittest.TestCase):
138
140
  self.hplc_controller.preprun()
139
141
  self.hplc_controller.run_sequence()
140
142
  chrom = self.hplc_controller.get_last_run_sequence_data()
141
- self.assertTrue(len(chrom) == 2)
143
+ self.assertTrue(len(chrom) == 1)
142
144
  except Exception:
143
145
  self.fail("Failed")