qcodespp 0.1.2__tar.gz → 0.1.3__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 (85) hide show
  1. {qcodespp-0.1.2 → qcodespp-0.1.3}/PKG-INFO +1 -1
  2. {qcodespp-0.1.2 → qcodespp-0.1.3}/pyproject.toml +1 -1
  3. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/data/data_set.py +2 -0
  4. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/loops.py +32 -6
  5. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/parameters.py +147 -13
  6. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/plotting/offline/editor.py +1 -1
  7. qcodespp-0.1.3/qcodespp/utils/__init__.py +0 -0
  8. qcodespp-0.1.3/qcodespp/version.py +1 -0
  9. qcodespp-0.1.2/qcodespp/version.py +0 -1
  10. {qcodespp-0.1.2 → qcodespp-0.1.3}/LICENSE +0 -0
  11. {qcodespp-0.1.2 → qcodespp-0.1.3}/README.rst +0 -0
  12. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/__init__.py +0 -0
  13. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/actions.py +0 -0
  14. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/data/__init__.py +0 -0
  15. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/data/data_array.py +0 -0
  16. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/data/format.py +0 -0
  17. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/data/gnuplot_format.py +0 -0
  18. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/data/hdf5_format.py +0 -0
  19. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/data/hdf5_format_hickle.py +0 -0
  20. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/data/io.py +0 -0
  21. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/data/location.py +0 -0
  22. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/Keysight/Keysight_34450A.py +0 -0
  23. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/Keysight/__init__.py +0 -0
  24. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/Keysight/private/Keysight_344xxA.py +0 -0
  25. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/Keysight/private/__init__.py +0 -0
  26. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/Lakeshore/Model_340.py +0 -0
  27. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/Lakeshore/__init__.py +0 -0
  28. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/QDevil/159fit_params_high_latest.json +0 -0
  29. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/QDevil/159fit_params_low_latest.json +0 -0
  30. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/QDevil/71fit_params_high_latest.json +0 -0
  31. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/QDevil/71fit_params_low_latest.json +0 -0
  32. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/QDevil/QDAC2.py +0 -0
  33. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/QDevil/QDAC2_Array.py +0 -0
  34. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/QDevil/QSwitch_elab.py +0 -0
  35. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/QDevil/__init__.py +0 -0
  36. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/ZI/ZIHF2LI.py +0 -0
  37. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/ZI/ZIMFLI.py +0 -0
  38. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/ZI/ZIMFLI_sync.py +0 -0
  39. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/ZI/__init__.py +0 -0
  40. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/__init__.py +0 -0
  41. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/cryogenic/CryogenicSMS120C.py +0 -0
  42. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/cryogenic/__init__.py +0 -0
  43. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/instrument_mocks.py +0 -0
  44. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/multiplexer_instrument.py +0 -0
  45. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/national_instruments/PXI_4461.py +0 -0
  46. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/national_instruments/PXI_4462.py +0 -0
  47. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/national_instruments/PXI_6259.py +0 -0
  48. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/national_instruments/PXI_6733.py +0 -0
  49. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/national_instruments/PXI_6733_e.py +0 -0
  50. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/national_instruments/__init__.py +0 -0
  51. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/oxford/__init__.py +0 -0
  52. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/oxford/mercuryiPS_serial.py +0 -0
  53. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/oxford/serial.py +0 -0
  54. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/oxford/triton.py +0 -0
  55. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/tektronix/Keithley_2000_Scan.py +0 -0
  56. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/tektronix/Keithley_2182a.py +0 -0
  57. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/tektronix/Keithley_2450.py +0 -0
  58. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/tektronix/Keithley_2700.py +0 -0
  59. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/tektronix/__init__.py +0 -0
  60. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/wir/Kepco.py +0 -0
  61. {qcodespp-0.1.2/qcodespp/instrument_drivers/yokogawa → qcodespp-0.1.3/qcodespp/instrument_drivers/wir}/__init__.py +0 -0
  62. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/instrument_drivers/yokogawa/GS200.py +0 -0
  63. {qcodespp-0.1.2/qcodespp/plotting → qcodespp-0.1.3/qcodespp/instrument_drivers/yokogawa}/__init__.py +0 -0
  64. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/measure.py +0 -0
  65. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/plotting/RemotePlot.py +0 -0
  66. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/plotting/RemotePlotClient.py +0 -0
  67. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/plotting/RemoteQtPlotWidgets.py +0 -0
  68. {qcodespp-0.1.2/qcodespp/plotting/offline → qcodespp-0.1.3/qcodespp/plotting}/__init__.py +0 -0
  69. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/plotting/analysis_tools.py +0 -0
  70. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/plotting/colors.py +0 -0
  71. {qcodespp-0.1.2/qcodespp/utils → qcodespp-0.1.3/qcodespp/plotting/offline}/__init__.py +0 -0
  72. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/plotting/offline/datatypes.py +0 -0
  73. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/plotting/offline/design.py +0 -0
  74. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/plotting/offline/design.ui +0 -0
  75. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/plotting/offline/filters.py +0 -0
  76. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/plotting/offline/fits.py +0 -0
  77. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/plotting/offline/helpers.py +0 -0
  78. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/plotting/offline/iconGadget.png +0 -0
  79. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/plotting/offline/main.py +0 -0
  80. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/plotting/offline/popupwindows.py +0 -0
  81. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/plotting/offline/qcodes_pp_extension.py +0 -0
  82. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/plotting/offline/sidebars.py +0 -0
  83. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/station.py +0 -0
  84. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/utils/helpers.py +0 -0
  85. {qcodespp-0.1.2 → qcodespp-0.1.3}/qcodespp/utils/visa_helpers.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qcodespp
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: Package providing additional functions for QCoDeS
5
5
  Maintainer-email: Damon Carrad <damonc@dtu.dk>
