-
-
Notifications
You must be signed in to change notification settings - Fork 14
complete scipy.fft.dct
, and add relevant type aliases
#118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a890c3f
Annotate `scipy.fft._realtransforms.dct`
Avasam 47b0c6e
Add type aliases for "DCT type" and "normalization mode"
Avasam 7de0ca0
Address PR comments and fill in other simple types
Avasam eba7dec
Leftover import + `n` is also a simple param type
Avasam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,83 +1,88 @@ | ||
from scipy._typing import Untyped | ||
import numpy.typing as npt | ||
from numpy._typing import _ArrayLikeNumber_co | ||
from scipy._typing import DCTType, NormalizationMode, Untyped | ||
|
||
def dctn( | ||
x: Untyped, | ||
type: int = 2, | ||
type: DCTType = 2, | ||
s: Untyped | None = None, | ||
axes: Untyped | None = None, | ||
norm: Untyped | None = None, | ||
norm: NormalizationMode | None = None, | ||
overwrite_x: bool = False, | ||
workers: Untyped | None = None, | ||
workers: int | None = None, | ||
*, | ||
orthogonalize: Untyped | None = None, | ||
orthogonalize: bool | None = None, | ||
) -> Untyped: ... | ||
def idctn( | ||
x: Untyped, | ||
type: int = 2, | ||
type: DCTType = 2, | ||
s: Untyped | None = None, | ||
axes: Untyped | None = None, | ||
norm: Untyped | None = None, | ||
norm: NormalizationMode | None = None, | ||
overwrite_x: bool = False, | ||
workers: Untyped | None = None, | ||
orthogonalize: Untyped | None = None, | ||
workers: int | None = None, | ||
orthogonalize: bool | None = None, | ||
) -> Untyped: ... | ||
def dstn( | ||
x: Untyped, | ||
type: int = 2, | ||
type: DCTType = 2, | ||
s: Untyped | None = None, | ||
axes: Untyped | None = None, | ||
norm: Untyped | None = None, | ||
norm: NormalizationMode | None = None, | ||
overwrite_x: bool = False, | ||
workers: Untyped | None = None, | ||
orthogonalize: Untyped | None = None, | ||
workers: int | None = None, | ||
orthogonalize: bool | None = None, | ||
) -> Untyped: ... | ||
def idstn( | ||
x: Untyped, | ||
type: int = 2, | ||
type: DCTType = 2, | ||
s: Untyped | None = None, | ||
axes: Untyped | None = None, | ||
norm: Untyped | None = None, | ||
norm: NormalizationMode | None = None, | ||
overwrite_x: bool = False, | ||
workers: Untyped | None = None, | ||
orthogonalize: Untyped | None = None, | ||
workers: int | None = None, | ||
orthogonalize: bool | None = None, | ||
) -> Untyped: ... | ||
|
||
# We could use overloads based on the type of x to get more accurate return type | ||
# see https://github.com/jorenham/scipy-stubs/pull/118#discussion_r1807957439 | ||
jorenham marked this conversation as resolved.
Show resolved
Hide resolved
|
||
def dct( | ||
x: Untyped, | ||
type: int = 2, | ||
n: Untyped | None = None, | ||
x: _ArrayLikeNumber_co, | ||
type: DCTType = 2, | ||
n: int | None = None, | ||
axis: int = -1, | ||
norm: Untyped | None = None, | ||
norm: NormalizationMode | None = None, | ||
overwrite_x: bool = False, | ||
workers: Untyped | None = None, | ||
orthogonalize: Untyped | None = None, | ||
) -> Untyped: ... | ||
workers: int | None = None, | ||
orthogonalize: bool | None = None, | ||
) -> npt.NDArray[Untyped]: ... | ||
def idct( | ||
x: Untyped, | ||
type: int = 2, | ||
n: Untyped | None = None, | ||
type: DCTType = 2, | ||
n: int | None = None, | ||
axis: int = -1, | ||
norm: Untyped | None = None, | ||
norm: NormalizationMode | None = None, | ||
overwrite_x: bool = False, | ||
workers: Untyped | None = None, | ||
orthogonalize: Untyped | None = None, | ||
workers: int | None = None, | ||
orthogonalize: bool | None = None, | ||
) -> Untyped: ... | ||
def dst( | ||
x: Untyped, | ||
type: int = 2, | ||
n: Untyped | None = None, | ||
type: DCTType = 2, | ||
n: int | None = None, | ||
axis: int = -1, | ||
norm: Untyped | None = None, | ||
norm: NormalizationMode | None = None, | ||
overwrite_x: bool = False, | ||
workers: Untyped | None = None, | ||
orthogonalize: Untyped | None = None, | ||
workers: int | None = None, | ||
orthogonalize: bool | None = None, | ||
) -> Untyped: ... | ||
def idst( | ||
x: Untyped, | ||
type: int = 2, | ||
n: Untyped | None = None, | ||
type: DCTType = 2, | ||
n: int | None = None, | ||
axis: int = -1, | ||
norm: Untyped | None = None, | ||
norm: NormalizationMode | None = None, | ||
overwrite_x: bool = False, | ||
workers: Untyped | None = None, | ||
orthogonalize: Untyped | None = None, | ||
workers: int | None = None, | ||
orthogonalize: bool | None = None, | ||
) -> Untyped: ... |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.