pychemstation 0.8.0__py3-none-any.whl → 0.8.2__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.
@@ -2,18 +2,22 @@ import os
2
2
  import time
3
3
  from typing import List
4
4
 
5
- from result import Result, Ok, Err
5
+ from result import Err, Ok, Result
6
6
  from xsdata.formats.dataclass.parsers import XmlParser
7
7
 
8
- from .table import TableController
9
- from ..devices.injector import InjectorController
10
8
  from ....analysis.process_report import AgilentReport, ReportType
11
9
  from ....control.controllers import CommunicationController
12
- from ....generated import PumpMethod, DadMethod, SolventElement
13
- from ....utils.chromatogram import TIME_FORMAT, AgilentChannelChromatogramData, AgilentHPLCChromatogram
10
+ from ....generated import DadMethod, PumpMethod, SolventElement
11
+ from ....utils.chromatogram import (
12
+ TIME_FORMAT,
13
+ AgilentChannelChromatogramData,
14
+ AgilentHPLCChromatogram,
15
+ )
14
16
  from ....utils.macro import *
15
17
  from ....utils.method_types import *
16
18
  from ....utils.table_types import *
19
+ from ..devices.injector import InjectorController
20
+ from .table import TableController
17
21
 
18
22
 
19
23
  class MethodController(TableController):
@@ -369,8 +373,8 @@ class MethodController(TableController):
369
373
 
370
374
  def get_report(self, custom_path: Optional[str] = None,
371
375
  report_type: ReportType = ReportType.TXT) -> List[AgilentReport]:
372
- metd_report = self.get_report_details(self.data_files[-1] if not custom_path else custom_path,
373
- report_type)
376
+ custom_path = self.data_files[-1] if not custom_path else custom_path
377
+ metd_report = self.get_report_details(custom_path, report_type)
374
378
  chrom_data: List[AgilentHPLCChromatogram] = list(self.get_data(custom_path).__dict__.values())
375
379
  for i, signal in enumerate(metd_report.signals):
376
380
  possible_data = chrom_data[i]
@@ -262,10 +262,12 @@ class TableController(abc.ABC):
262
262
 
263
263
  def get_uv_spectrum(self, path: str):
264
264
  data_uv = rb.agilent.chemstation.parse_file(os.path.join(path, "DAD1.UV"))
265
- zipped_data = zip(data_uv.ylabels, data_uv.data)
266
- for (wavelength, data) in zipped_data:
267
- self.uv[wavelength] = AgilentHPLCChromatogram()
268
- self.uv[wavelength].attach_spectrum(data_uv.xlabels, data)
265
+ times = data_uv.xlabels
266
+ wavelengthes = data_uv.ylabels
267
+ data = data_uv.data.transpose()
268
+ for (i, w) in enumerate(wavelengthes):
269
+ self.uv[w] = AgilentHPLCChromatogram()
270
+ self.uv[w].attach_spectrum(times, data[i])
269
271
 
270
272
  def get_report_details(self, path: str,
271
273
  report_type: ReportType = ReportType.TXT) -> AgilentReport:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pychemstation
3
- Version: 0.8.0
3
+ Version: 0.8.2
4
4
  Author-email: lucyhao <hao.lucyy@gmail.com>
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.8
@@ -16,10 +16,10 @@ pychemstation/control/controllers/devices/__init__.py,sha256=47DEQpj8HBSa-_TImW-
16
16
  pychemstation/control/controllers/devices/device.py,sha256=d9SwasjXTXplkRK5eH3asrNPo3BBZmAz6CKBYAuKSIc,1249
17
17
  pychemstation/control/controllers/devices/injector.py,sha256=ynPQtvMFt1iK0LQBf4ZEYdxJCyavmashXwyCQbmRjuw,5542
18
18
  pychemstation/control/controllers/tables/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
19
- pychemstation/control/controllers/tables/method.py,sha256=UMLwzsMYsZx53PMgmKIe6LcK4JjAUpuK41x9VMJObNw,17709
19
+ pychemstation/control/controllers/tables/method.py,sha256=sX83sHlnaAm8Wop_d28RDAk4DBPvQWduH3Atodtmw4A,17714
20
20
  pychemstation/control/controllers/tables/ms.py,sha256=JFD-tOhu8uRyKdl-E3-neRssii8MNqVRIlsrnFhNY_M,682
21
21
  pychemstation/control/controllers/tables/sequence.py,sha256=UT0KUDnn8A-19V24ZgW3KduSulvtbdvsJF9NJBUrz9M,13109
22
- pychemstation/control/controllers/tables/table.py,sha256=L7OECX502lk2o88hu5Sdb3O4cJxsNGic2193oSz7urI,12298
22
+ pychemstation/control/controllers/tables/table.py,sha256=Adis9584LJqP4yjLj5XrIxqq1jzdBiDieOG4vc90EIU,12327
23
23
  pychemstation/generated/__init__.py,sha256=GAoZFAYbPVEJDkcOw3e1rgOqd7TCW0HyKNPM8OMehMg,1005
24
24
  pychemstation/generated/dad_method.py,sha256=zfS9op450CRSGPKkUr9qUyPBbND06b9N8SUU9j4cosM,8408
25
25
  pychemstation/generated/pump_method.py,sha256=c_FB14rgODZyH5eDb3kxZAI77xRj1HMpQkE2R6MypNA,12180
@@ -33,7 +33,7 @@ pychemstation/utils/pump_types.py,sha256=HWQHxscGn19NTrfYBwQRCO2VcYfwyko7YfBO5uD
33
33
  pychemstation/utils/sequence_types.py,sha256=x2EClcq6ROdzeLZg63XcXXTknwl2aZ48Vuyru0xZjgA,1086
34
34
  pychemstation/utils/table_types.py,sha256=7txqW_oNpkh4venSkGEtreVe6UV9dzNB1DTrIeTkQHA,3217
35
35
  pychemstation/utils/tray_types.py,sha256=eOO-muUjadyvCM8JnYAZVyxJeyYBlENP1zXiFskAFbs,5049
36
- pychemstation-0.8.0.dist-info/METADATA,sha256=7cSMnoyDeOne85r2n7Bh3IsBeC5xWGVhuu4I0hNTeCo,4491
37
- pychemstation-0.8.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
38
- pychemstation-0.8.0.dist-info/licenses/LICENSE,sha256=9bdF75gIf1MecZ7oymqWgJREVz7McXPG-mjqrTmzzD8,18658
39
- pychemstation-0.8.0.dist-info/RECORD,,
36
+ pychemstation-0.8.2.dist-info/METADATA,sha256=qZhsTmXFCAoPshKfuw2zMvF76XBHChffCFOefP0t1fw,4491
37
+ pychemstation-0.8.2.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
38
+ pychemstation-0.8.2.dist-info/licenses/LICENSE,sha256=9bdF75gIf1MecZ7oymqWgJREVz7McXPG-mjqrTmzzD8,18658
39
+ pychemstation-0.8.2.dist-info/RECORD,,