waveforms 2.1.0__tar.gz → 2.1.1__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 (30) hide show
  1. {waveforms-2.1.0 → waveforms-2.1.1}/PKG-INFO +1 -1
  2. {waveforms-2.1.0 → waveforms-2.1.1}/waveforms/utils.py +14 -12
  3. {waveforms-2.1.0 → waveforms-2.1.1}/waveforms/version.py +1 -1
  4. {waveforms-2.1.0 → waveforms-2.1.1}/waveforms/waveform.py +4 -0
  5. {waveforms-2.1.0 → waveforms-2.1.1}/waveforms.egg-info/PKG-INFO +1 -1
  6. {waveforms-2.1.0 → waveforms-2.1.1}/LICENSE +0 -0
  7. {waveforms-2.1.0 → waveforms-2.1.1}/MANIFEST.in +0 -0
  8. {waveforms-2.1.0 → waveforms-2.1.1}/README.md +0 -0
  9. {waveforms-2.1.0 → waveforms-2.1.1}/pyproject.toml +0 -0
  10. {waveforms-2.1.0 → waveforms-2.1.1}/setup.cfg +0 -0
  11. {waveforms-2.1.0 → waveforms-2.1.1}/setup.py +0 -0
  12. {waveforms-2.1.0 → waveforms-2.1.1}/src/waveform.h +0 -0
  13. {waveforms-2.1.0 → waveforms-2.1.1}/tests/test_multi_drag.py +0 -0
  14. {waveforms-2.1.0 → waveforms-2.1.1}/tests/test_waveform.py +0 -0
  15. {waveforms-2.1.0 → waveforms-2.1.1}/tests/test_wavevstack.py +0 -0
  16. {waveforms-2.1.0 → waveforms-2.1.1}/waveforms/WaveformLexer.py +0 -0
  17. {waveforms-2.1.0 → waveforms-2.1.1}/waveforms/WaveformListener.py +0 -0
  18. {waveforms-2.1.0 → waveforms-2.1.1}/waveforms/WaveformParser.py +0 -0
  19. {waveforms-2.1.0 → waveforms-2.1.1}/waveforms/__init__.py +0 -0
  20. {waveforms-2.1.0 → waveforms-2.1.1}/waveforms/__main__.py +0 -0
  21. {waveforms-2.1.0 → waveforms-2.1.1}/waveforms/_waveform.pyi +0 -0
  22. {waveforms-2.1.0 → waveforms-2.1.1}/waveforms/_waveform.pyx +0 -0
  23. {waveforms-2.1.0 → waveforms-2.1.1}/waveforms/distortion.py +0 -0
  24. {waveforms-2.1.0 → waveforms-2.1.1}/waveforms/multy_drag.py +0 -0
  25. {waveforms-2.1.0 → waveforms-2.1.1}/waveforms/waveform_parser.py +0 -0
  26. {waveforms-2.1.0 → waveforms-2.1.1}/waveforms.egg-info/SOURCES.txt +0 -0
  27. {waveforms-2.1.0 → waveforms-2.1.1}/waveforms.egg-info/dependency_links.txt +0 -0
  28. {waveforms-2.1.0 → waveforms-2.1.1}/waveforms.egg-info/entry_points.txt +0 -0
  29. {waveforms-2.1.0 → waveforms-2.1.1}/waveforms.egg-info/requires.txt +0 -0
  30. {waveforms-2.1.0 → waveforms-2.1.1}/waveforms.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: waveforms
3
- Version: 2.1.0
3
+ Version: 2.1.1
4
4
  Summary: Edit waveforms used in experiment
5
5
  Author-email: feihoo87 <feihoo87@gmail.com>
6
6
  Maintainer-email: feihoo87 <feihoo87@gmail.com>
@@ -1,6 +1,6 @@
1
1
  from itertools import repeat
2
2
  from types import MappingProxyType
3
- from typing import Optional, Sequence
3
+ from typing import Optional, Sequence, cast
4
4
 
5
5
  import numpy as np
6
6
  import scipy.sparse as sp
@@ -20,13 +20,13 @@ def freeze(x):
20
20
  elif isinstance(x, (np.ndarray, np.matrix)):
21
21
  x.flags.writeable = False
22
22
  elif isinstance(x, sp.spmatrix):
23
- x.data.flags.writeable = False
24
- if x.format in {'csr', 'csc', 'bsr'}:
25
- x.indices.flags.writeable = False
26
- x.indptr.flags.writeable = False
27
- elif x.format == 'coo':
28
- x.row.flags.writeable = False
29
- x.col.flags.writeable = False
23
+ cast(np.ndarray, getattr(x, 'data')).flags.writeable = False
24
+ if getattr(x, 'format') in {'csr', 'csc', 'bsr'}:
25
+ cast(np.ndarray, getattr(x, 'indices')).flags.writeable = False
26
+ cast(np.ndarray, getattr(x, 'indptr')).flags.writeable = False
27
+ elif getattr(x, 'format') == 'coo':
28
+ cast(np.ndarray, getattr(x, 'row')).flags.writeable = False
29
+ cast(np.ndarray, getattr(x, 'col')).flags.writeable = False
30
30
  elif isinstance(x, bytearray):
31
31
  x = bytes(x)
32
32
  return x
@@ -72,12 +72,14 @@ def getFTMatrix(fList: Sequence[float],
72
72
  if weight is None or len(weight) == 0:
73
73
  weight = np.full(numOfPoints, 2 / numOfPoints)
74
74
  if phaseList is None or len(phaseList) == 0:
75
- phaseList = np.zeros_like(fList)
75
+ phase_list = np.zeros_like(fList)
76
+ else:
77
+ phase_list = phaseList
76
78
  if weight.ndim == 1:
77
- weightList = repeat(weight)
79
+ weight_list = repeat(weight)
78
80
  else:
79
- weightList = weight
80
- for f, phase, weight in zip(fList, phaseList, weightList):
81
+ weight_list = weight
82
+ for f, phase, weight in zip(fList, phase_list, weight_list):
81
83
  e.append(weight * np.exp(-1j * (2 * np.pi * f * t + phase)))
82
84
  return np.asarray(e).T
83
85
 
@@ -1,2 +1,2 @@
1
1
  """Define version number here and read it from setup.py automatically"""
2
- __version__ = "2.1.0"
2
+ __version__ = "2.1.1"
@@ -179,6 +179,10 @@ class Waveform:
179
179
  sig = self.__call__(x, out=out, function_lib=function_lib)
180
180
  if filters is not None:
181
181
  sos, initial = filters
182
+ if not isinstance(sos, np.ndarray):
183
+ sos = np.array(sos)
184
+ elif not sos.flags.writeable:
185
+ sos = sos.copy()
182
186
  if initial:
183
187
  sig = sosfilt(sos, sig - initial) + initial
184
188
  else:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: waveforms
3
- Version: 2.1.0
3
+ Version: 2.1.1
4
4
  Summary: Edit waveforms used in experiment
5
5
  Author-email: feihoo87 <feihoo87@gmail.com>
6
6
  Maintainer-email: feihoo87 <feihoo87@gmail.com>
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes