hunterHearsPy 1.4.0__tar.gz → 1.4.2__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.
- {hunterhearspy-1.4.0/src/hunterHearsPy.egg-info → hunterhearspy-1.4.2}/PKG-INFO +37 -18
- {hunterhearspy-1.4.0 → hunterhearspy-1.4.2}/README.md +28 -3
- {hunterhearspy-1.4.0/src → hunterhearspy-1.4.2}/hunterHearsPy/__init__.py +2 -2
- {hunterhearspy-1.4.0/src → hunterhearspy-1.4.2}/hunterHearsPy/_arrays.py +0 -1
- {hunterhearspy-1.4.0/src → hunterhearspy-1.4.2}/hunterHearsPy/_fft.py +1 -1
- {hunterhearspy-1.4.0/src → hunterhearspy-1.4.2}/hunterHearsPy/_io.py +4 -5
- {hunterhearspy-1.4.0/src → hunterhearspy-1.4.2}/hunterHearsPy/amplitude.py +4 -4
- {hunterhearspy-1.4.0/src → hunterhearspy-1.4.2}/hunterHearsPy/dataBaskets.py +1 -1
- {hunterhearspy-1.4.0/src → hunterhearspy-1.4.2}/hunterHearsPy/theSSOT.py +1 -1
- {hunterhearspy-1.4.0/src → hunterhearspy-1.4.2}/hunterHearsPy/theTypes.py +1 -1
- {hunterhearspy-1.4.0/src → hunterhearspy-1.4.2}/hunterHearsPy/windowingFunctionsTensor.py +5 -5
- {hunterhearspy-1.4.0 → hunterhearspy-1.4.2/hunterHearsPy.egg-info}/PKG-INFO +37 -18
- hunterhearspy-1.4.2/hunterHearsPy.egg-info/SOURCES.txt +33 -0
- hunterhearspy-1.4.2/hunterHearsPy.egg-info/requires.txt +11 -0
- hunterhearspy-1.4.2/pyproject.toml +290 -0
- {hunterhearspy-1.4.0 → hunterhearspy-1.4.2}/tests/test_old_clippingArrays.py +2 -2
- {hunterhearspy-1.4.0 → hunterhearspy-1.4.2}/tests/test_old_spectrogram.py +1 -1
- {hunterhearspy-1.4.0 → hunterhearspy-1.4.2}/tests/test_old_waveform.py +1 -1
- hunterhearspy-1.4.0/pyproject.toml +0 -95
- hunterhearspy-1.4.0/src/hunterHearsPy.egg-info/SOURCES.txt +0 -33
- hunterhearspy-1.4.0/src/hunterHearsPy.egg-info/requires.txt +0 -17
- {hunterhearspy-1.4.0 → hunterhearspy-1.4.2}/LICENSE +0 -0
- {hunterhearspy-1.4.0/src → hunterhearspy-1.4.2}/hunterHearsPy/_resample.py +0 -0
- {hunterhearspy-1.4.0/src → hunterhearspy-1.4.2}/hunterHearsPy/autoRevert.py +0 -0
- {hunterhearspy-1.4.0/src → hunterhearspy-1.4.2}/hunterHearsPy/clippingArrays.py +0 -0
- {hunterhearspy-1.4.0/src → hunterhearspy-1.4.2}/hunterHearsPy/py.typed +0 -0
- {hunterhearspy-1.4.0/src → hunterhearspy-1.4.2}/hunterHearsPy/windowingFunctions.py +0 -0
- {hunterhearspy-1.4.0/src → hunterhearspy-1.4.2}/hunterHearsPy.egg-info/dependency_links.txt +0 -0
- {hunterhearspy-1.4.0/src → hunterhearspy-1.4.2}/hunterHearsPy.egg-info/top_level.txt +0 -0
- {hunterhearspy-1.4.0 → hunterhearspy-1.4.2}/setup.cfg +0 -0
- {hunterhearspy-1.4.0 → hunterhearspy-1.4.2}/tests/test_arrays.py +0 -0
- {hunterhearspy-1.4.0 → hunterhearspy-1.4.2}/tests/test_fft.py +0 -0
- {hunterhearspy-1.4.0 → hunterhearspy-1.4.2}/tests/test_io.py +0 -0
- {hunterhearspy-1.4.0 → hunterhearspy-1.4.2}/tests/test_old_amplitude.py +0 -0
- {hunterhearspy-1.4.0 → hunterhearspy-1.4.2}/tests/test_old_autoRevert.py +0 -0
- {hunterhearspy-1.4.0 → hunterhearspy-1.4.2}/tests/test_resample.py +0 -0
- {hunterhearspy-1.4.0 → hunterhearspy-1.4.2}/tests/test_windowingFunctions.py +0 -0
- {hunterhearspy-1.4.0 → hunterhearspy-1.4.2}/tests/test_windowingFunctionsTensor.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hunterHearsPy
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.2
|
|
4
4
|
Summary: Audio processing.
|
|
5
5
|
Author-email: Hunter Hogan <HunterHogan@pm.me>
|
|
6
6
|
Maintainer-email: Hunter Hogan <HunterHogan@pm.me>
|
|
@@ -17,32 +17,27 @@ Classifier: Intended Audience :: Developers
|
|
|
17
17
|
Classifier: Intended Audience :: Science/Research
|
|
18
18
|
Classifier: Natural Language :: English
|
|
19
19
|
Classifier: Operating System :: OS Independent
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
22
20
|
Classifier: Programming Language :: Python :: 3.12
|
|
23
21
|
Classifier: Programming Language :: Python :: 3.13
|
|
24
22
|
Classifier: Programming Language :: Python :: 3.14
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
25
24
|
Classifier: Typing :: Typed
|
|
26
|
-
Requires-Python: >=3.
|
|
25
|
+
Requires-Python: >=3.12
|
|
27
26
|
Description-Content-Type: text/markdown
|
|
28
27
|
License-File: LICENSE
|
|
29
|
-
Requires-Dist: Z0Z_tools>=
|
|
30
|
-
Requires-Dist: hunterMakesPy>=0.
|
|
31
|
-
Requires-Dist: numpy
|
|
32
|
-
Requires-Dist: resampy
|
|
33
|
-
Requires-Dist: scipy
|
|
28
|
+
Requires-Dist: Z0Z_tools>=4.0.0
|
|
29
|
+
Requires-Dist: hunterMakesPy>=0.10.0
|
|
30
|
+
Requires-Dist: numpy>=2.0
|
|
31
|
+
Requires-Dist: resampy>=0.4.3
|
|
32
|
+
Requires-Dist: scipy>=1.15
|
|
34
33
|
Requires-Dist: soundfile>=0.14.0
|
|
35
|
-
Requires-Dist: tqdm
|
|
34
|
+
Requires-Dist: tqdm>=4.66
|
|
36
35
|
Requires-Dist: typing-extensions>=4.0.0
|
|
37
|
-
Provides-Extra: testing
|
|
38
|
-
Requires-Dist: pytest; extra == "testing"
|
|
39
|
-
Requires-Dist: pytest-mock; extra == "testing"
|
|
40
|
-
Requires-Dist: pytest-xdist; extra == "testing"
|
|
41
|
-
Requires-Dist: torch; extra == "testing"
|
|
42
36
|
Provides-Extra: torch
|
|
43
37
|
Requires-Dist: torch; extra == "torch"
|
|
44
38
|
Dynamic: license-file
|
|
45
39
|
|
|
40
|
+
<!-- path-sync copy -n hunterhogan -->
|
|
46
41
|
# hunterHearsPy
|
|
47
42
|
|
|
48
43
|
A comprehensive collection of Python utilities for audio processing.
|
|
@@ -181,9 +176,33 @@ I don't know a good way to implement user-configurable universal settings. There
|
|
|
181
176
|
pip install hunterHearsPy
|
|
182
177
|
```
|
|
183
178
|
|
|
179
|
+
### Contributing
|
|
180
|
+
|
|
181
|
+
The `testing` and `development` [dependency groups](https://peps.python.org/pep-0735/) (pip 25.1
|
|
182
|
+
or newer) are not extras of the published distribution. From a clone of the repository, install the
|
|
183
|
+
tests' requirements and run the tests:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
pip install -e . --group testing
|
|
187
|
+
pytest
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
The `development` group includes the `testing` group, and adds the tools and type stubs for
|
|
191
|
+
working on the code:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
pip install -e . --group development
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
<!-- === DO_NOT_EDIT: path-sync hunterhogan === -->
|
|
184
198
|
## My recovery
|
|
185
199
|
|
|
186
|
-
[](https://HunterThinks.com/support)
|
|
201
|
+

|
|
202
|
+
|
|
203
|
+
By law, authors retain their copyrights unless they grant exceptions. The Creative Commons Attribution-NonCommercial 4.0 International Deed outlines how you may use this work.
|
|
204
|
+
|
|
205
|
+
The restriction on commercial use (without a license) limits advantage-taking, unjust enrichment, and exploitation. You would be morally wrong if you were to enrich yourself by using this work while I am denied healthcare, housing, security of property, and the safety of my person.
|
|
188
206
|
|
|
189
|
-
|
|
207
|
+
To obtain and retain the right to use this work, you incur the cost of attributing the work to me. Your nominal cost might accrue as a benefit that mitigates my suffering or saves my life.
|
|
208
|
+
<!-- === OK_EDIT: path-sync hunterhogan === -->
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
<!-- path-sync copy -n hunterhogan -->
|
|
1
2
|
# hunterHearsPy
|
|
2
3
|
|
|
3
4
|
A comprehensive collection of Python utilities for audio processing.
|
|
@@ -136,9 +137,33 @@ I don't know a good way to implement user-configurable universal settings. There
|
|
|
136
137
|
pip install hunterHearsPy
|
|
137
138
|
```
|
|
138
139
|
|
|
140
|
+
### Contributing
|
|
141
|
+
|
|
142
|
+
The `testing` and `development` [dependency groups](https://peps.python.org/pep-0735/) (pip 25.1
|
|
143
|
+
or newer) are not extras of the published distribution. From a clone of the repository, install the
|
|
144
|
+
tests' requirements and run the tests:
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
pip install -e . --group testing
|
|
148
|
+
pytest
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
The `development` group includes the `testing` group, and adds the tools and type stubs for
|
|
152
|
+
working on the code:
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
pip install -e . --group development
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
<!-- === DO_NOT_EDIT: path-sync hunterhogan === -->
|
|
139
159
|
## My recovery
|
|
140
160
|
|
|
141
|
-
[](https://HunterThinks.com/support)
|
|
162
|
+

|
|
163
|
+
|
|
164
|
+
By law, authors retain their copyrights unless they grant exceptions. The Creative Commons Attribution-NonCommercial 4.0 International Deed outlines how you may use this work.
|
|
165
|
+
|
|
166
|
+
The restriction on commercial use (without a license) limits advantage-taking, unjust enrichment, and exploitation. You would be morally wrong if you were to enrich yourself by using this work while I am denied healthcare, housing, security of property, and the safety of my person.
|
|
143
167
|
|
|
144
|
-
|
|
168
|
+
To obtain and retain the right to use this work, you incur the cost of attributing the work to me. Your nominal cost might accrue as a benefit that mitigates my suffering or saves my life.
|
|
169
|
+
<!-- === OK_EDIT: path-sync hunterhogan === -->
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# ruff:
|
|
1
|
+
# ruff:file-ignore[undocumented-public-package]
|
|
2
2
|
# TODO design and implement a namespace.
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
@@ -10,7 +10,7 @@ from hunterHearsPy.windowingFunctions import cosineWings as cosineWings, equalPo
|
|
|
10
10
|
# isort: split
|
|
11
11
|
from contextlib import suppress
|
|
12
12
|
|
|
13
|
-
with suppress(ModuleNotFoundError): #
|
|
13
|
+
with suppress(ModuleNotFoundError): # ruff:ignore[non-empty-init-module]
|
|
14
14
|
from hunterHearsPy.windowingFunctionsTensor import (
|
|
15
15
|
cosineWingsTensor as cosineWingsTensor, equalPowerTensor as equalPowerTensor, halfsineTensor as halfsineTensor,
|
|
16
16
|
tukeyTensor as tukeyTensor)
|
|
@@ -71,7 +71,7 @@ def stft(
|
|
|
71
71
|
if arrayTarget.ndim == 2:
|
|
72
72
|
arrayFloating: WaveformFloating = amplitudeIntegerToFloating(arrayTarget)
|
|
73
73
|
elif numpy.issubdtype(arrayTarget.dtype, complexfloating) and (lengthWaveform < 1):
|
|
74
|
-
from hunterHearsPy._io import saveOnError #
|
|
74
|
+
from hunterHearsPy._io import saveOnError # ruff:ignore[import-outside-top-level]
|
|
75
75
|
|
|
76
76
|
pathFilename: PurePath = saveOnError(arrayTarget)
|
|
77
77
|
message: str = (
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
3
|
from hunterHearsPy import amplitudeToSoundfile, getAxis, resampleWaveform, setting, stft
|
|
4
|
-
from hunterMakesPy.
|
|
4
|
+
from hunterMakesPy.kitFilesystem import makeDirectorySafely
|
|
5
5
|
from pathlib import Path, PurePath
|
|
6
6
|
from soundfile import AudioData
|
|
7
7
|
from typing import TYPE_CHECKING
|
|
8
|
-
from typing_extensions import Unpack
|
|
9
8
|
import numpy
|
|
10
9
|
import soundfile
|
|
11
10
|
import tempfile
|
|
@@ -16,7 +15,7 @@ if TYPE_CHECKING:
|
|
|
16
15
|
from hunterHearsPy.theTypes import FileDescriptorOrPath, Parameters_stft, Spectrogram, Waveform
|
|
17
16
|
from numpy import dtype, ndarray
|
|
18
17
|
from soundfile import AudioData_2d, dtype_str as Options_dtype_str
|
|
19
|
-
from typing import Any
|
|
18
|
+
from typing import Any, Unpack
|
|
20
19
|
|
|
21
20
|
def getSampleRate(pathFilename: FileDescriptorOrPath) -> int:
|
|
22
21
|
return soundfile.info(pathFilename).samplerate
|
|
@@ -46,11 +45,11 @@ def readAudioFile(pathFilename: FileDescriptorOrPath, sampleRate: float | None =
|
|
|
46
45
|
sampleRateDesired: float = sampleRate or setting.sampleRate
|
|
47
46
|
with soundfile.SoundFile(pathFilename) as readSoundFile:
|
|
48
47
|
sampleRateSource: int = readSoundFile.samplerate
|
|
49
|
-
audioData: AudioData_2d = readSoundFile.read(dtype=dtype_str or setting.dtype_str, always_2d=True)
|
|
48
|
+
audioData: AudioData_2d = readSoundFile.read(dtype=dtype_str or setting.dtype_str, always_2d=True)
|
|
50
49
|
axis: dict[str, AxisMetadata] = getAxis()
|
|
51
50
|
waveform: Waveform = audioData.transpose((axis['time'].number, axis['channel'].number))
|
|
52
51
|
|
|
53
|
-
return resampleWaveform(waveform, sampleRateDesired, sampleRateSource, axis['time'].number)
|
|
52
|
+
return resampleWaveform(waveform, sampleRateDesired, sampleRateSource, axis['time'].number)
|
|
54
53
|
|
|
55
54
|
def saveOnError(arrayTarget: ndarray[tuple[Any, ...], dtype[Any]], *, identifierTarget: str = 'arrayTarget') -> PurePath:
|
|
56
55
|
pathFilename: Path = Path(tempfile.mkdtemp(prefix='hunterHearsPy'), f"{identifierTarget}_{uuid.uuid4().hex}.npy").resolve()
|
|
@@ -38,7 +38,7 @@ if TYPE_CHECKING:
|
|
|
38
38
|
bits: Final[int] = 8
|
|
39
39
|
|
|
40
40
|
def amplitudeIntegerToFloating(arrayTarget: ndarray[形Shape, dtype[integer[Any]]]) -> ndarray[形Shape, dtype[floating[Any]]]:
|
|
41
|
-
"""The original purpose of this function was to convert integer PCM waveforms passed to `stft`."""
|
|
41
|
+
"""The original purpose of this function was to convert integer PCM waveforms passed to `stft`."""
|
|
42
42
|
amplitudeMaximum: int = 2 ** ((arrayTarget.dtype.itemsize * bits) - 1) # This works for signed (2s complement) and unsigned because the MSD is the sign, right?
|
|
43
43
|
# TODO Why is this fixed at float32? Can/ought I to derive it or get it from `setting` or something?
|
|
44
44
|
Z0Z_floatWidth = float32
|
|
@@ -96,12 +96,12 @@ def amplitudeToSoundfile(arrayTarget: ndarray[形Shape, dtype[Any]]) -> AudioDat
|
|
|
96
96
|
|
|
97
97
|
elif numpy.issubdtype(arrayTarget.dtype, numpy.floating):
|
|
98
98
|
dtypeSoundfileFloating: frozenset[dtype[floating[Any]]] = frozenset(filter(lambda _dtype: numpy.issubdtype(_dtype, floating), dtypeSoundfile))
|
|
99
|
-
dtypeNewFloating: dtype[floating[Any]] = min(min(arrayTarget.dtype, *dtypeSoundfileFloating), max(dtypeSoundfileFloating)) #
|
|
99
|
+
dtypeNewFloating: dtype[floating[Any]] = min(min(arrayTarget.dtype, *dtypeSoundfileFloating), max(dtypeSoundfileFloating)) # ruff:ignore[nested-min-max]
|
|
100
100
|
arraySoundfile = numpy.astype(arrayTarget, dtypeNewFloating, copy=False)
|
|
101
101
|
|
|
102
102
|
elif numpy.issubdtype(arrayTarget.dtype, numpy.integer):
|
|
103
103
|
dtypesInteger: frozenset[dtype[integer[Any]]] = frozenset(filter(lambda _dtype: numpy.issubdtype(_dtype, integer), dtypeSoundfile))
|
|
104
|
-
dtypeNewInteger: dtype[integer[Any]] = min(min(arrayTarget.dtype, *dtypesInteger), max(dtypesInteger)) #
|
|
104
|
+
dtypeNewInteger: dtype[integer[Any]] = min(min(arrayTarget.dtype, *dtypesInteger), max(dtypesInteger)) # ruff:ignore[nested-min-max]
|
|
105
105
|
|
|
106
106
|
amplitudeMaximumTarget: int = 2 ** ((arrayTarget.dtype.itemsize * bits) - 1)
|
|
107
107
|
amplitudeMaximumNew: int = 2 ** ((dtypeNewInteger.itemsize * bits) - 1)
|
|
@@ -118,7 +118,7 @@ def amplitudeToSoundfile(arrayTarget: ndarray[形Shape, dtype[Any]]) -> AudioDat
|
|
|
118
118
|
|
|
119
119
|
arraySoundfile = arraySoundfile.astype(dtypeNewInteger, copy=True) # pyright: ignore[reportAssignmentType]
|
|
120
120
|
else:
|
|
121
|
-
from hunterHearsPy._io import saveOnError #
|
|
121
|
+
from hunterHearsPy._io import saveOnError # ruff:ignore[import-outside-top-level]
|
|
122
122
|
|
|
123
123
|
pathFilename: PurePath = saveOnError(arrayTarget)
|
|
124
124
|
message: str = (
|
|
@@ -10,13 +10,13 @@ if TYPE_CHECKING:
|
|
|
10
10
|
from torch.types import Device
|
|
11
11
|
from typing import Any
|
|
12
12
|
|
|
13
|
-
def _convertToTensor(*arguments: Any, callableTarget: callableReturnsNDArray, device: Device | None=None, dtype: torch.dtype | None=None, **keywordArguments: Any) -> torch.Tensor:
|
|
13
|
+
def _convertToTensor(*arguments: Any, callableTarget: callableReturnsNDArray, device: Device | None = None, dtype: torch.dtype | None = None, **keywordArguments: Any) -> torch.Tensor:
|
|
14
14
|
arrayTarget = callableTarget(*arguments, **keywordArguments)
|
|
15
15
|
if device is None:
|
|
16
16
|
device = torch.device(device='cpu')
|
|
17
17
|
return torch.tensor(data=arrayTarget, dtype=dtype or torch.float32, device=device)
|
|
18
18
|
|
|
19
|
-
def cosineWingsTensor(lengthSupport: int, ratioTaper: float=0.1, device: Device | None=None, dtype: torch.dtype | None=None) -> torch.Tensor:
|
|
19
|
+
def cosineWingsTensor(lengthSupport: int, ratioTaper: float = 0.1, device: Device | None = None, dtype: torch.dtype | None = None) -> torch.Tensor:
|
|
20
20
|
"""Generate a cosine-tapered windowingFunction with a flat center and tapered ends.
|
|
21
21
|
|
|
22
22
|
You can use this function to produce a 1-D windowingFunction of length `lengthSupport` whose ends
|
|
@@ -43,7 +43,7 @@ def cosineWingsTensor(lengthSupport: int, ratioTaper: float=0.1, device: Device
|
|
|
43
43
|
"""
|
|
44
44
|
return _convertToTensor(lengthSupport, ratioTaper, callableTarget=cosineWings, device=device, dtype=dtype)
|
|
45
45
|
|
|
46
|
-
def equalPowerTensor(lengthSupport: int, ratioTaper: float=0.1, device: Device | None=None, dtype: torch.dtype | None=None) -> torch.Tensor:
|
|
46
|
+
def equalPowerTensor(lengthSupport: int, ratioTaper: float = 0.1, device: Device | None = None, dtype: torch.dtype | None = None) -> torch.Tensor:
|
|
47
47
|
"""Generate an equal-power windowingFunction suitable for crossfades.
|
|
48
48
|
|
|
49
49
|
You can use this function to build a 1-D windowingFunction whose ends follow a square-root ramp.
|
|
@@ -70,7 +70,7 @@ def equalPowerTensor(lengthSupport: int, ratioTaper: float=0.1, device: Device |
|
|
|
70
70
|
"""
|
|
71
71
|
return _convertToTensor(lengthSupport, ratioTaper, callableTarget=equalPower, device=device, dtype=dtype)
|
|
72
72
|
|
|
73
|
-
def halfsineTensor(lengthSupport: int, device: Device | None=None, dtype: torch.dtype | None=None) -> torch.Tensor:
|
|
73
|
+
def halfsineTensor(lengthSupport: int, device: Device | None = None, dtype: torch.dtype | None = None) -> torch.Tensor:
|
|
74
74
|
"""Generate a half-sine windowingFunction of the requested length.
|
|
75
75
|
|
|
76
76
|
This function returns a 1-D half-sine windowingFunction of length `lengthSupport`. The value at
|
|
@@ -99,7 +99,7 @@ def halfsineTensor(lengthSupport: int, device: Device | None=None, dtype: torch.
|
|
|
99
99
|
"""
|
|
100
100
|
return _convertToTensor(lengthSupport, callableTarget=halfsine, device=device, dtype=dtype)
|
|
101
101
|
|
|
102
|
-
def tukeyTensor(lengthSupport: int, ratioTaper: float=0.1, device: Device | None=None, dtype: torch.dtype | None=None, **keywordArguments: float) -> torch.Tensor:
|
|
102
|
+
def tukeyTensor(lengthSupport: int, ratioTaper: float = 0.1, device: Device | None = None, dtype: torch.dtype | None = None, **keywordArguments: float) -> torch.Tensor:
|
|
103
103
|
"""Generate a Tukey windowingFunction.
|
|
104
104
|
|
|
105
105
|
You can use this function to obtain a tapered windowingFunction where the central region is
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hunterHearsPy
|
|
3
|
-
Version: 1.4.
|
|
3
|
+
Version: 1.4.2
|
|
4
4
|
Summary: Audio processing.
|
|
5
5
|
Author-email: Hunter Hogan <HunterHogan@pm.me>
|
|
6
6
|
Maintainer-email: Hunter Hogan <HunterHogan@pm.me>
|
|
@@ -17,32 +17,27 @@ Classifier: Intended Audience :: Developers
|
|
|
17
17
|
Classifier: Intended Audience :: Science/Research
|
|
18
18
|
Classifier: Natural Language :: English
|
|
19
19
|
Classifier: Operating System :: OS Independent
|
|
20
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
21
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
22
20
|
Classifier: Programming Language :: Python :: 3.12
|
|
23
21
|
Classifier: Programming Language :: Python :: 3.13
|
|
24
22
|
Classifier: Programming Language :: Python :: 3.14
|
|
23
|
+
Classifier: Programming Language :: Python :: 3.15
|
|
25
24
|
Classifier: Typing :: Typed
|
|
26
|
-
Requires-Python: >=3.
|
|
25
|
+
Requires-Python: >=3.12
|
|
27
26
|
Description-Content-Type: text/markdown
|
|
28
27
|
License-File: LICENSE
|
|
29
|
-
Requires-Dist: Z0Z_tools>=
|
|
30
|
-
Requires-Dist: hunterMakesPy>=0.
|
|
31
|
-
Requires-Dist: numpy
|
|
32
|
-
Requires-Dist: resampy
|
|
33
|
-
Requires-Dist: scipy
|
|
28
|
+
Requires-Dist: Z0Z_tools>=4.0.0
|
|
29
|
+
Requires-Dist: hunterMakesPy>=0.10.0
|
|
30
|
+
Requires-Dist: numpy>=2.0
|
|
31
|
+
Requires-Dist: resampy>=0.4.3
|
|
32
|
+
Requires-Dist: scipy>=1.15
|
|
34
33
|
Requires-Dist: soundfile>=0.14.0
|
|
35
|
-
Requires-Dist: tqdm
|
|
34
|
+
Requires-Dist: tqdm>=4.66
|
|
36
35
|
Requires-Dist: typing-extensions>=4.0.0
|
|
37
|
-
Provides-Extra: testing
|
|
38
|
-
Requires-Dist: pytest; extra == "testing"
|
|
39
|
-
Requires-Dist: pytest-mock; extra == "testing"
|
|
40
|
-
Requires-Dist: pytest-xdist; extra == "testing"
|
|
41
|
-
Requires-Dist: torch; extra == "testing"
|
|
42
36
|
Provides-Extra: torch
|
|
43
37
|
Requires-Dist: torch; extra == "torch"
|
|
44
38
|
Dynamic: license-file
|
|
45
39
|
|
|
40
|
+
<!-- path-sync copy -n hunterhogan -->
|
|
46
41
|
# hunterHearsPy
|
|
47
42
|
|
|
48
43
|
A comprehensive collection of Python utilities for audio processing.
|
|
@@ -181,9 +176,33 @@ I don't know a good way to implement user-configurable universal settings. There
|
|
|
181
176
|
pip install hunterHearsPy
|
|
182
177
|
```
|
|
183
178
|
|
|
179
|
+
### Contributing
|
|
180
|
+
|
|
181
|
+
The `testing` and `development` [dependency groups](https://peps.python.org/pep-0735/) (pip 25.1
|
|
182
|
+
or newer) are not extras of the published distribution. From a clone of the repository, install the
|
|
183
|
+
tests' requirements and run the tests:
|
|
184
|
+
|
|
185
|
+
```bash
|
|
186
|
+
pip install -e . --group testing
|
|
187
|
+
pytest
|
|
188
|
+
```
|
|
189
|
+
|
|
190
|
+
The `development` group includes the `testing` group, and adds the tools and type stubs for
|
|
191
|
+
working on the code:
|
|
192
|
+
|
|
193
|
+
```bash
|
|
194
|
+
pip install -e . --group development
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
<!-- === DO_NOT_EDIT: path-sync hunterhogan === -->
|
|
184
198
|
## My recovery
|
|
185
199
|
|
|
186
|
-
[](https://HunterThinks.com/support)
|
|
201
|
+

|
|
202
|
+
|
|
203
|
+
By law, authors retain their copyrights unless they grant exceptions. The Creative Commons Attribution-NonCommercial 4.0 International Deed outlines how you may use this work.
|
|
204
|
+
|
|
205
|
+
The restriction on commercial use (without a license) limits advantage-taking, unjust enrichment, and exploitation. You would be morally wrong if you were to enrich yourself by using this work while I am denied healthcare, housing, security of property, and the safety of my person.
|
|
188
206
|
|
|
189
|
-
|
|
207
|
+
To obtain and retain the right to use this work, you incur the cost of attributing the work to me. Your nominal cost might accrue as a benefit that mitigates my suffering or saves my life.
|
|
208
|
+
<!-- === OK_EDIT: path-sync hunterhogan === -->
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
hunterHearsPy/__init__.py
|
|
5
|
+
hunterHearsPy/_arrays.py
|
|
6
|
+
hunterHearsPy/_fft.py
|
|
7
|
+
hunterHearsPy/_io.py
|
|
8
|
+
hunterHearsPy/_resample.py
|
|
9
|
+
hunterHearsPy/amplitude.py
|
|
10
|
+
hunterHearsPy/autoRevert.py
|
|
11
|
+
hunterHearsPy/clippingArrays.py
|
|
12
|
+
hunterHearsPy/dataBaskets.py
|
|
13
|
+
hunterHearsPy/py.typed
|
|
14
|
+
hunterHearsPy/theSSOT.py
|
|
15
|
+
hunterHearsPy/theTypes.py
|
|
16
|
+
hunterHearsPy/windowingFunctions.py
|
|
17
|
+
hunterHearsPy/windowingFunctionsTensor.py
|
|
18
|
+
hunterHearsPy.egg-info/PKG-INFO
|
|
19
|
+
hunterHearsPy.egg-info/SOURCES.txt
|
|
20
|
+
hunterHearsPy.egg-info/dependency_links.txt
|
|
21
|
+
hunterHearsPy.egg-info/requires.txt
|
|
22
|
+
hunterHearsPy.egg-info/top_level.txt
|
|
23
|
+
tests/test_arrays.py
|
|
24
|
+
tests/test_fft.py
|
|
25
|
+
tests/test_io.py
|
|
26
|
+
tests/test_old_amplitude.py
|
|
27
|
+
tests/test_old_autoRevert.py
|
|
28
|
+
tests/test_old_clippingArrays.py
|
|
29
|
+
tests/test_old_spectrogram.py
|
|
30
|
+
tests/test_old_waveform.py
|
|
31
|
+
tests/test_resample.py
|
|
32
|
+
tests/test_windowingFunctions.py
|
|
33
|
+
tests/test_windowingFunctionsTensor.py
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
# path-sync copy -n hunterhogan
|
|
2
|
+
[project]
|
|
3
|
+
name = "hunterHearsPy"
|
|
4
|
+
version = "1.4.2"
|
|
5
|
+
description = "Audio processing."
|
|
6
|
+
readme = "README.md"
|
|
7
|
+
requires-python = ">=3.12"
|
|
8
|
+
license = "CC-BY-NC-4.0"
|
|
9
|
+
license-files = ["LICEN[CS]E*"]
|
|
10
|
+
authors = [{ name = "Hunter Hogan", email = "HunterHogan@pm.me" }]
|
|
11
|
+
maintainers = [{ name = "Hunter Hogan", email = "HunterHogan@pm.me" }]
|
|
12
|
+
keywords = []
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Development Status :: 4 - Beta",
|
|
15
|
+
"Environment :: Console",
|
|
16
|
+
"Intended Audience :: Developers",
|
|
17
|
+
"Intended Audience :: Science/Research",
|
|
18
|
+
"Natural Language :: English",
|
|
19
|
+
"Operating System :: OS Independent",
|
|
20
|
+
"Programming Language :: Python :: 3.12",
|
|
21
|
+
"Programming Language :: Python :: 3.13",
|
|
22
|
+
"Programming Language :: Python :: 3.14",
|
|
23
|
+
"Programming Language :: Python :: 3.15",
|
|
24
|
+
"Typing :: Typed",
|
|
25
|
+
]
|
|
26
|
+
dependencies = [
|
|
27
|
+
"Z0Z_tools>=4.0.0",
|
|
28
|
+
"hunterMakesPy>=0.10.0",
|
|
29
|
+
"numpy>=2.0",
|
|
30
|
+
"resampy>=0.4.3",
|
|
31
|
+
"scipy>=1.15",
|
|
32
|
+
"soundfile>=0.14.0",
|
|
33
|
+
"tqdm>=4.66",
|
|
34
|
+
"typing-extensions>=4.0.0",
|
|
35
|
+
]
|
|
36
|
+
optional-dependencies = { torch = ["torch"] }
|
|
37
|
+
|
|
38
|
+
[project.urls]
|
|
39
|
+
Context7 = "https://context7.com/hunterhogan/hunterhearspy"
|
|
40
|
+
Donate = "https://www.patreon.com/integrated"
|
|
41
|
+
Download = "https://pypi.org/project/hunterHearsPy"
|
|
42
|
+
Homepage = "https://github.com/hunterhogan/hunterHearsPy"
|
|
43
|
+
Issues = "https://github.com/hunterhogan/hunterHearsPy/issues"
|
|
44
|
+
Repository = "https://github.com/hunterhogan/hunterHearsPy.git"
|
|
45
|
+
|
|
46
|
+
[dependency-groups]
|
|
47
|
+
development = ["astToolkit", "pytest-cov", "scipy-stubs", "types-resampy", "types-tqdm", { include-group = "testing" }]
|
|
48
|
+
testing = ["pytest", "pytest-mock", "pytest-xdist", "torch"]
|
|
49
|
+
|
|
50
|
+
[build-system]
|
|
51
|
+
requires = ["setuptools>=77.0.1"]
|
|
52
|
+
build-backend = "setuptools.build_meta"
|
|
53
|
+
|
|
54
|
+
[tool.coverage]
|
|
55
|
+
report = { exclude_lines = ["if TYPE_CHECKING:", "if __name__ == \"__main__\":"], ignore_errors = false }
|
|
56
|
+
run = { branch = true, concurrency = ["multiprocessing"], data_file = "tests/coverage/.coverage", omit = ["tests/*"], parallel = true, source = ["."] }
|
|
57
|
+
|
|
58
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
59
|
+
[tool.isort]
|
|
60
|
+
add_imports = ["from __future__ import annotations"]
|
|
61
|
+
append_only = true
|
|
62
|
+
atomic = true
|
|
63
|
+
combine_as_imports = true
|
|
64
|
+
extend_skip_glob = ["*.pyi"]
|
|
65
|
+
filter_files = true
|
|
66
|
+
force_alphabetical_sort_within_sections = true
|
|
67
|
+
from_first = true
|
|
68
|
+
honor_noqa = true
|
|
69
|
+
indent = "\t"
|
|
70
|
+
line_length = 140
|
|
71
|
+
lines_after_imports = 1
|
|
72
|
+
lines_between_types = 0
|
|
73
|
+
multi_line_output = 4
|
|
74
|
+
no_sections = true
|
|
75
|
+
skip_gitignore = true
|
|
76
|
+
use_parentheses = true
|
|
77
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
78
|
+
|
|
79
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
80
|
+
[tool.pyrefly]
|
|
81
|
+
enabled-ignores = ["pyrefly"]
|
|
82
|
+
# ignore-errors-in-generated-code = true
|
|
83
|
+
infer-with-first-use = false
|
|
84
|
+
preset = "strict"
|
|
85
|
+
python-platform = "all"
|
|
86
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
87
|
+
|
|
88
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
89
|
+
[tool.pyrefly.errors]
|
|
90
|
+
bad-return = "warn"
|
|
91
|
+
invalid-yield = "warn"
|
|
92
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
93
|
+
|
|
94
|
+
[tool.pytest]
|
|
95
|
+
addopts = ["--color=auto", "--tb=line", "-n", "4"]
|
|
96
|
+
log_auto_indent = "On"
|
|
97
|
+
testpaths = ["tests"]
|
|
98
|
+
|
|
99
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
100
|
+
[tool.ruff]
|
|
101
|
+
line-length = 140
|
|
102
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
103
|
+
|
|
104
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
105
|
+
[tool.ruff.lint]
|
|
106
|
+
allowed-confusables = ["–", "’", "′", "×", "−", "∖", "∗", "∣", "∨", "∪", "∼", "⊗", "ℂ", "ℋ", "ℒ", "ℓ", "ℕ", "ℙ", "ℚ", "ℝ", "ℤ", "ℰ", "ℱ", "𝒪", "𝒮", "𝔼", "𝕀", "𝟙", "α", "Β", "γ", "ι", "Κ", "ν", "ο", "ρ", "σ"]
|
|
107
|
+
future-annotations = true
|
|
108
|
+
ignore = [
|
|
109
|
+
# ====== Linters ===========
|
|
110
|
+
"FIX", # flake8-fixme
|
|
111
|
+
"I", # isort
|
|
112
|
+
"N", # pep8-naming
|
|
113
|
+
"TD", # flake8-todos
|
|
114
|
+
# ====== complexity ========
|
|
115
|
+
"dict-index-missing-items",
|
|
116
|
+
"explicit-f-string-type-conversion",
|
|
117
|
+
"non-pep695-type-alias",
|
|
118
|
+
"redundant-numeric-union",
|
|
119
|
+
"static-join-to-f-string",
|
|
120
|
+
"unnecessary-literal-dict",
|
|
121
|
+
"useless-import-alias",
|
|
122
|
+
# ====== correctness =======
|
|
123
|
+
"unused-variable",
|
|
124
|
+
# ====== formatting ========
|
|
125
|
+
"bad-quotes-inline-string",
|
|
126
|
+
"blank-lines-after-function-or-class",
|
|
127
|
+
"blank-lines-top-level",
|
|
128
|
+
"docstring-tab-indentation",
|
|
129
|
+
"incorrect-blank-line-after-class",
|
|
130
|
+
"line-too-long",
|
|
131
|
+
"missing-newline-at-end-of-file",
|
|
132
|
+
"missing-trailing-comma",
|
|
133
|
+
"no-space-after-block-comment",
|
|
134
|
+
"tab-indentation",
|
|
135
|
+
"too-many-blank-lines",
|
|
136
|
+
# ====== pedantic ==========
|
|
137
|
+
"any-type",
|
|
138
|
+
"blanket-noqa",
|
|
139
|
+
"docstring-in-stub",
|
|
140
|
+
"docstring-missing-exception",
|
|
141
|
+
"docstring-missing-returns",
|
|
142
|
+
"docstring-missing-yields",
|
|
143
|
+
"if-else-block-instead-of-if-exp",
|
|
144
|
+
"incorrect-section-order",
|
|
145
|
+
"magic-value-comparison",
|
|
146
|
+
"missing-copyright-notice",
|
|
147
|
+
"missing-trailing-period",
|
|
148
|
+
"non-ascii-import-name",
|
|
149
|
+
"non-ascii-name",
|
|
150
|
+
"non-imperative-mood",
|
|
151
|
+
"redefined-loop-name",
|
|
152
|
+
"superfluous-else-continue",
|
|
153
|
+
"superfluous-else-return",
|
|
154
|
+
"too-many-arguments",
|
|
155
|
+
"too-many-branches",
|
|
156
|
+
"too-many-locals",
|
|
157
|
+
"too-many-nested-blocks",
|
|
158
|
+
"too-many-positional-arguments",
|
|
159
|
+
"too-many-public-methods",
|
|
160
|
+
"too-many-statements",
|
|
161
|
+
"typed-argument-default-in-stub",
|
|
162
|
+
"yoda-conditions",
|
|
163
|
+
# ====== restriction =======
|
|
164
|
+
"complex-structure",
|
|
165
|
+
# ====== security ==========
|
|
166
|
+
"subprocess-without-shell-equals-true",
|
|
167
|
+
"suspicious-pickle-import",
|
|
168
|
+
# ====== style =============
|
|
169
|
+
"snake-case-type-alias",
|
|
170
|
+
"type-name-incorrect-variance",
|
|
171
|
+
# ====== suspicious ========
|
|
172
|
+
"self-or-cls-assignment",
|
|
173
|
+
"subclass-builtin",
|
|
174
|
+
"unused-import",
|
|
175
|
+
"useless-else-on-loop",
|
|
176
|
+
]
|
|
177
|
+
preview = true
|
|
178
|
+
select = ["ALL"]
|
|
179
|
+
extend-select = ["missing-terminal-punctuation", "undocumented-param", "undocumented-public-init"]
|
|
180
|
+
task-tags = ["DEVELOPMENT", "NOTE", "SEMIOTICS", "TODO"]
|
|
181
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
182
|
+
|
|
183
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
184
|
+
[tool.ruff.lint.flake8-comprehensions]
|
|
185
|
+
allow-dict-calls-with-keyword-arguments = true
|
|
186
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
187
|
+
|
|
188
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
189
|
+
[tool.ruff.lint.flake8-import-conventions]
|
|
190
|
+
banned-aliases = { altair = ["alt"], datetime = ["dt"], holoviews = ["hv"], matplotlib = ["mpl"], "matplotlib.pyplot" = ["plt"], networkx = ["nx"], numpy = ["np"], "numpy.typing" = ["npt"], optype = ["op"], pandas = ["pd"], panel = ["pn"], "plotly.express" = ["px"], polars = ["pl"], pyarrow = ["pa"], regex = ["re"], seaborn = ["sns"], tensorflow = ["tf"], tkinter = ["tk"], "xml.etree.ElementTree" = ["ET"] }
|
|
191
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
192
|
+
|
|
193
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
194
|
+
[tool.ruff.lint.flake8-import-conventions.aliases]
|
|
195
|
+
"accelerate.utils.dataclasses" = "accelerate_dataclasses"
|
|
196
|
+
"fs.path" = "fs_path"
|
|
197
|
+
"gmpy2.bit_test" = "isBit1吗"
|
|
198
|
+
"gmpy2.is_even" = "isEven吗"
|
|
199
|
+
"gmpy2.is_odd" = "isOdd吗"
|
|
200
|
+
"humpy_cytoolz.assoc" = "associateKeyValue"
|
|
201
|
+
"humpy_cytoolz.curry" = "syntacticCurry"
|
|
202
|
+
"humpy_cytoolz.groupby" = "toolz_groupby"
|
|
203
|
+
"itertools.product" = "CartesianProduct"
|
|
204
|
+
"math.comb" = "nCr"
|
|
205
|
+
"more_itertools.all_unique" = "allUnique吗"
|
|
206
|
+
"regex" = "regex"
|
|
207
|
+
"scipy" = "scipy"
|
|
208
|
+
"sympy.binomial" = "sympy_binomial"
|
|
209
|
+
"sympy.catalan" = "sympy_catalan"
|
|
210
|
+
"sympy.functions.combinatorial.factorials.binomial" = "sympy_binomial"
|
|
211
|
+
"sympy.functions.combinatorial.numbers.catalan" = "sympy_catalan"
|
|
212
|
+
"sympy" = "sympy"
|
|
213
|
+
"torch.autograd.grad" = "torch_grad"
|
|
214
|
+
"torch.nn.functional" = "F"
|
|
215
|
+
"torch.nn.parallel.DistributedDataParallel" = "DDP"
|
|
216
|
+
numpy = "numpy"
|
|
217
|
+
pandas = "pandas"
|
|
218
|
+
polars = "polars"
|
|
219
|
+
re = "regex"
|
|
220
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
221
|
+
|
|
222
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
223
|
+
[tool.ruff.lint.flake8-quotes]
|
|
224
|
+
inline-quotes = "single"
|
|
225
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
226
|
+
|
|
227
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
228
|
+
[tool.ruff.lint.per-file-ignores]
|
|
229
|
+
"**/*_test.py" = ["ARG", "assert", "BLE", "D", "DTZ", "FBT", "PT", "suspicious-non-cryptographic-random-usage", "TRY"]
|
|
230
|
+
"**/conftest*.py" = ["ARG", "assert", "BLE", "D", "DTZ", "FBT", "PT", "suspicious-non-cryptographic-random-usage", "TRY"]
|
|
231
|
+
"**/test_*.py" = ["ARG", "assert", "BLE", "D", "DTZ", "FBT", "PT", "suspicious-non-cryptographic-random-usage", "TRY"]
|
|
232
|
+
"**/tests/**" = ["ARG", "assert", "BLE", "D", "DTZ", "FBT", "PT", "suspicious-non-cryptographic-random-usage", "TRY"]
|
|
233
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
234
|
+
|
|
235
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
236
|
+
[tool.ruff.lint.pydocstyle]
|
|
237
|
+
convention = "numpy"
|
|
238
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
239
|
+
|
|
240
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
241
|
+
[tool.ruff.format]
|
|
242
|
+
docstring-code-format = true
|
|
243
|
+
indent-style = "tab"
|
|
244
|
+
line-ending = "lf"
|
|
245
|
+
nested-string-quote-style = "preferred"
|
|
246
|
+
quote-style = "single"
|
|
247
|
+
skip-magic-trailing-comma = true
|
|
248
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
249
|
+
|
|
250
|
+
[tool.setuptools]
|
|
251
|
+
package-data = { "*" = ["py.typed"] }
|
|
252
|
+
packages = { find = { include = ["hunterHearsPy", "hunterHearsPy.*"], namespaces = false } }
|
|
253
|
+
|
|
254
|
+
# To fill `typings/` with these stubs, run this in this folder: uv run https://raw.githubusercontent.com/hunterhogan/stubFileNotFound/main/stubFileNotFound/installStubs.py
|
|
255
|
+
[tool.stubFileNotFound]
|
|
256
|
+
stubs = ["soundfile"]
|
|
257
|
+
|
|
258
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
259
|
+
[tool.tombi.format.rules]
|
|
260
|
+
line-ending = "lf"
|
|
261
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
262
|
+
|
|
263
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
264
|
+
[tool.ty.analysis]
|
|
265
|
+
respect-type-ignore-comments = false
|
|
266
|
+
return-type-inference = "always"
|
|
267
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
268
|
+
|
|
269
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
270
|
+
[tool.ty.environment]
|
|
271
|
+
extra-paths = ["./typings"]
|
|
272
|
+
python-platform = "all"
|
|
273
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
274
|
+
|
|
275
|
+
# === DO_NOT_EDIT: path-sync hunterhogan ===
|
|
276
|
+
[tool.ty.rules]
|
|
277
|
+
blanket-ignore-comment = "error"
|
|
278
|
+
missing-override-decorator = "error"
|
|
279
|
+
missing-type-argument = "error"
|
|
280
|
+
possibly-missing-attribute = "warn" # Might annoy you: ty's docs say this rule produces many false positives.
|
|
281
|
+
possibly-unresolved-reference = "warn" # Might annoy you: ty's docs say this rule produces many false positives.
|
|
282
|
+
truthiness-test-of-none-union = "warn" # Might annoy you: flags `if value:` on `int | None` or `str | None` even when treating 0 or '' like None is deliberate.
|
|
283
|
+
# === OK_EDIT: path-sync hunterhogan ===
|
|
284
|
+
|
|
285
|
+
[tool.updateCitation]
|
|
286
|
+
filenameCitationDOTcff = "CITATION.cff"
|
|
287
|
+
pathFilenameCitationSSOT = "citations/CITATION.cff"
|
|
288
|
+
|
|
289
|
+
[tool.wheelTest]
|
|
290
|
+
modulesOptional = { "hunterHearsPy.windowingFunctionsTensor" = "torch" }
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# ty:ignore[unresolved-attribute]
|
|
2
|
-
# ruff:
|
|
2
|
+
# ruff:file-ignore[docstring-missing-exception]
|
|
3
3
|
from __future__ import annotations
|
|
4
4
|
|
|
5
5
|
from hunterHearsPy import applyHardLimit, applyHardLimitComplexValued
|
|
6
6
|
from numpy import float64
|
|
7
|
-
from numpy._core._exceptions import _UFuncNoLoopError #
|
|
7
|
+
from numpy._core._exceptions import _UFuncNoLoopError # ruff:ignore[import-private-name]
|
|
8
8
|
from tests import messageTestFailure
|
|
9
9
|
from typing import Any, Final, TYPE_CHECKING
|
|
10
10
|
import numpy
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# pyright: reportUnknownArgumentType=false
|
|
2
2
|
# pyright: reportUnknownLambdaType=false
|
|
3
|
-
# ruff:
|
|
3
|
+
# ruff:file-ignore[docstring-missing-exception]
|
|
4
4
|
# ty:ignore[unresolved-attribute]
|
|
5
5
|
"""test_waveform or test_spectrogram? if a spectrogram is involved at any point, then test_spectrogram."""
|
|
6
6
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
# pyright: reportUnknownArgumentType=false
|
|
5
5
|
# pyright: reportUnknownLambdaType=false
|
|
6
6
|
# pyright: reportUnknownVariableType=false
|
|
7
|
-
# ruff:
|
|
7
|
+
# ruff:file-ignore[print, try-except-in-loop]
|
|
8
8
|
from __future__ import annotations
|
|
9
9
|
|
|
10
10
|
from hunterHearsPy import getWaveformMetadata, writeWAV
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
[project]
|
|
2
|
-
name = "hunterHearsPy"
|
|
3
|
-
version = "1.4.0"
|
|
4
|
-
description = "Audio processing."
|
|
5
|
-
readme = "README.md"
|
|
6
|
-
requires-python = ">=3.10"
|
|
7
|
-
license = "CC-BY-NC-4.0"
|
|
8
|
-
license-files = ["LICEN[CS]E*"]
|
|
9
|
-
authors = [{ name = "Hunter Hogan", email = "HunterHogan@pm.me" }]
|
|
10
|
-
maintainers = [{ name = "Hunter Hogan", email = "HunterHogan@pm.me" }]
|
|
11
|
-
keywords = []
|
|
12
|
-
classifiers = [
|
|
13
|
-
"Development Status :: 4 - Beta",
|
|
14
|
-
"Environment :: Console",
|
|
15
|
-
"Intended Audience :: Developers",
|
|
16
|
-
"Intended Audience :: Science/Research",
|
|
17
|
-
"Natural Language :: English",
|
|
18
|
-
"Operating System :: OS Independent",
|
|
19
|
-
"Programming Language :: Python :: 3.10",
|
|
20
|
-
"Programming Language :: Python :: 3.11",
|
|
21
|
-
"Programming Language :: Python :: 3.12",
|
|
22
|
-
"Programming Language :: Python :: 3.13",
|
|
23
|
-
"Programming Language :: Python :: 3.14",
|
|
24
|
-
"Typing :: Typed",
|
|
25
|
-
]
|
|
26
|
-
dependencies = [
|
|
27
|
-
"Z0Z_tools>=2.1.0",
|
|
28
|
-
"hunterMakesPy>=0.7.0",
|
|
29
|
-
"numpy",
|
|
30
|
-
"resampy",
|
|
31
|
-
"scipy",
|
|
32
|
-
"soundfile>=0.14.0",
|
|
33
|
-
"tqdm",
|
|
34
|
-
"typing-extensions>=4.0.0",
|
|
35
|
-
]
|
|
36
|
-
optional-dependencies = { testing = [
|
|
37
|
-
"pytest",
|
|
38
|
-
"pytest-mock",
|
|
39
|
-
"pytest-xdist",
|
|
40
|
-
"torch"
|
|
41
|
-
], torch = ["torch"] }
|
|
42
|
-
|
|
43
|
-
[project.urls]
|
|
44
|
-
Context7 = "https://context7.com/hunterhogan/hunterhearspy"
|
|
45
|
-
Donate = "https://www.patreon.com/integrated"
|
|
46
|
-
Download = "https://pypi.org/project/hunterHearsPy"
|
|
47
|
-
Homepage = "https://github.com/hunterhogan/hunterHearsPy"
|
|
48
|
-
Issues = "https://github.com/hunterhogan/hunterHearsPy/issues"
|
|
49
|
-
Repository = "https://github.com/hunterhogan/hunterHearsPy.git"
|
|
50
|
-
|
|
51
|
-
[dependency-groups]
|
|
52
|
-
dev = ["astToolkit", "pytest-cov", "scipy-stubs", "types-resampy"]
|
|
53
|
-
pytorch = ["torch==2.10.0"]
|
|
54
|
-
|
|
55
|
-
[build-system]
|
|
56
|
-
requires = ["setuptools"]
|
|
57
|
-
build-backend = "setuptools.build_meta"
|
|
58
|
-
|
|
59
|
-
[tool.coverage]
|
|
60
|
-
report = { exclude_lines = ["if TYPE_CHECKING:", "if __name__ == \"__main__\":"], ignore_errors = false }
|
|
61
|
-
run = { branch = true, concurrency = ["multiprocessing"], data_file = "tests/coverage/.coverage", omit = [
|
|
62
|
-
"tests/*"
|
|
63
|
-
], parallel = true, source = ["."] }
|
|
64
|
-
|
|
65
|
-
[tool.pytest]
|
|
66
|
-
addopts = ["--color=auto", "--tb=line", "-n 4"]
|
|
67
|
-
log_auto_indent = "On"
|
|
68
|
-
pythonpath = ["src"]
|
|
69
|
-
testpaths = ["tests"]
|
|
70
|
-
|
|
71
|
-
[tool.updateCitation]
|
|
72
|
-
filenameCitationDOTcff = "CITATION.cff"
|
|
73
|
-
pathFilenameCitationSSOT = "citations/CITATION.cff"
|
|
74
|
-
|
|
75
|
-
[tool.uv]
|
|
76
|
-
build-backend = { module-name = "hunterHearsPy", module-root = "src" }
|
|
77
|
-
default-groups = ["dev"]
|
|
78
|
-
|
|
79
|
-
[[tool.uv.index]]
|
|
80
|
-
# NOTE I use this to install torch+cuda on my computer that doesn't have cuda. 2026-06-13
|
|
81
|
-
# `uv sync --group pytorch` OR `uv sync --all-groups` will trigger the following.
|
|
82
|
-
# dependency-groups.pytorch amends the dependencies: `torch`, limitation `==2.10.0`, group = "pytorch".
|
|
83
|
-
# At this point, the default source, pypi, is the highest priority on the `torch` sources list. (LIFO)
|
|
84
|
-
# tool.uv.sources sees '`torch`, group = "pytorch"' so pushes "indexPytorch" on top the `torch` sources list.
|
|
85
|
-
# tool.uv.index translates "indexPytorch" to the url of a package index.
|
|
86
|
-
# uv queries the package index for all `torch` that match all limitations.
|
|
87
|
-
# If the package index returns any matches, uv will install the "best" match.
|
|
88
|
-
# Because the package index only has cuda 12.8 versions, uv installs torch+cu128.
|
|
89
|
-
# I picked torch==2.10.0 + cuda 12.8 because that is the pre-installed package on Google Colab T4.
|
|
90
|
-
explicit = true
|
|
91
|
-
name = "indexPytorch"
|
|
92
|
-
url = "https://download.pytorch.org/whl/cu128"
|
|
93
|
-
|
|
94
|
-
[tool.uv.sources]
|
|
95
|
-
torch = { group = "pytorch", index = "indexPytorch" }
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
LICENSE
|
|
2
|
-
README.md
|
|
3
|
-
pyproject.toml
|
|
4
|
-
src/hunterHearsPy/__init__.py
|
|
5
|
-
src/hunterHearsPy/_arrays.py
|
|
6
|
-
src/hunterHearsPy/_fft.py
|
|
7
|
-
src/hunterHearsPy/_io.py
|
|
8
|
-
src/hunterHearsPy/_resample.py
|
|
9
|
-
src/hunterHearsPy/amplitude.py
|
|
10
|
-
src/hunterHearsPy/autoRevert.py
|
|
11
|
-
src/hunterHearsPy/clippingArrays.py
|
|
12
|
-
src/hunterHearsPy/dataBaskets.py
|
|
13
|
-
src/hunterHearsPy/py.typed
|
|
14
|
-
src/hunterHearsPy/theSSOT.py
|
|
15
|
-
src/hunterHearsPy/theTypes.py
|
|
16
|
-
src/hunterHearsPy/windowingFunctions.py
|
|
17
|
-
src/hunterHearsPy/windowingFunctionsTensor.py
|
|
18
|
-
src/hunterHearsPy.egg-info/PKG-INFO
|
|
19
|
-
src/hunterHearsPy.egg-info/SOURCES.txt
|
|
20
|
-
src/hunterHearsPy.egg-info/dependency_links.txt
|
|
21
|
-
src/hunterHearsPy.egg-info/requires.txt
|
|
22
|
-
src/hunterHearsPy.egg-info/top_level.txt
|
|
23
|
-
tests/test_arrays.py
|
|
24
|
-
tests/test_fft.py
|
|
25
|
-
tests/test_io.py
|
|
26
|
-
tests/test_old_amplitude.py
|
|
27
|
-
tests/test_old_autoRevert.py
|
|
28
|
-
tests/test_old_clippingArrays.py
|
|
29
|
-
tests/test_old_spectrogram.py
|
|
30
|
-
tests/test_old_waveform.py
|
|
31
|
-
tests/test_resample.py
|
|
32
|
-
tests/test_windowingFunctions.py
|
|
33
|
-
tests/test_windowingFunctionsTensor.py
|
|
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
|