pyglaze 0.4.0__tar.gz → 0.4.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 (33) hide show
  1. {pyglaze-0.4.0/src/pyglaze.egg-info → pyglaze-0.4.1}/PKG-INFO +3 -3
  2. {pyglaze-0.4.0 → pyglaze-0.4.1}/pyproject.toml +4 -4
  3. pyglaze-0.4.1/src/pyglaze/__init__.py +1 -0
  4. {pyglaze-0.4.0 → pyglaze-0.4.1}/src/pyglaze/datamodels/pulse.py +24 -4
  5. {pyglaze-0.4.0 → pyglaze-0.4.1/src/pyglaze.egg-info}/PKG-INFO +3 -3
  6. {pyglaze-0.4.0 → pyglaze-0.4.1}/src/pyglaze.egg-info/requires.txt +1 -1
  7. pyglaze-0.4.0/src/pyglaze/__init__.py +0 -1
  8. {pyglaze-0.4.0 → pyglaze-0.4.1}/LICENSE +0 -0
  9. {pyglaze-0.4.0 → pyglaze-0.4.1}/MANIFEST.in +0 -0
  10. {pyglaze-0.4.0 → pyglaze-0.4.1}/README.md +0 -0
  11. {pyglaze-0.4.0 → pyglaze-0.4.1}/setup.cfg +0 -0
  12. {pyglaze-0.4.0 → pyglaze-0.4.1}/src/pyglaze/datamodels/__init__.py +0 -0
  13. {pyglaze-0.4.0 → pyglaze-0.4.1}/src/pyglaze/datamodels/waveform.py +0 -0
  14. {pyglaze-0.4.0 → pyglaze-0.4.1}/src/pyglaze/device/__init__.py +0 -0
  15. {pyglaze-0.4.0 → pyglaze-0.4.1}/src/pyglaze/device/ampcom.py +0 -0
  16. {pyglaze-0.4.0 → pyglaze-0.4.1}/src/pyglaze/device/configuration.py +0 -0
  17. {pyglaze-0.4.0 → pyglaze-0.4.1}/src/pyglaze/devtools/__init__.py +0 -0
  18. {pyglaze-0.4.0 → pyglaze-0.4.1}/src/pyglaze/devtools/mock_device.py +0 -0
  19. {pyglaze-0.4.0 → pyglaze-0.4.1}/src/pyglaze/devtools/thz_pulse.py +0 -0
  20. {pyglaze-0.4.0 → pyglaze-0.4.1}/src/pyglaze/helpers/__init__.py +0 -0
  21. {pyglaze-0.4.0 → pyglaze-0.4.1}/src/pyglaze/helpers/_types.py +0 -0
  22. {pyglaze-0.4.0 → pyglaze-0.4.1}/src/pyglaze/helpers/utilities.py +0 -0
  23. {pyglaze-0.4.0 → pyglaze-0.4.1}/src/pyglaze/interpolation/__init__.py +0 -0
  24. {pyglaze-0.4.0 → pyglaze-0.4.1}/src/pyglaze/interpolation/interpolation.py +0 -0
  25. {pyglaze-0.4.0 → pyglaze-0.4.1}/src/pyglaze/py.typed +0 -0
  26. {pyglaze-0.4.0 → pyglaze-0.4.1}/src/pyglaze/scanning/__init__.py +0 -0
  27. {pyglaze-0.4.0 → pyglaze-0.4.1}/src/pyglaze/scanning/_asyncscanner.py +0 -0
  28. {pyglaze-0.4.0 → pyglaze-0.4.1}/src/pyglaze/scanning/_exceptions.py +0 -0
  29. {pyglaze-0.4.0 → pyglaze-0.4.1}/src/pyglaze/scanning/client.py +0 -0
  30. {pyglaze-0.4.0 → pyglaze-0.4.1}/src/pyglaze/scanning/scanner.py +0 -0
  31. {pyglaze-0.4.0 → pyglaze-0.4.1}/src/pyglaze.egg-info/SOURCES.txt +0 -0
  32. {pyglaze-0.4.0 → pyglaze-0.4.1}/src/pyglaze.egg-info/dependency_links.txt +0 -0
  33. {pyglaze-0.4.0 → pyglaze-0.4.1}/src/pyglaze.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyglaze
3
- Version: 0.4.0
3
+ Version: 0.4.1
4
4
  Summary: Pyglaze is a library used to operate the devices of Glaze Technologies
5
5
  Author: GLAZE Technologies ApS
6
6
  License: BSD 3-Clause License
@@ -35,10 +35,10 @@ Project-URL: Homepage, https://www.glazetech.dk/
35
35
  Project-URL: Documentation, https://glazetech.github.io/pyglaze/latest
36
36
  Project-URL: Repository, https://github.com/GlazeTech/pyglaze
37
37
  Project-URL: Issues, https://github.com/GlazeTech/pyglaze/issues
38
- Requires-Python: <3.13,>=3.9
38
+ Requires-Python: <3.14,>=3.9
39
39
  Description-Content-Type: text/markdown
40
40
  License-File: LICENSE
41
- Requires-Dist: numpy<2.0.0,>=1.26.4
41
+ Requires-Dist: numpy>=1.26.4
42
42
  Requires-Dist: pyserial>=3.5
43
43
  Requires-Dist: scipy>=1.7.3
