Conversation
sabonerune
left a comment
There was a problem hiding this comment.
A simple type hint that's better than nothing.
| @@ -0,0 +1,399 @@ | |||
| from typing import Optional, Tuple | |||
There was a problem hiding this comment.
typing.Tuple is Deprecated.
However, removing this requires Python 3.9 (or maybe Python 3.7).
https://docs.python.org/3.13/library/typing.html#typing.Tuple
| cmdclass={'build_ext': build_ext}, | ||
| version=_VERSION, | ||
| packages=find_packages(), | ||
| package_data={"": ["py.typed", "*.pyi"]}, |
There was a problem hiding this comment.
If setuptools>=v69.0.0 this code is not needed.
https://setuptools.pypa.io/en/latest/history.html#id256
But this is only supported in Python >= 3.8.
There was a problem hiding this comment.
Typing of ndarrays is minimal.
It would be great if we could type hint it like this:
def synthesize(
f0: np.ndarray[tuple[int], np.dtype[np.double]],
spectrogram: np.ndarray[tuple[int, int], np.dtype[np.double]],
aperiodicity: np.ndarray[tuple[int, int], np.dtype[np.double]],
fs: int,
frame_period: float
) -> np.ndarray[tuple[int], np.dtype[np.double]]:...But this is probably supported in numpy>=1.22 and Python>=3.9.
Python 3.10 supports Numpy 1.21.6, so it wouldn't be easy to add it without dropping one of them.
It's almost a copy of
pyworld.pyx.Features are minimal to support older Python and Numpy.