pytrms 0.9.5__py3-none-any.whl → 0.9.6__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.
pytrms/__init__.py CHANGED
@@ -1,4 +1,4 @@
1
- _version = '0.9.5'
1
+ _version = '0.9.6'
2
2
 
3
3
  __all__ = ['load', 'connect']
4
4
 
pytrms/clients/db_api.py CHANGED
@@ -123,6 +123,7 @@ class IoniConnect(IoniClientBase):
123
123
  'high': lambda p: p.borders[1],
124
124
  'shift': attrgetter('shift'),
125
125
  'multiplier': attrgetter('multiplier'),
126
+ 'resolution': attrgetter('resolution'),
126
127
  }
127
128
  # normalize the input argument and create a hashable set:
128
129
  updates = dict()
pytrms/instrument.py CHANGED
@@ -7,6 +7,8 @@ from .measurement import (
7
7
  FinishedMeasurement,
8
8
  )
9
9
 
10
+ __all__ = ['Instrument']
11
+
10
12
 
11
13
  class Instrument(ABC):
12
14
  '''
@@ -27,25 +29,26 @@ class Instrument(ABC):
27
29
  self.__class__ = newstate
28
30
 
29
31
  def __new__(cls, backend):
30
- # make this class a singleton..
32
+ # Note (reminder): If __new__() does not return an instance of cls,
33
+ # then the new instance’s __init__() method will *not* be invoked!
34
+ #
35
+ # This aside, we override the __new__ method to make this class a
36
+ # singleton that reflects the PTR-instrument state and dispatches
37
+ # to one of its subclass implementations.
31
38
  if cls._Instrument__instance is not None:
32
- # quick reminder: If __new__() does not return an instance of cls, then the
33
- # new instance’s __init__() method will *not* be invoked:
34
39
  return cls._Instrument__instance
35
40
 
36
- # ..that is synchronized with the PTR-instrument state:
37
41
  if backend.is_running:
38
- cls = RunningInstrument
42
+ inst = object.__new__(_RunningInstrument)
39
43
  else:
40
- cls = IdleInstrument
44
+ inst = object.__new__(_IdleInstrument)
41
45
 
42
- inst = object.__new__(cls)
43
46
  Instrument._Instrument__instance = inst
44
47
 
45
48
  return inst
46
49
 
47
50
  def __init__(self, backend):
48
- # dispatch all blocking calls to the client
51
+ # Note: this will be called *once* per Python process!
49
52
  self.backend = backend
50
53
 
51
54
  @property
@@ -84,7 +87,7 @@ class Instrument(ABC):
84
87
  raise RuntimeError("can't stop %s" % self.__class__)
85
88
 
86
89
 
87
- class IdleInstrument(Instrument):
90
+ class _IdleInstrument(Instrument):
88
91
 
89
92
  def start_measurement(self, filename=''):
90
93
  dirname = os.path.dirname(filename)
@@ -113,7 +116,7 @@ class IdleInstrument(Instrument):
113
116
  return RunningMeasurement(self)
114
117
 
115
118
 
116
- class RunningInstrument(Instrument):
119
+ class _RunningInstrument(Instrument):
117
120
 
118
121
  def stop_measurement(self):
119
122
  self.backend.stop_measurement()
pytrms/measurement.py CHANGED
@@ -125,7 +125,7 @@ class RunningMeasurement(Measurement):
125
125
  raise Exception("no connection to instrument")
126
126
 
127
127
  timeout_s = 15
128
- ssd_s = 1e-3 * self.ptr.get('ACQ_SRV_SpecTime_ms')
128
+ ssd_s = 1e-3 * float(self.ptr.get('ACQ_SRV_SpecTime_ms'))
129
129
  last_rel_cycle = -1
130
130
  sourcefile = ''
131
131
  for specdata in self.ptr.backend.iter_specdata(timeout_s=timeout_s+ssd_s, buffer_size=300):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: pytrms
3
- Version: 0.9.5
3
+ Version: 0.9.6
4
4
  Summary: Python bundle for proton-transfer reaction mass-spectrometry (PTR-MS).
5
5
  License: GPL-2.0
6
6
  Author: Moritz Koenemann
@@ -1,10 +1,10 @@
1
- pytrms/__init__.py,sha256=mpfREDA7-ju1LSdP74W_oI1huuS-03gjpj1U0zZRyS4,1126
1
+ pytrms/__init__.py,sha256=nJvtCWmSmVhGJbZy4HURNLFLov1K7w-KjFzjpzdjH1c,1126
2
2
  pytrms/_base/__init__.py,sha256=antvp0cUKidEa1MGhM_kK1MrVl3LtY6Yt0P3KGB6McE,812
3
3
  pytrms/_base/ioniclient.py,sha256=OHIZ6qpnNJvbKftbxH2_TF_BcTc7YalCfw3k_bem5rc,794
4
4
  pytrms/_base/mqttclient.py,sha256=ZWGAE2xgORQP0PCNJ-wUsYvs43wWm6TX5oHkELJt4j0,5038
5
5
  pytrms/_version.py,sha256=yRCN1kvPaX0FHycK0NBHTluhkf5euj8U7WNTKdVQafg,828
6
6
  pytrms/clients/__init__.py,sha256=4m2tOQQs5urPyZ_Yqmh431JXnWbdWVUV6aAMpRidPdg,1382
7
- pytrms/clients/db_api.py,sha256=pLbFSf0oWWvzdjisi_EGwpQMbeT4OErEdB4uEm4Shz0,8295
7
+ pytrms/clients/db_api.py,sha256=8a0-2tiarET3TK_1-5mJQ7aMH2KM7QYuPDXMgbjmCfY,8347
8
8
  pytrms/clients/ioniclient.py,sha256=cp37XSoCzLamjDzcUCrKbp530YMstQ0Eoj81r5tClL8,2390
9
9
  pytrms/clients/modbus.py,sha256=7KyLBQrSPRvKO81iFRxhEpofXF9FFyNrCtqQR7iidzI,20285
10
10
  pytrms/clients/mqtt.py,sha256=8-jyTb3CGXZxh4os1B721pe_LQ-G_uv9dqgbevIxGg4,31522
@@ -14,14 +14,14 @@ pytrms/compose/composition.py,sha256=RXwM1w2yujKIcrz0ir8l6uj0zqQCd_O10GTIT97Gmbw
14
14
  pytrms/data/IoniTofPrefs.ini,sha256=BGyTijnmtdGqa-kGbAuB1RysG4MPK9nlF9TR069tKwE,1887
15
15
  pytrms/data/ParaIDs.csv,sha256=H4ssQixGYvGMcYSdRcycmGbIrO2J8imh6FGwUNsmmM4,27395
16
16
  pytrms/helpers.py,sha256=YK2WjhQIwF5SdXM1A-lTp0hDfXnPSnaNDbGjbkjMUBU,5070
17
- pytrms/instrument.py,sha256=adBkZg-oWcpJOgd00esQRrjCeMUQDnP1PICNevE2cLg,4292
18
- pytrms/measurement.py,sha256=KbELu41tZhRDXIm1S8U9angVzIbyrHbHWcNDPb0CSbg,7622
17
+ pytrms/instrument.py,sha256=jO37ZUlCkItXNzjT9Hh-mx6Eyt4VD4DBQATEiKUEb4M,4432
18
+ pytrms/measurement.py,sha256=iHsEWmJhCSFxMON_N-5mtCmFqigBqGQM4AImqE7pS44,7629
19
19
  pytrms/peaktable.py,sha256=Axa7EQs9UKVfypsysT69PqKejfVqmQB08nS71TpbVcU,17007
20
20
  pytrms/plotting/__init__.py,sha256=sfL4k2PeBmzIf-5Z_2rnkeM8As3psbPxaVvmpi1T48Q,62
21
21
  pytrms/plotting/plotting.py,sha256=WzP4Is2PSu_NdhY73HsCU8iEHmLgnIgNY-opsxwIjH8,675
22
22
  pytrms/readers/__init__.py,sha256=2r9dXwPRqYkIGpM0EjY-m_Ti3qtxE0jeC9FnudDDoXc,72
23
23
  pytrms/readers/ionitof_reader.py,sha256=c8W5aglrY1bmuljnaAqx6TGWAPGXXMkuHjJ1aRw3Wrc,17624
24
- pytrms-0.9.5.dist-info/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
25
- pytrms-0.9.5.dist-info/METADATA,sha256=UFCLeJJ55taSuvQzMzpaMjKYoe3x9rWsIhfj-3ikgnY,812
26
- pytrms-0.9.5.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
27
- pytrms-0.9.5.dist-info/RECORD,,
24
+ pytrms-0.9.6.dist-info/LICENSE,sha256=gXf5dRMhNSbfLPYYTY_5hsZ1r7UU1OaKQEAQUhuIBkM,18092
25
+ pytrms-0.9.6.dist-info/METADATA,sha256=GlVG3GDVyqDiNjre3O2y5sKo25xfoRXvBOd9ClLeEMo,812
26
+ pytrms-0.9.6.dist-info/WHEEL,sha256=IYZQI976HJqqOpQU6PHkJ8fb3tMNBFjg-Cn-pwAbaFM,88
27
+ pytrms-0.9.6.dist-info/RECORD,,
File without changes