Skip to content

Commit be9b137

Browse files
author
cint-transport
committed
fix(driver Stanford830): learned to spell, fixed test notebook bug
1 parent 0f8cedd commit be9b137

File tree

3 files changed

+72
-107
lines changed

3 files changed

+72
-107
lines changed

drivers_test_notebooks/srs830_test_notebook.ipynb

Lines changed: 53 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -74,65 +74,37 @@
7474
"metadata": {
7575
"metadata": {}
7676
},
77-
"outputs": [
78-
{
79-
"data": {
80-
"text/plain": [
81-
"'Stanford_Research_Systems,SR830,s/n86813,ver1.07 \\n'"
82-
]
83-
},
84-
"execution_count": 3,
85-
"metadata": {},
86-
"output_type": "execute_result"
87-
}
88-
],
89-
"source": [
90-
"name"
91-
]
92-
},
93-
{
94-
"cell_type": "code",
95-
"execution_count": 4,
96-
"metadata": {
97-
"metadata": {}
98-
},
9977
"outputs": [
10078
{
10179
"name": "stdout",
10280
"output_type": "stream",
10381
"text": [
10482
"Blacklisted settings that will not be tested or changed are: \n",
105-
"[('_amplitude', 0.496), ('_input_configuration', 'A-B'), ('_time_constant', 30)]\n",
106-
"\n",
107-
"Beginning tests for: Stanford830 version 1.0.1\n",
83+
"[('_amplitude', 0.028),\n",
84+
" ('_input_configuration', 'A-B'),\n",
85+
" ('_sensitivity', 0.005),\n",
86+
" ('_time_constant', 1)]\n",
10887
"\n",
109-
"7 range properties found and tested out of 26 total settings found.\n",
110-
"0 values properties found and tested out of 26 total settings found.\n",
111-
"12 indexed values properties found and tested out of 26 total settings found.\n",
112-
"2 dict values properties found and tested out of 26 total settings found.\n",
113-
"3 blacklisted settings not testing (likely due to interdependencies not suitable for automated testing)\n",
114-
"21 properties tested out of 26 total settings.\n",
115-
"\n",
116-
"Restored settings are different for the following: {('id', 'Stanford_Research_Systems,SR830,s/n86813,ver1.07 '), ('buffer_points', 16383)}\n",
117-
"\n",
118-
"\n",
119-
"\u001b[92m Property implementation tests passed, instrument: Stanford830 looks ready to go. \u001b[0m\n",
120-
"Checking driver doc string.\n",
121-
"\u001b[92m Docstring tests passed and looking good. \u001b[0m\n",
122-
"The new test log for this driver is: Passed with stanford830 version v1.0.1 tested on pyscan version v0.8.0 at 2024-10-01 10:01:28\n",
123-
"\u001b[1;32m Stanford830 test results logged. \u001b[0m\n"
88+
"Beginning tests for: Stanford830 version 1.0.2\n",
89+
"_id_settings\n",
90+
"_phase_settings\n",
91+
"_reference_source_settings\n",
92+
"_frequency_settings\n",
93+
"_reference_slope_settings\n",
94+
"_harmonic_settings\n",
95+
"_input_ground_settings\n",
96+
"_input_coupling_settings\n"
12497
]
12598
}
12699
],
127100
"source": [
128101
"srs830 = ps.Stanford830(res)\n",
129-
"\n",
130102
"test_driver(srs830, verbose=False)"
131103
]
132104
},
133105
{
134106
"cell_type": "code",
135-
"execution_count": 5,
107+
"execution_count": null,
136108
"metadata": {
137109
"metadata": {}
138110
},
@@ -188,7 +160,7 @@
188160
},
189161
{
190162
"cell_type": "code",
191-
"execution_count": 6,
163+
"execution_count": null,
192164
"metadata": {
193165
"metadata": {}
194166
},
@@ -214,16 +186,16 @@
214186
},
215187
{
216188
"cell_type": "code",
217-
"execution_count": 7,
189+
"execution_count": null,
218190
"metadata": {},
219191
"outputs": [
220192
{
221193
"name": "stdout",
222194
"output_type": "stream",
223195
"text": [
224-
"-1.09223e-07 -1.09223e-07\n",
225-
"1.0922e-07 1.0922e-07\n",
226-
"1.0922e-07 1.0922e-07\n"
196+
"-8.94074e-05 -4.76841e-07\n",
197+
"0.000385048 2.3842e-07\n",
198+
"-0.00506476 -9.53682e-07\n"
227199
]
228200
}
229201
],
@@ -254,22 +226,25 @@
254226
"\n",
255227
"\n",
256228
"srs830.set_channel_offset_expand(1, 0, 1)\n",
257-
"srs830.set_display(1, 'x', 'none')\n"
229+
"srs830.set_display(1, 'x', 'none')\n",
230+
"\n",
231+
"srs830.set_channel_offset_expand(2, 0, 1)\n",
232+
"srs830.set_display(2, 'y', 'none')\n"
258233
]
259234
},
260235
{
261236
"cell_type": "code",
262-
"execution_count": 8,
237+
"execution_count": null,
263238
"metadata": {},
264239
"outputs": [
265240
{
266241
"name": "stdout",
267242
"output_type": "stream",
268243
"text": [
269-
"0.002\n",
270-
"0.00233333\n",
271-
"0.003\n",
272-
"0.00266667\n"
244+
"0.000666667\n",
245+
"-0.000666667\n",
246+
"0.00566667\n",
247+
"0.000666667\n"
273248
]
274249
}
275250
],
@@ -284,17 +259,17 @@
284259
},
285260
{
286261
"cell_type": "code",
287-
"execution_count": 9,
262+
"execution_count": null,
288263
"metadata": {},
289264
"outputs": [
290265
{
291266
"name": "stdout",
292267
"output_type": "stream",
293268
"text": [
294-
"-1.09223e-07\n",
295-
"1.0922e-07\n",
296-
"1.0922e-07\n",
297-
"7734.592992720247\n"
269+
"-8.98843e-05\n",
270+
"0.000384809\n",
271+
"-7.15259e-07\n",
272+
"5908.116590643592\n"
298273
]
299274
}
300275
],
@@ -309,15 +284,15 @@
309284
},
310285
{
311286
"cell_type": "code",
312-
"execution_count": 10,
287+
"execution_count": null,
313288
"metadata": {},
314289
"outputs": [
315290
{
316291
"name": "stdout",
317292
"output_type": "stream",
318293
"text": [
319-
"-1.09223e-07\n",
320-
"1.0922e-07\n"
294+
"-8.98843e-05\n",
295+
"0.000384809\n"
321296
]
322297
}
323298
],
@@ -330,23 +305,23 @@
330305
},
331306
{
332307
"cell_type": "code",
333-
"execution_count": 11,
308+
"execution_count": null,
334309
"metadata": {},
335310
"outputs": [
336311
{
337312
"name": "stdout",
338313
"output_type": "stream",
339314
"text": [
340-
"[-1.09223e-07, 1.0922e-07]\n",
341-
"[-1.09223e-07, 1.0922e-07]\n",
342-
"[-1.09223e-07, 7733.217892850435]\n",
343-
"[-1.09223e-07, 0.0]\n",
344-
"[-1.09223e-07, 0.001]\n",
345-
"[-1.09223e-07, 0.00166667]\n",
346-
"[-1.09223e-07, 0.004]\n",
347-
"[-1.09223e-07, 1000.0]\n",
348-
"[-1.09223e-07, -1.09223e-07]\n",
349-
"[-1.09223e-07, 1.0922e-07]\n"
315+
"[-8.98843e-05, 0.000385048]\n",
316+
"[-8.98843e-05, -9.53682e-07]\n",
317+
"[-8.98843e-05, 5909.491690513403]\n",
318+
"[-8.98843e-05, 0.000666667]\n",
319+
"[-8.98843e-05, -0.000666667]\n",
320+
"[-8.98843e-05, 0.00166667]\n",
321+
"[-8.96459e-05, -0.01]\n",
322+
"[-8.98843e-05, 1000.0]\n",
323+
"[-8.98843e-05, -8.98843e-05]\n",
324+
"[-8.98843e-05, 0.000384809]\n"
350325
]
351326
}
352327
],
@@ -367,7 +342,7 @@
367342
},
368343
{
369344
"cell_type": "code",
370-
"execution_count": 13,
345+
"execution_count": null,
371346
"metadata": {},
372347
"outputs": [
373348
{
@@ -388,20 +363,9 @@
388363
},
389364
{
390365
"cell_type": "code",
391-
"execution_count": 15,
366+
"execution_count": null,
392367
"metadata": {},
393-
"outputs": [
394-
{
395-
"data": {
396-
"text/plain": [
397-
"159"
398-
]
399-
},
400-
"execution_count": 15,
401-
"metadata": {},
402-
"output_type": "execute_result"
403-
}
404-
],
368+
"outputs": [],
405369
"source": [
406370
"# test buffer_points\n",
407371
"\n",
@@ -412,7 +376,8 @@
412376
"# srs830.start()\n",
413377
"srs830.trigger()\n",
414378
"sleep(20)\n",
415-
"srs830.buffer_points\n"
379+
"srs830.buffer_points\n",
380+
"srs830.pause()\n"
416381
]
417382
}
418383
],
@@ -432,7 +397,7 @@
432397
"name": "python",
433398
"nbconvert_exporter": "python",
434399
"pygments_lexer": "ipython3",
435-
"version": "3.12.2"
400+
"version": "3.12.4"
436401
}
437402
},
438403
"nbformat": 4,