6
6
  Requires-Python: >=3.10
@@ -5,7 +5,7 @@ build-backend = 'flit_core.buildapi'
5
5
 
6
6
  [project]
7
7
  name = "qcodespp"
8
- version = '0.1.2'
8
+ version = '0.1.3'
9
9
  maintainers = [{name = "Damon Carrad", email = "damonc@dtu.dk"}]
10
10
  description = "Package providing additional functions for QCoDeS"
11
11
  classifiers = [
@@ -274,6 +274,8 @@ class DataSetPP(DelegateAttributes):
274
274
  default_formatter = GNUPlotFormat()
275
275
  location_provider = FormatLocation()
276
276
 
277
+ default_folder=None
278
+
277
279
  background_functions: Dict[str, Callable] = OrderedDict()
278
280
 
279
281
  def __init__(self, location=None, arrays=None, formatter=None, io=None,
@@ -123,7 +123,10 @@ def loop1d(sweep_parameter,
123
123
  if measure:
124
124
  Station.default.set_measurement(*measure)
125
125
  loop=Loop(sweep_parameter.sweep(start,stop,num=num), delay).each(*Station.default.measure())
126
- name=f'{device_info} {sweep_parameter.full_name}({start:.6g} {stop:.6g}){sweep_parameter.unit} with {instrument_info}'
126
+
127
+ start_text, stop_text, unit_text = _filename_text(start, stop, sweep_parameter)
128
+
129
+ name=f'{device_info} {sweep_parameter.full_name}({start_text} {stop_text}){unit_text} with {instrument_info}'
127
130
  data=loop.get_data_set(name=name)
128
131
  if plot:
129
132
  pp=live_plot(data,plot)
@@ -208,8 +211,11 @@ def loop2d(sweep_parameter,
208
211
  else:
209
212
  loop2d=Loop(step_parameter.sweep(step_start,step_stop,num=step_num), step_delay,snake=snake).each(loop)
210
213
 
211
- name=(f'{device_info} {step_parameter.full_name}({step_start:.6g} {step_stop:.6g}){sweep_parameter.unit} '
212
- f'{sweep_parameter.full_name}({start:.6g} {stop:.6g}){sweep_parameter.unit} with {instrument_info}')
214
+ start_text, stop_text, unit_text = _filename_text(start, stop, sweep_parameter)
215
+ step_start_text, step_stop_text, step_unit_text = _filename_text(step_start, step_stop, step_parameter)
216
+
217
+ name=(f'{device_info} {step_parameter.full_name}({step_start_text} {step_stop_text}){step_unit_text} '
218
+ f'{sweep_parameter.full_name}({start_text} {stop_text}){unit_text} with {instrument_info}')
213
219
  data=loop2d.get_data_set(name=name)
214
220
 
215
221
  if plot:
@@ -297,8 +303,11 @@ def loop2dUD(sweep_parameter,
297
303
  else:
298
304
  loop2d=Loop(step_parameter.sweep(step_start,step_stop,num=step_num), step_delay).each(loop,loop_down)
299
305
 
300
- name=(f'{device_info} {step_parameter.full_name}({step_start:.6g} {step_stop:.6g}){sweep_parameter.unit} '
301
- f'{sweep_parameter.full_name}({start:.6g} {stop:.6g}){sweep_parameter.unit} with {instrument_info}')
306
+ start_text, stop_text, unit_text = _filename_text(start, stop, sweep_parameter)
307
+ step_start_text, step_stop_text, step_unit_text = _filename_text(step_start, step_stop, step_parameter)
308
+
309
+ name=(f'{device_info} {step_parameter.full_name}({step_start_text} {step_stop_text}){step_unit_text} '
310
+ f'{sweep_parameter.full_name}({start_text} {stop_text}){unit_text} with {instrument_info}')
302
311
  data=loop2d.get_data_set(name=name)
303
312
 
304
313
  if plot:
@@ -311,6 +320,23 @@ def loop2dUD(sweep_parameter,
311
320
 
312
321
  return loop2d
313
322
 
323
+ def _filename_text(start,stop,parameter):
324
+ '''
325
+ Function to deal with MultiParameter sweeps, where the filename text can become complicted
326
+ '''
327
+ if isinstance(start, tuple):
328
+ start_text= ','.join([f'{s:.6g}' for s in start])
329
+ start_text=f'({start_text})'
330
+ stop_text= ','.join([f'{s:.6g}' for s in stop])
331
+ stop_text=f'({stop_text})'
332
+ unit_text= ','.join([unit for unit in parameter.units])
333
+ unit_text=f'({unit_text})'
334
+ else:
335
+ start_text= f'{start:.6g}'
336
+ stop_text= f'{stop:.6g}'
337
+ unit_text= parameter.unit
338
+ return start_text, stop_text, unit_text
339
+
314
340
  class Loop(Metadatable):
315
341
  """
316
342
  Create a measurement loop to sweep over a parameter and store measured data from other
@@ -986,7 +1012,7 @@ class ActiveLoop(Metadatable):
986
1012
  if isinstance(action, ActiveLoop):
987
1013
  estimate=estimate+self.sweep_values.snapshot()['values'][0]['num']*action.sweep_values.snapshot()['values'][0]['num']*(commtime+action.delay+extra_delay[1])
988
1014
 
989
- string=(f'Estimated time: {estimate} s, {estimate/60} mins, {estimate/3600} hours\n'
1015
+ string=(f'Estimated time: {estimate:.2f} s / {estimate/60:.2f} mins / {estimate/3600:.2f} hours\n'
990
1016
  f'Done at: {time.asctime(time.localtime(time.time()+estimate))}')
991
1017
  return string
992
1018
 
@@ -1,6 +1,8 @@
1
1
  """A collection of functions that get added to the QCoDeS Parameter class.
2
2
 
3
- In addition, two wrapper classes are provided to easily create ArrayParameters and MultiParameters."""
3
+ In addition, two wrapper classes are provided to easily create ArrayParameters and MultiParameters.
4
+ MultiParameters created with this method become settable, sweepable and movable.
5
+ """
4
6
 
5
7
  import time
6
8
 
@@ -10,9 +12,15 @@ from qcodes.parameters import (
10
12
  ArrayParameter,
11
13
  MultiParameter,
12
14
  Parameter,
13
- SweepFixedValues,
15
+ ParameterBase,
16
+ SweepFixedValues
14
17
  )
15
18
 
19
+ from typing import Any
20
+
21
+ from qcodes.parameters.sequence_helpers import is_sequence
22
+ from qcodes.parameters.sweep_values import make_sweep
23
+
16
24
  def move(self,end_value,steps=101,step_time=0.03):
17
25
  """
18
26
  Move the parameter to a new value in a number of steps without taking data.
@@ -216,6 +224,52 @@ class ArrayParameterWrapper(ArrayParameter):
216
224
 
217
225
  super().__init__(name=name, shape=shape,instrument=instrument,label=label,unit=unit)
218
226
 
227
+ class SweepMultiValues(SweepFixedValues):
228
+ '''
229
+ Class to enable sweeping MultiParameters with different values for each parameter.
230
+
231
+ Simply a subclass of SweepFixedValues with a restricted set of options to ensure that the
232
+ setpoints are constructed correctly.
233
+
234
+ Args:
235
+ parameter (MultiParameter): The MultiParameter to sweep.
236
+ keys (list): A list of lists, where each inner list contains the setpoints for each
237
+ parameter at that sweep index.
238
+ '''
239
+ def __init__(
240
+ self,
241
+ parameter: ParameterBase,
242
+ keys: Any | None = None):
243
+
244
+ super().__init__(parameter,keys)
245
+ # Initialising the parent class constructs the setpoints incorrectly,
246
+ # so reset self._values to an empty list.
247
+ self._values: list[Any] = []
248
+ self._snapshot: dict[str, Any] = {}
249
+ self._value_snapshot: list[dict[str, Any]] = []
250
+
251
+ if isinstance(keys, slice):
252
+ self._add_slice(keys)
253
+ self._add_linear_snapshot(self._values)
254
+
255
+ elif is_sequence(keys):
256
+ for key in keys:
257
+ if isinstance(key, slice):
258
+ self._add_slice(key)
259
+ else:
260
+ # assume a single value
261
+ self._values.append(key)
262
+ # we dont want the snapshot to go crazy on big data
263
+ if self._values:
264
+ self._add_sequence_snapshot(self._values)
265
+
266
+ else:
267
+ # assume a single value
268
+ self._values.append(keys)
269
+ self._value_snapshot.append({"item": keys})
270
+
271
+ self.validate(self._values)
272
+
219
273
  class MultiParameterWrapper(MultiParameter):
220
274
  """
221
275
  Class to wrap multiple pre-existing parameters into MultiParameter. Enables getting, setting, sweeping and moving.
@@ -271,12 +325,28 @@ class MultiParameterWrapper(MultiParameter):
271
325
 
272
326
  self.labels=tuple(labels)
273
327
  self.units=tuple(units)
328
+ self.unit='' # Mainly to be compatible with automatic naming in loop1d,loop2d, etc.
274
329
 
275
330
  def get_raw(self):
331
+ '''
332
+ Method to get the values of all parameters in the MultiParameter.
333
+
334
+ Returns:
335
+ tuple: A tuple containing the values of all parameters in the MultiParameter.
336
+ '''
276
337
  return tuple([param.get() for param in self.parameters])
277
338
 
278
339
  def set_raw(self, values):
279
- if type(values) is int or type(values) is float:
340
+ """
341
+ Method to set the values of all parameters in the MultiParameter.
342
+
343
+ Args:
344
+ values (list, tuple, int, float): The values to set for the parameters.
345
+ If a single value is provided, it will be set for all parameters.
346
+ If a list or tuple is provided, it must match the number of parameters.
347
+ """
348
+
349
+ if type(values) in [int, float]:
280
350
  for parameter in self.parameters:
281
351
  parameter.set(values)
282
352
  elif numpy.array(values).shape != numpy.array(self.parameters).shape:
@@ -286,26 +356,90 @@ class MultiParameterWrapper(MultiParameter):
286
356
  self.parameters[i].set(value)
287
357
 
288
358
  def move(self,end_values,steps=101,step_time=0.03):
289
- if type(end_values) is int or type(end_values) is float:
359
+ """
360
+ Move all parameters to new values in a number of steps without taking data.
361
+
362
+ Args:
363
+ end_values (list, tuple, int, float): The values to move to.
364
+ If a single value is provided, it will be moved for all parameters.
365
+ If a list or tuple is provided, it must match the number of parameters.
366
+ steps (int, optional): Number of steps to take. Defaults to 101.
367
+ step_time (float, optional): Time in seconds between each step. Defaults to 0.03.
368
+ """
369
+
370
+ if type(end_values) in [int, float]:
290
371
  for i,param in enumerate(self.parameters):
291
372
  param.move(end_values,steps,step_time)
292
373
  else:
293
374
  for i,param in enumerate(self.parameters):
294
375
  param.move(list(end_values)[i],steps,step_time)
295
376
 
296
- def sweep(self, start_vals,stop_vals,num):
377
+ def sweep(self, start_vals,stop_vals,num,print_warning=True):
378
+ """
379
+ Create a collection of parameter values to be iterated over for all parameters in the MultiParameter.
380
+
381
+ Args:
382
+ start_vals (list, tuple, int, float): The starting values of the sequence.
383
+ If a single value is provided, it will be used for all parameters.
384
+ If a list or tuple is provided, it must match the number of parameters.
385
+
386
+ stop_vals (list, tuple, int, float): The end values of the sequence.
387
+ If a single value is provided, it will be used for all parameters.
388
+ If a list or tuple is provided, it must match the number of parameters.
389
+
390
+ num (int): Number of values to generate.
391
+
392
+ print_warning (bool): Whether to print a warning if the start value is different from the
393
+ current value. Defaults to True.
394
+
395
+ Returns:
396
+ SweepFixedValues or SweepMultiValues: A collection of parameter values to be iterated over which can be passed to a Loop.
397
+
398
+ Raises:
399
+ ValueError: If the number of start_vals or stop_vals does not match the number of parameters,
400
+ or if they are not a single value.
401
+ """
402
+
297
403
  #If the user is sweeping all params with the same values, the case is the same as Parameter.sweep
298
- if numpy.array(start_vals).shape == ():
404
+ if type(start_vals) in [int, float]:
405
+ # Check that the start and stop values are the same shape
299
406
  if numpy.array(start_vals).shape != numpy.array(stop_vals).shape:
300
407
  raise ValueError('Number of start values must match number of stop values')
408
+
409
+ # Warn the user if the start value is different from any of the current values
410
+ sweeprange= numpy.abs(stop_vals - start_vals)
411
+ for i,parameter in enumerate(self.parameters):
412
+ try:
413
+ if print_warning and numpy.abs(parameter.get()-start_vals)>sweeprange*1e-3:
414
+ print(f'Are you sure? Start value for {parameter.name} sweep is '
415
+ f'{start_vals} {parameter.unit} but '
416
+ f'{parameter.name}()={parameter.get()} {parameter.unit}')
417
+ except TypeError: #Sometimes a parameter (especially a dummy parameter) will return None if it has not been set yet.
418
+ pass
419
+
420
+ # return SweepFixedValues as for a Parameter
301
421
  return SweepFixedValues(self, start=start_vals, stop=stop_vals,num=num)
302
422
 
303
- #Otherwise, check that the shapes are correct, and make a setpointarray of the appropriate size for SweepFixedValues
423
+ # Otherwise, check that the shapes are correct, and make a setpointarray of the appropriate size
424
+ # for SweepMultiValues, after checking the start values are close to the current values.
304
425
  elif numpy.array(start_vals).shape != numpy.array(self.parameters).shape:
305
- raise ValueError('Number of start_vals must match number of parameters')
426
+ raise ValueError('Number of start_vals must match number of parameters, or be a signle value')
306
427
  elif numpy.array(stop_vals).shape != numpy.array(self.parameters).shape:
307
- raise ValueError('Number of stop_vals must match number of parameters')
308
- setpointarray=[]
309
- for j in range(num):
310
- setpointarray.append([start_vals[i] + (stop_vals[i] - start_vals[i])/(num-1) * j for i in range(numpy.array(self.parameters).shape[0])])
311
- return SweepFixedValues(self,setpointarray)
428
+ raise ValueError('Number of stop_vals must match number of parameters, or be a signle value')
429
+
430
+ else:
431
+ for i,parameter in enumerate(self.parameters):
432
+ sweeprange= numpy.abs(stop_vals[i] - start_vals[i])
433
+ try:
434
+ if print_warning and numpy.abs(parameter.get()-start_vals[i])>sweeprange*1e-3:
435
+ print(f'Are you sure? Start value for {parameter.name} sweep is '
436
+ f'{start_vals[i]} {parameter.unit} but '
437
+ f'{parameter.name}()={parameter.get()} {parameter.unit}')
438
+ except TypeError: #Sometimes a parameter (especially a dummy parameter) will return None if it has not been set yet.
439
+ pass
440
+
441
+ setpointarray=[]
442
+ for j in range(num):
443
+ setpointarray.append([start_vals[i] + (stop_vals[i] - start_vals[i])/(num-1) * j for i in range(numpy.array(self.parameters).shape[0])])
444
+ return SweepMultiValues(self,setpointarray)
445
+
@@ -215,7 +215,7 @@ class Editor(QtWidgets.QMainWindow, design.Ui_MainWindow):
215
215
  self.update_link_to_folder(folder=folder)
216
216
  except Exception as e:
217
217
  print(f'Failed to link to folder {folder}:', e)
218
- elif link_to_default and os.path.isdir(DataSetPP.default_folder):
218
+ elif link_to_default and DataSetPP.default_folder and os.path.isdir(DataSetPP.default_folder):
219
219
  try:
220
220
  print(f'Linking to qcodespp data folder at {DataSetPP.default_folder}... This may take some time.')
221
221
  self.update_link_to_folder(folder=DataSetPP.default_folder)
File without changes
@@ -0,0 +1 @@
1
+ __version__ = '0.1.3'
@@ -1 +0,0 @@
1
- __version__ = '0.1.2'
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes