spikesafe-python 1.9.7__tar.gz → 1.10.2__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.
- {spikesafe_python-1.9.7/spikesafe_python.egg-info → spikesafe_python-1.10.2}/PKG-INFO +3 -1
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/README.md +2 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/pyproject.toml +1 -1
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/DigitizerDataFetch.py +42 -28
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2/spikesafe_python.egg-info}/PKG-INFO +3 -1
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/tests/test_digitizer_fetch_time_of_sampling.py +76 -1
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/LICENSE +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/setup.cfg +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/setup.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/ChannelData.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/Compensation.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/DigitizerData.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/DigitizerEnums.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/DigitizerInfo.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/DigitizerVfCustomSequence.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/DigitizerVfCustomSequenceStep.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/Discharge.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/EventData.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/MemoryTableReadData.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/Precision.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/PulseWidthCorrection.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/ReadAllEvents.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/ScpiFormatter.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/SerialPortConnection.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/SpikeSafeEnums.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/SpikeSafeError.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/SpikeSafeEvents.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/SpikeSafeInfo.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/SpikeSafeInfoParser.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/TcpSocket.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/TemperatureData.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/Threading.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/__init__.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python.egg-info/SOURCES.txt +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python.egg-info/dependency_links.txt +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python.egg-info/requires.txt +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python.egg-info/top_level.txt +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/tests/test_custom_compensation.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/tests/test_custom_compensation_old.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/tests/test_digitizer_fetch_time_of_sampling_old.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/tests/test_event_data.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/tests/test_event_data_old.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/tests/test_optimum_compensation.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/tests/test_optimum_compensation_old.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/tests/test_optimum_pulse_width_correction.py +0 -0
- {spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/tests/test_optimum_pulse_width_correction_old.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: spikesafe-python
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.10.2
|
|
4
4
|
Summary: SpikeSafe Python Library
|
|
5
5
|
Author-email: Vektrex <support@vektrex.com>
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -26,6 +26,8 @@ GitHub Repository: [SpikeSafe Python Samples](https://github.com/VektrexElectron
|
|
|
26
26
|
|
|
27
27
|
Library help documentation: [spikesafe_python_lib_docs](https://github.com/VektrexElectronicSystems/SpikeSafePythonSamples/tree/master/spikesafe_python_lib_docs)
|
|
28
28
|
|
|
29
|
+
Release notes: [spikesafe_python_lib_docs/_releases](https://github.com/VektrexElectronicSystems/SpikeSafePythonSamples/tree/master/spikesafe_python_lib_docs/_releases)
|
|
30
|
+
|
|
29
31
|
## About
|
|
30
32
|
|
|
31
33
|
The **spikesafe-python** package provides light-weight access Python helper classes and functions to easily communicate with to your SpikeSafe and parse data into easy to use objects.
|
|
@@ -12,6 +12,8 @@ GitHub Repository: [SpikeSafe Python Samples](https://github.com/VektrexElectron
|
|
|
12
12
|
|
|
13
13
|
Library help documentation: [spikesafe_python_lib_docs](https://github.com/VektrexElectronicSystems/SpikeSafePythonSamples/tree/master/spikesafe_python_lib_docs)
|
|
14
14
|
|
|
15
|
+
Release notes: [spikesafe_python_lib_docs/_releases](https://github.com/VektrexElectronicSystems/SpikeSafePythonSamples/tree/master/spikesafe_python_lib_docs/_releases)
|
|
16
|
+
|
|
15
17
|
## About
|
|
16
18
|
|
|
17
19
|
The **spikesafe-python** package provides light-weight access Python helper classes and functions to easily communicate with to your SpikeSafe and parse data into easy to use objects.
|
|
@@ -21,22 +21,21 @@ class DigitizerDataFetch():
|
|
|
21
21
|
|
|
22
22
|
Methods
|
|
23
23
|
-------
|
|
24
|
-
DigitizerDataFetch.fetch_voltage_data(spike_safe_socket, enable_logging = None)
|
|
24
|
+
DigitizerDataFetch.fetch_voltage_data(spike_safe_socket, enable_logging = None, digitizer_number=None)
|
|
25
25
|
Returns an array of voltage readings from the digitizer obtained through a fetch query
|
|
26
|
-
DigitizerDataFetch.fetch_voltage_data_sampling_mode_linear(spike_safe_socket, time_sampling_mode, aperture_microseconds, reading_count, hardware_trigger_delay_microseconds = 0, pulse_period_seconds = 0, enable_logging = None)
|
|
26
|
+
DigitizerDataFetch.fetch_voltage_data_sampling_mode_linear(spike_safe_socket, time_sampling_mode, aperture_microseconds, reading_count, hardware_trigger_delay_microseconds = 0, pulse_period_seconds = 0, enable_logging = None, digitizer_number=None)
|
|
27
27
|
Returns an array of voltage readings using linear sampling mode from the digitizer obtained through a fetch query
|
|
28
|
-
DigitizerDataFetch.fetch_voltage_data_sampling_mode_logarithmic(spike_safe_socket, time_sampling_mode, sampling_mode, hardware_trigger_delay_microseconds = 0, enable_logging = None)
|
|
28
|
+
DigitizerDataFetch.fetch_voltage_data_sampling_mode_logarithmic(spike_safe_socket, time_sampling_mode, sampling_mode, hardware_trigger_delay_microseconds = 0, enable_logging = None, digitizer_number=None)
|
|
29
29
|
Returns an array of voltage readings using logarithmic sampling mode from the digitizer obtained through a fetch query
|
|
30
|
-
DigitizerDataFetch.fetch_voltage_data_sampling_mode_custom(spike_safe_socket, time_sampling_mode, custom_sequence, hardware_trigger_delay_microseconds = 0, enable_logging = None)
|
|
30
|
+
DigitizerDataFetch.fetch_voltage_data_sampling_mode_custom(spike_safe_socket, time_sampling_mode, custom_sequence, hardware_trigger_delay_microseconds = 0, enable_logging = None, digitizer_number=None)
|
|
31
31
|
Returns an array of voltage readings using custom sampling mode from the digitizer obtained through a fetch query
|
|
32
|
-
DigitizerDataFetch.wait_for_new_voltage_data(spike_safe_socket, wait_time = 0.0, enable_logging = None, timeout = None)
|
|
32
|
+
DigitizerDataFetch.wait_for_new_voltage_data(spike_safe_socket, wait_time = 0.0, enable_logging = None, timeout = None, digitizer_number=None)
|
|
33
33
|
Queries the SpikeSafe PSMU digitizer until it responds that it has acquired new data
|
|
34
34
|
DigitizerDataFetch.get_new_voltage_data_estimated_complete_time(aperture_microseconds, reading_count, hardware_trigger_count=None, hardware_trigger_delay_microseconds=None)
|
|
35
35
|
Returns the estimated minimum possible time in seconds it will take for the SpikeSafe PSMU digitizer to acquire new voltage readings. If hardware triggering is used, this does not take into account the pulse period, so the actual time may be longer.
|
|
36
36
|
"""
|
|
37
|
-
|
|
38
37
|
@staticmethod
|
|
39
|
-
def fetch_voltage_data(spike_safe_socket, enable_logging = None):
|
|
38
|
+
def fetch_voltage_data(spike_safe_socket, enable_logging = None, digitizer_number=None):
|
|
40
39
|
"""Returns an array of voltage readings from the digitizer obtained through a fetch query
|
|
41
40
|
|
|
42
41
|
Parameters
|
|
@@ -45,6 +44,8 @@ class DigitizerDataFetch():
|
|
|
45
44
|
Socket object used to communicate with SpikeSafe
|
|
46
45
|
enable_logging : bool, Optional
|
|
47
46
|
Overrides spike_safe_socket.enable_logging attribute (default to None will use spike_safe_socket.enable_logging value)
|
|
47
|
+
digitizer_number : int, Optional
|
|
48
|
+
The Digitizer number to fetch from. If None, fetches from Digitizer 1.
|
|
48
49
|
|
|
49
50
|
Returns
|
|
50
51
|
-------
|
|
@@ -56,9 +57,10 @@ class DigitizerDataFetch():
|
|
|
56
57
|
Exception
|
|
57
58
|
On any error
|
|
58
59
|
"""
|
|
59
|
-
try:
|
|
60
|
+
try:
|
|
60
61
|
# fetch the Digitizer voltage readings
|
|
61
|
-
|
|
62
|
+
prefix = "VOLT" if digitizer_number is None else f"VOLT{digitizer_number}"
|
|
63
|
+
spike_safe_socket.send_scpi_command(f'{prefix}:FETC?', enable_logging)
|
|
62
64
|
digitizer_data_string = spike_safe_socket.read_data(enable_logging)
|
|
63
65
|
|
|
64
66
|
# set up the DigitizerData array to be returned
|
|
@@ -83,7 +85,7 @@ class DigitizerDataFetch():
|
|
|
83
85
|
raise
|
|
84
86
|
|
|
85
87
|
@staticmethod
|
|
86
|
-
def fetch_voltage_data_sampling_mode_linear(spike_safe_socket, time_sampling_mode, aperture_microseconds, reading_count, hardware_trigger_delay_microseconds = 0, pulse_period_seconds = 0, enable_logging = None):
|
|
88
|
+
def fetch_voltage_data_sampling_mode_linear(spike_safe_socket, time_sampling_mode, aperture_microseconds, reading_count, hardware_trigger_delay_microseconds = 0, pulse_period_seconds = 0, enable_logging = None, digitizer_number=None):
|
|
87
89
|
"""Returns an array of voltage readings using linear sampling mode from the digitizer obtained through a fetch query
|
|
88
90
|
|
|
89
91
|
Parameters
|
|
@@ -102,6 +104,8 @@ class DigitizerDataFetch():
|
|
|
102
104
|
The pulse period in seconds (default to 0s)
|
|
103
105
|
enable_logging : bool, Optional
|
|
104
106
|
Overrides spike_safe_socket.enable_logging attribute (default to None will use spike_safe_socket.enable_logging value)
|
|
107
|
+
digitizer_number : int, Optional
|
|
108
|
+
The Digitizer number to fetch from. If None, fetches from Digitizer 1.
|
|
105
109
|
|
|
106
110
|
Returns
|
|
107
111
|
-------
|
|
@@ -115,9 +119,10 @@ class DigitizerDataFetch():
|
|
|
115
119
|
"""
|
|
116
120
|
try:
|
|
117
121
|
# fetch the Digitizer voltage readings
|
|
118
|
-
|
|
122
|
+
prefix = "VOLT" if digitizer_number is None else f"VOLT{digitizer_number}"
|
|
123
|
+
spike_safe_socket.send_scpi_command(f'{prefix}:FETC?', enable_logging)
|
|
119
124
|
digitizer_data_string = spike_safe_socket.read_data(enable_logging)
|
|
120
|
-
|
|
125
|
+
|
|
121
126
|
# set up the DigitizerData array to be returned
|
|
122
127
|
digitizer_data_collection = []
|
|
123
128
|
|
|
@@ -141,7 +146,7 @@ class DigitizerDataFetch():
|
|
|
141
146
|
raise
|
|
142
147
|
|
|
143
148
|
@staticmethod
|
|
144
|
-
def fetch_voltage_data_sampling_mode_logarithmic(spike_safe_socket, time_sampling_mode, sampling_mode, hardware_trigger_delay_microseconds = 0, enable_logging = None):
|
|
149
|
+
def fetch_voltage_data_sampling_mode_logarithmic(spike_safe_socket, time_sampling_mode, sampling_mode, hardware_trigger_delay_microseconds = 0, enable_logging = None, digitizer_number=None):
|
|
145
150
|
"""Returns an array of voltage readings using logarithmic sampling mode from the digitizer obtained through a fetch query
|
|
146
151
|
|
|
147
152
|
Parameters
|
|
@@ -156,6 +161,8 @@ class DigitizerDataFetch():
|
|
|
156
161
|
The hardware trigger delay in microseconds (default to 0us)
|
|
157
162
|
enable_logging : bool, Optional
|
|
158
163
|
Overrides spike_safe_socket.enable_logging attribute (default to None will use spike_safe_socket.enable_logging value)
|
|
164
|
+
digitizer_number : int, Optional
|
|
165
|
+
The Digitizer number to fetch from. If None, fetches from Digitizer 1.
|
|
159
166
|
|
|
160
167
|
Returns
|
|
161
168
|
-------
|
|
@@ -172,7 +179,8 @@ class DigitizerDataFetch():
|
|
|
172
179
|
raise ValueError(f"{sampling_mode} sampling mode is invalid. Use sampling mode FAST_LOG, MEDIUM_LOG, or SLOW_LOG.")
|
|
173
180
|
|
|
174
181
|
# fetch the Digitizer voltage readings
|
|
175
|
-
|
|
182
|
+
prefix = "VOLT" if digitizer_number is None else f"VOLT{digitizer_number}"
|
|
183
|
+
spike_safe_socket.send_scpi_command(f'{prefix}:FETC?', enable_logging)
|
|
176
184
|
digitizer_data_string = spike_safe_socket.read_data(enable_logging)
|
|
177
185
|
|
|
178
186
|
# set up the DigitizerData array to be returned
|
|
@@ -200,7 +208,7 @@ class DigitizerDataFetch():
|
|
|
200
208
|
raise
|
|
201
209
|
|
|
202
210
|
@staticmethod
|
|
203
|
-
def fetch_voltage_data_sampling_mode_custom(spike_safe_socket, time_sampling_mode, custom_sequence, hardware_trigger_delay_microseconds = 0, enable_logging = None):
|
|
211
|
+
def fetch_voltage_data_sampling_mode_custom(spike_safe_socket, time_sampling_mode, custom_sequence, hardware_trigger_delay_microseconds = 0, enable_logging = None, digitizer_number=None):
|
|
204
212
|
"""Returns an array of voltage readings using custom sampling mode from the digitizer obtained through a fetch query
|
|
205
213
|
|
|
206
214
|
Parameters
|
|
@@ -215,6 +223,8 @@ class DigitizerDataFetch():
|
|
|
215
223
|
The hardware trigger delay in microseconds (default to 0us)
|
|
216
224
|
enable_logging : bool, Optional
|
|
217
225
|
Overrides spike_safe_socket.enable_logging attribute (default to None will use spike_safe_socket.enable_logging value)
|
|
226
|
+
digitizer_number : int, Optional
|
|
227
|
+
The Digitizer number to fetch from. If None, fetches from Digitizer 1.
|
|
218
228
|
|
|
219
229
|
Returns
|
|
220
230
|
-------
|
|
@@ -231,7 +241,8 @@ class DigitizerDataFetch():
|
|
|
231
241
|
digitizer_sampling_mode_custom_sequence = DigitizerVfCustomSequence().parse_sequence(custom_sequence)
|
|
232
242
|
|
|
233
243
|
# fetch the Digitizer voltage readings
|
|
234
|
-
|
|
244
|
+
prefix = "VOLT" if digitizer_number is None else f"VOLT{digitizer_number}"
|
|
245
|
+
spike_safe_socket.send_scpi_command(f'{prefix}:FETC?', enable_logging)
|
|
235
246
|
digitizer_data_string = spike_safe_socket.read_data(enable_logging)
|
|
236
247
|
|
|
237
248
|
# set up the DigitizerData array to be returned
|
|
@@ -259,7 +270,7 @@ class DigitizerDataFetch():
|
|
|
259
270
|
raise
|
|
260
271
|
|
|
261
272
|
@staticmethod
|
|
262
|
-
def wait_for_new_voltage_data(spike_safe_socket, wait_time = 0.0, enable_logging = None, timeout = None):
|
|
273
|
+
def wait_for_new_voltage_data(spike_safe_socket, wait_time = 0.0, enable_logging = None, timeout = None, digitizer_number=None):
|
|
263
274
|
"""Queries the SpikeSafe PSMU digitizer until it responds that it has acquired new data
|
|
264
275
|
|
|
265
276
|
This is a useful function to call prior to sending a fetch query, because it determines whether fetched data will be freshly acquired
|
|
@@ -274,6 +285,8 @@ class DigitizerDataFetch():
|
|
|
274
285
|
Overrides spike_safe_socket.enable_logging attribute (default to None will use spike_safe_socket.enable_logging value)
|
|
275
286
|
timeout : float, Optional
|
|
276
287
|
Timeout in seconds for waiting for new data. If None, wait indefinitely.
|
|
288
|
+
digitizer_number : int, Optional
|
|
289
|
+
The Digitizer number to fetch from. If None, fetches from Digitizer 1.
|
|
277
290
|
|
|
278
291
|
Raises
|
|
279
292
|
------
|
|
@@ -283,9 +296,10 @@ class DigitizerDataFetch():
|
|
|
283
296
|
try:
|
|
284
297
|
digitizer_has_new_data = ''
|
|
285
298
|
start_time = time.time() # Record the start time
|
|
299
|
+
prefix = "VOLT" if digitizer_number is None else f"VOLT{digitizer_number}"
|
|
286
300
|
while True:
|
|
287
301
|
# check for new digitizer data
|
|
288
|
-
spike_safe_socket.send_scpi_command('
|
|
302
|
+
spike_safe_socket.send_scpi_command(f'{prefix}:NDAT?', enable_logging)
|
|
289
303
|
digitizer_has_new_data = spike_safe_socket.read_data(enable_logging)
|
|
290
304
|
if (digitizer_has_new_data == 'TRUE' or digitizer_has_new_data == 'PARTIAL'):
|
|
291
305
|
break
|
|
@@ -500,29 +514,29 @@ class DigitizerDataFetch():
|
|
|
500
514
|
return accumulated_time_since_start + aperture
|
|
501
515
|
|
|
502
516
|
|
|
503
|
-
def fetch_voltage_data(spike_safe_socket, enable_logging = None):
|
|
517
|
+
def fetch_voltage_data(spike_safe_socket, enable_logging = None, digitizer_number=None):
|
|
504
518
|
"""
|
|
505
519
|
Obsolete: Use DigitizerDataFetch.fetch_voltage_data() instead.
|
|
506
520
|
"""
|
|
507
|
-
return DigitizerDataFetch.fetch_voltage_data(spike_safe_socket, enable_logging)
|
|
521
|
+
return DigitizerDataFetch.fetch_voltage_data(spike_safe_socket, enable_logging, digitizer_number=digitizer_number)
|
|
508
522
|
|
|
509
|
-
def fetch_voltage_data_sampling_mode_linear(spike_safe_socket, time_sampling_mode, aperture_microseconds, reading_count, hardware_trigger_delay_microseconds = 0, pulse_period_seconds = 0, enable_logging = None):
|
|
523
|
+
def fetch_voltage_data_sampling_mode_linear(spike_safe_socket, time_sampling_mode, aperture_microseconds, reading_count, hardware_trigger_delay_microseconds = 0, pulse_period_seconds = 0, enable_logging = None, digitizer_number=None):
|
|
510
524
|
"""
|
|
511
525
|
Obsolete: Use DigitizerDataFetch.fetch_voltage_data_sampling_mode_linear() instead.
|
|
512
526
|
"""
|
|
513
|
-
return DigitizerDataFetch.fetch_voltage_data_sampling_mode_linear(spike_safe_socket, time_sampling_mode, aperture_microseconds, reading_count, hardware_trigger_delay_microseconds, pulse_period_seconds, enable_logging)
|
|
527
|
+
return DigitizerDataFetch.fetch_voltage_data_sampling_mode_linear(spike_safe_socket, time_sampling_mode, aperture_microseconds, reading_count, hardware_trigger_delay_microseconds, pulse_period_seconds, enable_logging, digitizer_number=digitizer_number)
|
|
514
528
|
|
|
515
|
-
def fetch_voltage_data_sampling_mode_logarithmic(spike_safe_socket, time_sampling_mode, sampling_mode, hardware_trigger_delay_microseconds = 0, enable_logging = None):
|
|
529
|
+
def fetch_voltage_data_sampling_mode_logarithmic(spike_safe_socket, time_sampling_mode, sampling_mode, hardware_trigger_delay_microseconds = 0, enable_logging = None, digitizer_number=None):
|
|
516
530
|
"""
|
|
517
531
|
Obsolete: Use DigitizerDataFetch.fetch_voltage_data_sampling_mode_logarithmic() instead.
|
|
518
532
|
"""
|
|
519
|
-
return DigitizerDataFetch.fetch_voltage_data_sampling_mode_logarithmic(spike_safe_socket, time_sampling_mode, sampling_mode, hardware_trigger_delay_microseconds, enable_logging)
|
|
533
|
+
return DigitizerDataFetch.fetch_voltage_data_sampling_mode_logarithmic(spike_safe_socket, time_sampling_mode, sampling_mode, hardware_trigger_delay_microseconds, enable_logging, digitizer_number=digitizer_number)
|
|
520
534
|
|
|
521
|
-
def fetch_voltage_data_sampling_mode_custom(spike_safe_socket, time_sampling_mode, custom_sequence, hardware_trigger_delay_microseconds = 0, enable_logging = None):
|
|
535
|
+
def fetch_voltage_data_sampling_mode_custom(spike_safe_socket, time_sampling_mode, custom_sequence, hardware_trigger_delay_microseconds = 0, enable_logging = None, digitizer_number=None):
|
|
522
536
|
"""
|
|
523
537
|
Obsolete: Use DigitizerDataFetch.fetch_voltage_data_sampling_mode_custom() instead.
|
|
524
538
|
"""
|
|
525
|
-
return DigitizerDataFetch.fetch_voltage_data_sampling_mode_custom(spike_safe_socket, time_sampling_mode, custom_sequence, hardware_trigger_delay_microseconds, enable_logging)
|
|
539
|
+
return DigitizerDataFetch.fetch_voltage_data_sampling_mode_custom(spike_safe_socket, time_sampling_mode, custom_sequence, hardware_trigger_delay_microseconds, enable_logging, digitizer_number=digitizer_number)
|
|
526
540
|
|
|
527
541
|
def get_new_voltage_data_estimated_complete_time(aperture_microseconds, reading_count, hardware_trigger_count=None, hardware_trigger_delay_microseconds=None):
|
|
528
542
|
"""
|
|
@@ -530,8 +544,8 @@ def get_new_voltage_data_estimated_complete_time(aperture_microseconds, reading_
|
|
|
530
544
|
"""
|
|
531
545
|
return DigitizerDataFetch.get_new_voltage_data_estimated_complete_time(aperture_microseconds, reading_count, hardware_trigger_count, hardware_trigger_delay_microseconds)
|
|
532
546
|
|
|
533
|
-
def wait_for_new_voltage_data(spike_safe_socket, wait_time = 0.0, enable_logging = None, timeout = None):
|
|
547
|
+
def wait_for_new_voltage_data(spike_safe_socket, wait_time = 0.0, enable_logging = None, timeout = None, digitizer_number=None):
|
|
534
548
|
"""
|
|
535
549
|
Obsolete: Use DigitizerDataFetch.wait_for_new_voltage_data() instead.
|
|
536
550
|
"""
|
|
537
|
-
return DigitizerDataFetch.wait_for_new_voltage_data(spike_safe_socket, wait_time, enable_logging, timeout)
|
|
551
|
+
return DigitizerDataFetch.wait_for_new_voltage_data(spike_safe_socket, wait_time, enable_logging, timeout, digitizer_number=digitizer_number)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: spikesafe-python
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.10.2
|
|
4
4
|
Summary: SpikeSafe Python Library
|
|
5
5
|
Author-email: Vektrex <support@vektrex.com>
|
|
6
6
|
Classifier: Programming Language :: Python :: 3
|
|
@@ -26,6 +26,8 @@ GitHub Repository: [SpikeSafe Python Samples](https://github.com/VektrexElectron
|
|
|
26
26
|
|
|
27
27
|
Library help documentation: [spikesafe_python_lib_docs](https://github.com/VektrexElectronicSystems/SpikeSafePythonSamples/tree/master/spikesafe_python_lib_docs)
|
|
28
28
|
|
|
29
|
+
Release notes: [spikesafe_python_lib_docs/_releases](https://github.com/VektrexElectronicSystems/SpikeSafePythonSamples/tree/master/spikesafe_python_lib_docs/_releases)
|
|
30
|
+
|
|
29
31
|
## About
|
|
30
32
|
|
|
31
33
|
The **spikesafe-python** package provides light-weight access Python helper classes and functions to easily communicate with to your SpikeSafe and parse data into easy to use objects.
|
{spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/tests/test_digitizer_fetch_time_of_sampling.py
RENAMED
|
@@ -431,4 +431,79 @@ def test_fetch_voltage_data_sampling_mode_custom_trigger_delay(custom_sequence,
|
|
|
431
431
|
|
|
432
432
|
# Ensure the mocked methods were called correctly
|
|
433
433
|
mock_socket.send_scpi_command.assert_called_once_with('VOLT:FETC?', None)
|
|
434
|
-
mock_socket.read_data.assert_called_once()
|
|
434
|
+
mock_socket.read_data.assert_called_once()
|
|
435
|
+
|
|
436
|
+
def test_fetch_voltage_data_with_digitizer_number():
|
|
437
|
+
mock_socket = MagicMock()
|
|
438
|
+
mock_socket.read_data.return_value = "1.0,2.0,3.0"
|
|
439
|
+
result = spikesafe_python.DigitizerDataFetch.fetch_voltage_data(
|
|
440
|
+
spike_safe_socket=mock_socket,
|
|
441
|
+
enable_logging=None,
|
|
442
|
+
digitizer_number=2
|
|
443
|
+
)
|
|
444
|
+
mock_socket.send_scpi_command.assert_called_once_with('VOLT2:FETC?', None)
|
|
445
|
+
mock_socket.read_data.assert_called_once()
|
|
446
|
+
assert [d.voltage_reading for d in result] == [1.0, 2.0, 3.0]
|
|
447
|
+
|
|
448
|
+
def test_fetch_voltage_data_sampling_mode_linear_with_digitizer_number():
|
|
449
|
+
mock_socket = MagicMock()
|
|
450
|
+
mock_socket.read_data.return_value = "1.0,2.0,3.0"
|
|
451
|
+
result = spikesafe_python.DigitizerDataFetch.fetch_voltage_data_sampling_mode_linear(
|
|
452
|
+
spike_safe_socket=mock_socket,
|
|
453
|
+
time_sampling_mode=spikesafe_python.DigitizerEnums.TimeSamplingMode.MIDDLE_OF_TIME,
|
|
454
|
+
aperture_microseconds=2,
|
|
455
|
+
reading_count=3,
|
|
456
|
+
hardware_trigger_delay_microseconds=0,
|
|
457
|
+
pulse_period_seconds=0,
|
|
458
|
+
digitizer_number=2
|
|
459
|
+
)
|
|
460
|
+
mock_socket.send_scpi_command.assert_called_once_with('VOLT2:FETC?', None)
|
|
461
|
+
mock_socket.read_data.assert_called_once()
|
|
462
|
+
assert [d.voltage_reading for d in result] == [1.0, 2.0, 3.0]
|
|
463
|
+
|
|
464
|
+
def test_fetch_voltage_data_sampling_mode_logarithmic_with_digitizer_number():
|
|
465
|
+
mock_socket = MagicMock()
|
|
466
|
+
mock_socket.read_data.return_value = "1.0,2.0,3.0"
|
|
467
|
+
result = spikesafe_python.DigitizerDataFetch.fetch_voltage_data_sampling_mode_logarithmic(
|
|
468
|
+
spike_safe_socket=mock_socket,
|
|
469
|
+
time_sampling_mode=spikesafe_python.DigitizerEnums.TimeSamplingMode.MIDDLE_OF_TIME,
|
|
470
|
+
sampling_mode=spikesafe_python.DigitizerEnums.SamplingMode.FAST_LOG,
|
|
471
|
+
hardware_trigger_delay_microseconds=0,
|
|
472
|
+
enable_logging=None,
|
|
473
|
+
digitizer_number=2
|
|
474
|
+
)
|
|
475
|
+
mock_socket.send_scpi_command.assert_called_once_with('VOLT2:FETC?', None)
|
|
476
|
+
mock_socket.read_data.assert_called_once()
|
|
477
|
+
assert [d.voltage_reading for d in result] == [1.0, 2.0, 3.0]
|
|
478
|
+
|
|
479
|
+
def test_fetch_voltage_data_sampling_mode_custom_with_digitizer_number():
|
|
480
|
+
mock_socket = MagicMock()
|
|
481
|
+
mock_socket.read_data.return_value = "1.0,2.0,3.0"
|
|
482
|
+
result = spikesafe_python.DigitizerDataFetch.fetch_voltage_data_sampling_mode_custom(
|
|
483
|
+
spike_safe_socket=mock_socket,
|
|
484
|
+
time_sampling_mode=spikesafe_python.DigitizerEnums.TimeSamplingMode.MIDDLE_OF_TIME,
|
|
485
|
+
custom_sequence="1@2,1@4,1@6",
|
|
486
|
+
hardware_trigger_delay_microseconds=0,
|
|
487
|
+
enable_logging=None,
|
|
488
|
+
digitizer_number=2
|
|
489
|
+
)
|
|
490
|
+
mock_socket.send_scpi_command.assert_called_once_with('VOLT2:FETC?', None)
|
|
491
|
+
mock_socket.read_data.assert_called_once()
|
|
492
|
+
assert [d.voltage_reading for d in result] == [1.0, 2.0, 3.0]
|
|
493
|
+
|
|
494
|
+
def test_wait_for_new_voltage_data_with_digitizer_number():
|
|
495
|
+
mock_socket = MagicMock()
|
|
496
|
+
# Simulate the digitizer not ready on first call, ready on second
|
|
497
|
+
mock_socket.read_data.side_effect = ["FALSE","TRUE"]
|
|
498
|
+
result = spikesafe_python.DigitizerDataFetch.wait_for_new_voltage_data(
|
|
499
|
+
spike_safe_socket=mock_socket,
|
|
500
|
+
wait_time=0.0,
|
|
501
|
+
enable_logging=None,
|
|
502
|
+
timeout=None,
|
|
503
|
+
digitizer_number=2
|
|
504
|
+
)
|
|
505
|
+
# Should call send_scpi_command twice with the correct digitizer number
|
|
506
|
+
expected_cmd = 'VOLT2:NDAT?'
|
|
507
|
+
actual_calls = mock_socket.send_scpi_command.call_args_list
|
|
508
|
+
assert all(call[0][0] == expected_cmd for call in actual_calls)
|
|
509
|
+
assert mock_socket.send_scpi_command.call_count == 2
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/DigitizerVfCustomSequence.py
RENAMED
|
File without changes
|
{spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python/DigitizerVfCustomSequenceStep.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/spikesafe_python.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/tests/test_optimum_pulse_width_correction.py
RENAMED
|
File without changes
|
{spikesafe_python-1.9.7 → spikesafe_python-1.10.2}/tests/test_optimum_pulse_width_correction_old.py
RENAMED
|
File without changes
|