pyscan/drivers/stanford830.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -76,17 +76,17 @@ class Stanford830(InstrumentDriver):
7676
display2_output_source : str
7777
Gets/sets the displayed source on display 2
7878
Indexed values['y', 'display']
79-
auxillary_voltage1 : float
80-
Gets/sets the channel 1 auxillary output voltage
79+
auxiliary_voltage1 : float
80+
Gets/sets the channel 1 auxiliary output voltage
8181
range - [-10.5, 10.500]
82-
auxillary_voltage2 : float
83-
Gets/sets the channel 2 auxillary output voltage
82+
auxiliary_voltage2 : float
83+
Gets/sets the channel 2 auxiliary output voltage
8484
range - [-10.5, 10.500]
85-
auxillary_voltage3 : float
86-
Gets/sets the channel 3 auxillary output voltage
85+
auxiliary_voltage3 : float
86+
Gets/sets the channel 3 auxiliary output voltage
8787
range - [-10.5, 10.500]
88-
auxillary_voltage4 : float
89-
Gets/sets the channel 4 auxillary output voltage
88+
auxiliary_voltage4 : float
89+
Gets/sets the channel 4 auxiliary output voltage
9090
range - [-10.5, 10.500]
9191
sample_rate : float
9292
Get/sets the sample rate in Hz
@@ -136,7 +136,7 @@ def __init__(self, instrument):
136136
super().__init__(instrument)
137137