44
44
  Requires-Dist: bitstring>=4.1.2
@@ -1,16 +1,16 @@
1
1
  [project]
2
2
  name = "pyglaze"
3
- version = "0.4.0"
3
+ version = "0.4.1"
4
4
  description = "Pyglaze is a library used to operate the devices of Glaze Technologies"
5
5
  readme = "README.md"
6
6
  license = { file = "LICENSE" }
7
7
  authors = [
8
8
  {name = "GLAZE Technologies ApS"},
9
9
  ]
10
- requires-python = ">=3.9,<3.13"
10
+ requires-python = ">=3.9,<3.14"
11
11
 
12
12
  dependencies = [
13
- "numpy>=1.26.4,<2.0.0",
13
+ "numpy>=1.26.4",
14
14
  "pyserial>=3.5",
15
15
  "scipy>=1.7.3",
16
16
  "bitstring>=4.1.2",
@@ -74,7 +74,7 @@ convention = "google"
74
74
  ]
75
75
 
76
76
  [tool.bumpver]
77
- current_version = "0.4.0"
77
+ current_version = "0.4.1"
78
78
  version_pattern = "MAJOR.MINOR.PATCH[-TAG]"
79
79
  commit_message = "BUMP VERSION {old_version} -> {new_version}"
80
80
  tag_message = "v{new_version}"
@@ -0,0 +1 @@
1
+ __version__ = "0.4.1"
@@ -16,7 +16,7 @@ if TYPE_CHECKING:
16
16
  __all__ = ["Pulse"]
17
17
 
18
18
 
19
- @dataclass
19
+ @dataclass(frozen=True)
20
20
  class Pulse:
21
21
  """Data class for a THz pulse. The pulse is expected to be preprocessed such that times are uniformly spaced.
22
22
 
@@ -41,6 +41,24 @@ class Pulse:
41
41
  and np.array_equal(self.signal, obj.signal)
42
42
  )
43
43
 
44
+ def __hash__(self: Pulse) -> int:
45
+ """Return a hash based on the contents of ``time`` and ``signal``.
46
+
47
+ The hash combines shape, dtype and raw bytes of both arrays, ensuring that
48
+ two :class:`Pulse` instances that compare equal also have identical hashes.
49
+
50
+ """
51
+ return hash(
52
+ (
53
+ self.time.shape,
54
+ self.time.dtype.str,
55
+ self.time.tobytes(),
56
+ self.signal.shape,
57
+ self.signal.dtype.str,
58
+ self.signal.tobytes(),
59
+ )
60
+ )
61
+
44
62
  @property
45
63
  def fft(self: Pulse) -> ComplexArray:
46
64
  """Return the Fourier Transform of a signal."""
@@ -97,7 +115,7 @@ class Pulse:
97
115
 
98
116
  Note that the energy is not the same as the physical energy of the pulse, but rather the integral of the square of the pulse.
99
117
  """
100
- return cast("float", np.trapz(self.signal * self.signal, x=self.time)) # noqa: NPY201 - trapz removed in numpy 2.0
118
+ return cast("float", np.trapezoid(self.signal * self.signal, x=self.time)) # type: ignore[attr-defined, unused-ignore]
101
119
 
102
120
  @classmethod
103
121
  def from_dict(
@@ -163,8 +181,10 @@ class Pulse:
163
181
  ]
164
182
 
165
183
  if translate_to_zero:
166
- for scan in roughly_aligned:
167
- scan.time = scan.time - scan.time[0]
184
+ roughly_aligned = [
185
+ s.timeshift(scale=1.0, offset=-s.time[0]) for s in roughly_aligned
186
+ ]
187
+
168
188
  zerocrossings = [p.estimate_zero_crossing() for p in roughly_aligned]
169
189
  mean_zerocrossing = cast("float", np.mean(zerocrossings))
170
190
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyglaze
3
- Version: 0.4.0
3
+ Version: 0.4.1
4
4
  Summary: Pyglaze is a library used to operate the devices of Glaze Technologies
5
5
  Author: GLAZE Technologies ApS
6
6
  License: BSD 3-Clause License
@@ -35,10 +35,10 @@ Project-URL: Homepage, https://www.glazetech.dk/
35
35
  Project-URL: Documentation, https://glazetech.github.io/pyglaze/latest
36
36
  Project-URL: Repository, https://github.com/GlazeTech/pyglaze
37
37
  Project-URL: Issues, https://github.com/GlazeTech/pyglaze/issues
38
- Requires-Python: <3.13,>=3.9
38
+ Requires-Python: <3.14,>=3.9
39
39
  Description-Content-Type: text/markdown
40
40
  License-File: LICENSE
41
- Requires-Dist: numpy<2.0.0,>=1.26.4
41
+ Requires-Dist: numpy>=1.26.4
42
42
  Requires-Dist: pyserial>=3.5
43
43
  Requires-Dist: scipy>=1.7.3
44
44
  Requires-Dist: bitstring>=4.1.2
@@ -1,4 +1,4 @@
1
- numpy<2.0.0,>=1.26.4
1
+ numpy>=1.26.4
2
2
  pyserial>=3.5
3
3
  scipy>=1.7.3
4
4
  bitstring>=4.1.2
@@ -1 +0,0 @@
1
- __version__ = "0.4.0"
File without changes
File without changes
File without changes
File without changes
File without changes