spirack 0.2.19__tar.gz → 0.2.20__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 (32) hide show
  1. {spirack-0.2.19 → spirack-0.2.20}/PKG-INFO +1 -1
  2. {spirack-0.2.19 → spirack-0.2.20}/spirack/D5a_module.py +24 -24
  3. spirack-0.2.20/spirack/version.py +1 -0
  4. {spirack-0.2.19 → spirack-0.2.20}/spirack.egg-info/PKG-INFO +1 -1
  5. spirack-0.2.19/spirack/version.py +0 -1
  6. {spirack-0.2.19 → spirack-0.2.20}/LICENSE +0 -0
  7. {spirack-0.2.19 → spirack-0.2.20}/README.md +0 -0
  8. {spirack-0.2.19 → spirack-0.2.20}/setup.cfg +0 -0
  9. {spirack-0.2.19 → spirack-0.2.20}/setup.py +0 -0
  10. {spirack-0.2.19 → spirack-0.2.20}/spirack/B1b_module.py +0 -0
  11. {spirack-0.2.19 → spirack-0.2.20}/spirack/B2b_module.py +0 -0
  12. {spirack-0.2.19 → spirack-0.2.20}/spirack/D4_module.py +0 -0
  13. {spirack-0.2.19 → spirack-0.2.20}/spirack/D4a_module.py +0 -0
  14. {spirack-0.2.19 → spirack-0.2.20}/spirack/D4b_module.py +0 -0
  15. {spirack-0.2.19 → spirack-0.2.20}/spirack/D5b_module.py +0 -0
  16. {spirack-0.2.19 → spirack-0.2.20}/spirack/F1d_module.py +0 -0
  17. {spirack-0.2.19 → spirack-0.2.20}/spirack/M2j_module.py +0 -0
  18. {spirack-0.2.19 → spirack-0.2.20}/spirack/M2p_module.py +0 -0
  19. {spirack-0.2.19 → spirack-0.2.20}/spirack/P2d_module.py +0 -0
  20. {spirack-0.2.19 → spirack-0.2.20}/spirack/S4g_module.py +0 -0
  21. {spirack-0.2.19 → spirack-0.2.20}/spirack/S5i_module.py +0 -0
  22. {spirack-0.2.19 → spirack-0.2.20}/spirack/S5k_module.py +0 -0
  23. {spirack-0.2.19 → spirack-0.2.20}/spirack/S5l_module.py +0 -0
  24. {spirack-0.2.19 → spirack-0.2.20}/spirack/U1c_module.py +0 -0
  25. {spirack-0.2.19 → spirack-0.2.20}/spirack/U2_module.py +0 -0
  26. {spirack-0.2.19 → spirack-0.2.20}/spirack/__init__.py +0 -0
  27. {spirack-0.2.19 → spirack-0.2.20}/spirack/chip_mode.py +0 -0
  28. {spirack-0.2.19 → spirack-0.2.20}/spirack/spi_rack.py +0 -0
  29. {spirack-0.2.19 → spirack-0.2.20}/spirack.egg-info/SOURCES.txt +0 -0
  30. {spirack-0.2.19 → spirack-0.2.20}/spirack.egg-info/dependency_links.txt +0 -0
  31. {spirack-0.2.19 → spirack-0.2.20}/spirack.egg-info/requires.txt +0 -0
  32. {spirack-0.2.19 → spirack-0.2.20}/spirack.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: spirack
3
- Version: 0.2.19
3
+ Version: 0.2.20
4
4
  Summary: Drivers for the QuTech SPI-rack
5
5
  Home-page: https://github.com/qutechdev/SPI-rack
6
6
  Author: QuTech Electronics Team
@@ -44,8 +44,8 @@ class D5a_module(object):
44
44
 
45
45
  # DAC software span constants
46
46
  range_4V_uni = 0
47
- range_4V_bi = 2
48
47
  range_8V_uni = 1
48
+ range_4V_bi = 2
49
49
  range_8V_bi = 3
50
50
  range_2V_bi = 4
51
51
 
@@ -67,7 +67,7 @@ class D5a_module(object):
67
67
  self.spi_rack = spi_rack
68
68
  self.module = module
69
69
  self._num_dacs = num_dacs
70
- self.span = [np.nan]*self._num_dacs
70
+ self.spans = [np.nan]*self._num_dacs
71
71
  self.voltages = [np.nan]*self._num_dacs
72
72
 
73
73
  for i in range(self._num_dacs):
@@ -108,7 +108,7 @@ class D5a_module(object):
108
108
  if DAC not in range(self._num_dacs):
109
109
  raise ValueError('D5a module {} [change_span_update]: DAC {} does not exist.'.format(self.module, DAC))
110
110
 
111
- self.span[DAC] = span
111
+ self.spans[DAC] = span
112
112
 
113
113
  # Determine which DAC in IC by checking even/uneven
114
114
  address = (DAC%2)<<1
@@ -130,7 +130,7 @@ class D5a_module(object):
130
130
  # The change of span will also cause a change in the actual output voltage
131
131
  # Make update to the voltages array to reflect that change
132
132
  new_settings = self.get_settings(DAC) # read from actual hardware
133
- self.span[DAC] = new_settings[0] # update to the cached variables
133
+ self.voltages[DAC] = new_settings[0] # update to the cached variables
134
134
 
135
135
  def change_span(self, DAC, span):