138138
self.debug = False
139-
self._version = "1.0.2"
139+
self._version = "1.0.3"
140140

141141
self.black_list_for_testing = [
142142
'_input_configuration',
@@ -297,31 +297,31 @@ def initialize_properties(self):
297297
'indexed_values': ['y', 'display'],
298298
'return_type': int})
299299

300-
# Auxillary Input/Ouput Properties
300+
# auxiliary Input/Ouput Properties
301301

302302
self.add_device_property({
303-
'name': 'auxillary_voltage1',
303+
'name': 'auxiliary_voltage1',
304304
'write_string': 'AUXV 1, {}',
305305
'query_string': 'AUXV? 1',
306306
'range': [-10.5, 10.500],
307307
'return_type': float})
308308

309309
self.add_device_property({
310-
'name': 'auxillary_voltage2',
310+
'name': 'auxiliary_voltage2',
311311
'write_string': 'AUXV 2, {}',
312312
'query_string': 'AUXV? 2',
313313
'range': [-10.5, 10.500],
314314
'return_type': float})
315315

316316
self.add_device_property({
317-
'name': 'auxillary_voltage3',
317+
'name': 'auxiliary_voltage3',
318318
'write_string': 'AUXV 3, {}',
319319
'query_string': 'AUXV? 3',
320320
'range': [-10.5, 10.500],
321321
'return_type': float})
322322

323323
self.add_device_property({
324-
'name': 'auxillary_voltage4',
324+
'name': 'auxiliary_voltage4',
325325
'write_string': 'AUXV 4, {}',
326326
'query_string': 'AUXV? 4',
327327
'range': [-10.5, 10.500],
@@ -478,20 +478,20 @@ def set_channel_offset_expand(self, channel, offset, expand):
478478

479479
self.write('OEXP {}, {}, {}'.format(channel, offset, index))
480480

481-
# Auxillary Input/Ouptut Methods
481+
# auxiliary Input/Ouptut Methods
482482

483483
def read_aux_input(self, index):
484484
'''
485-
Reads the voltage input to an auxillary input channel
485+
Reads the voltage input to an auxiliary input channel
486486
487487
Parameters
488488
----------
489489
index: int
490-
Auxillary input channel number 1, 2, 3, or 4
490+
auxiliary input channel number 1, 2, 3, or 4
491491
'''
492492

493493
indicies = [1, 2, 3, 4]
494-
assert index in indicies, 'Auxillary input index must be 1, 2, 3, or 4'
494+
assert index in indicies, 'auxiliary input index must be 1, 2, 3, or 4'
495495

496496
return float(self.query('OAUX ? {}'.format(index)))
497497

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Passed with stanford830 version v1.0.2 tested on pyscan version v0.8.0 at 2024-10-01 18:31:03
1+
Passed with stanford830 version v1.0.3 tested on pyscan version v0.8.0 at 2024-10-02 10:40:42

0 commit comments

Comments
 (0)