Skip to content

Commit

Permalink
Updated signatures in init.pyi, CHANGELOG.md and fixed copy-paste in …
Browse files Browse the repository at this point in the history
…the message
  • Loading branch information
vfdev-5 committed May 16, 2024
1 parent 4dfc76e commit 8d42350
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ Remember to align the itemized text with the first line of an item within a list
deprecated and will soon be removed. Use `rtol` instead.
* The ``rcond`` argument of {func}`jax.numpy.linalg.pinv` is being
deprecated and will soon be removed. Use `rtol` instead.
* The ``ddof`` argument of {func}`jax.numpy.std` and {func}`jax.numpy.std` is being
deprecated and will soon be removed. Use `correction` instead.

## jaxlib 0.4.29

Expand Down
6 changes: 3 additions & 3 deletions jax/_src/numpy/reductions.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,7 +434,7 @@ def _average(a: ArrayLike, axis: Axis = None, weights: ArrayLike | None = None,
def var(a: ArrayLike, axis: Axis = None, dtype: DTypeLike | None = None,
out: None = None, correction: int | float = 0, keepdims: bool = False, *,
where: ArrayLike | None = None, ddof: int | DeprecatedArg = DeprecatedArg()) -> Array:
# TODO(vfdev-5): deprecated 2024-5-16, remove after deprecation expires.
# TODO(vfdev-5): Remove after deprecation is completed (began 2024-5-16)
if not isinstance(ddof, DeprecatedArg):
warnings.warn(
"The ddof argument of jax.numpy.var is deprecated and setting it "
Expand Down Expand Up @@ -503,10 +503,10 @@ def _var_promote_types(a_dtype: DTypeLike, dtype: DTypeLike | None) -> tuple[DTy
def std(a: ArrayLike, axis: Axis = None, dtype: DTypeLike | None = None,
out: None = None, correction: int | float = 0, keepdims: bool = False, *,
where: ArrayLike | None = None, ddof: int | DeprecatedArg = DeprecatedArg()) -> Array:
# TODO(vfdev-5): deprecated 2024-5-16, remove after deprecation expires.
# TODO(vfdev-5): Remove after deprecation is completed (began 2024-5-16)
if not isinstance(ddof, DeprecatedArg):
warnings.warn(
"The ddof argument of jax.numpy.var is deprecated and setting it "
"The ddof argument of jax.numpy.std is deprecated and setting it "
"will soon raise an error. To avoid an error in the future, and to "
"suppress this warning, please use the correction argument instead.",
DeprecationWarning, stacklevel=2)
Expand Down
8 changes: 4 additions & 4 deletions jax/numpy/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -782,8 +782,8 @@ def stack(
dtype: Optional[DTypeLike] = ...,
) -> Array: ...
def std(a: ArrayLike, axis: _Axis = ..., dtype: DTypeLike = ...,
out: None = ..., ddof: int = ..., keepdims: builtins.bool = ..., *,
where: Optional[ArrayLike] = ...) -> Array: ...
out: None = ..., correction: int | float = ..., keepdims: builtins.bool = ..., *,
where: Optional[ArrayLike] = ..., ddof: int | DeprecatedArg = ...) -> Array: ...
def subtract(x: ArrayLike, y: ArrayLike, /) -> Array: ...
def sum(
a: ArrayLike,
Expand Down Expand Up @@ -893,8 +893,8 @@ def vander(
x: ArrayLike, N: Optional[int] = ..., increasing: builtins.bool = ...
) -> Array: ...
def var(a: ArrayLike, axis: _Axis = ..., dtype: DTypeLike = ...,
out: None = ..., ddof: int = ..., keepdims: builtins.bool = ..., *,
where: Optional[ArrayLike] = ...) -> Array: ...
out: None = ..., correction: int | float = ..., keepdims: builtins.bool = ..., *,
where: Optional[ArrayLike] = ..., ddof: int | DeprecatedArg = ...) -> Array: ...
def vdot(
a: ArrayLike, b: ArrayLike, *, precision: PrecisionLike = ...,
preferred_element_type: Optional[DTypeLike] = ...) -> Array: ...
Expand Down

0 comments on commit 8d42350

Please sign in to comment.