136
136
  """Changes the software span of selected DAC without update
@@ -148,7 +148,7 @@ class D5a_module(object):
148
148
  if DAC not in range(self._num_dacs):
149
149
  raise ValueError('D5a module {} [change_span]: DAC {} does not exist.'.format(self.module, DAC))
150
150
 
151
- self.span[DAC] = span
151
+ self.spans[DAC] = span
152
152
 
153
153
  # Determine which DAC in IC by checking even/uneven
154
154
  address = (DAC%2)<<1
@@ -272,27 +272,27 @@ class D5a_module(object):
272
272
 
273
273
  step = self.get_stepsize(DAC)
274
274
 
275
- if self.span[DAC] == D5a_module.range_4V_uni:
275
+ if self.spans[DAC] == D5a_module.range_4V_uni:
276
276
  bit_value = int(round(voltage / step))
277
277
  self.voltages[DAC] = bit_value * step
278
278
  maxV = 4.0
279
279
  minV = 0.0
280
- elif self.span[DAC] == D5a_module.range_4V_bi:
280
+ elif self.spans[DAC] == D5a_module.range_4V_bi:
281
281
  bit_value = int(round((voltage + 4.0) / step))
282
282
  self.voltages[DAC] = (bit_value * step) - 4.0
283
283
  maxV = 4.0
284
284
  minV = -4.0
285
- if self.span[DAC] == D5a_module.range_8V_uni:
285
+ if self.spans[DAC] == D5a_module.range_8V_uni:
286
286
  bit_value = int(round(voltage / step))
287
287
  self.voltages[DAC] = bit_value * step
288
288
  maxV = 8.0
289
289
  minV = 0.0
290
- elif self.span[DAC] == D5a_module.range_8V_bi:
290
+ elif self.spans[DAC] == D5a_module.range_8V_bi:
291
291
  bit_value = int(round((voltage + 8.0) / step))
292
292
  self.voltages[DAC] = (bit_value * step) - 8.0
293
293
  maxV = 8.0
294
294
  minV = -8.0
295
- elif self.span[DAC] == D5a_module.range_2V_bi:
295
+ elif self.spans[DAC] == D5a_module.range_2V_bi:
296
296
  bit_value = int(round((voltage + 2.0) / step))
297
297
  self.voltages[DAC] = (bit_value * step) - 2.0
298
298
  maxV = 2.0
@@ -331,16 +331,16 @@ class D5a_module(object):
331
331
  if DAC not in range(self._num_dacs):
332
332
  raise ValueError('D5a module {} [get_stepsize]: DAC {} does not exist.'.format(self.module, DAC))
333
333
 
334
- if self.span[DAC] == D5a_module.range_4V_uni:
335
- return 4.0 / (2 ** 18)
336
- elif self.span[DAC] == D5a_module.range_4V_bi or self.span[DAC] == D5a_module.range_8V_uni:
337
- return 8.0 / (2 ** 18)
338
- elif self.span[DAC] == D5a_module.range_8V_bi:
339
- return 16.0 / (2 ** 18)
340
- elif self.span[DAC] == D5a_module.range_2V_bi:
341
- return 4.0 / (2 ** 18)
334
+ if self.spans[DAC] == D5a_module.range_4V_uni:
335
+ return 4.0/(2**18)
336
+ elif (self.spans[DAC] == D5a_module.range_4V_bi or self.spans[DAC] == D5a_module.range_8V_uni):
337
+ return 8.0/(2**18)
338
+ elif self.spans[DAC] == D5a_module.range_8V_bi:
339
+ return 16.0/(2**18)
340
+ elif self.spans[DAC] == D5a_module.range_2V_bi:
341
+ return 4.0/(2**18)
342
342
  else:
343
- raise ValueError(f"Span for DAC {DAC} not set to valid value. Span currently set to {self.span[DAC]}.")
343
+ raise ValueError("Span for DAC ",DAC," is not a valid value. The span is currently set to ".self.span[DAC],".")
344
344
 
345
345
  def get_settings(self, DAC):
346
346
  """Reads current DAC settings
@@ -362,14 +362,14 @@ class D5a_module(object):
362
362
  DAC_ic = DAC//2
363
363
 
364
364
  # Read code command
365
- command = 0b1101
365
+ command = 0b1101 # 0xd
366
366
  data = bytearray([(command<<4) | address, 0, 0, 0])
367
367
 
368
368
  code_data = self.spi_rack.read_data(self.module, DAC_ic, LTC2758_MODE, LTC2758_RD_SPEED, data)
369
369
  code = (code_data[1]<<10) | (code_data[2]<<2) | (code_data[3]>>6)
370
370
 
371
371
  # Read span command
372
- command = 0b1100
372
+ command = 0b1100 # 0xc
373
373
  data = bytearray([(command<<4) | address, 0, 0, 0])
374
374
 
375
375
  span_data = self.spi_rack.read_data(self.module, DAC_ic, LTC2758_MODE, LTC2758_RD_SPEED, data)
@@ -389,8 +389,8 @@ class D5a_module(object):
389
389
  raise ValueError("Span {} should not be used. Accepted values are: {}".format(span, [0, 1, 2, 3, 4]))
390
390
 
391
391
  self.voltages[DAC] = voltage
392
- self.span[DAC] = span
393
-
392
+ self.spans[DAC] = span
393
+
394
394
  return [voltage, span]
395
395
 
396
396
  def is_D5a_communicating(self):
@@ -429,4 +429,4 @@ class D5a_module(object):
429
429
  if (test_value != new_value):
430
430
  return 0
431
431
  else:
432
- return 1
432
+ return 1
@@ -0,0 +1 @@
1
+ __version__ = '0.2.20'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: spirack
3
- Version: 0.2.19
3
+ Version: 0.2.20
4
4
  Summary: Drivers for the QuTech SPI-rack
5
5
  Home-page: https://github.com/qutechdev/SPI-rack
6
6
  Author: QuTech Electronics Team
@@ -1 +0,0 @@
1
- __version__ = '0.2.19'
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
File without changes
File without changes
File without changes
File without changes