8000 ENH: Added ``fill`` option to ``np.atleast_2d`` and ``np.atleast_3d`` by eliegoudout · Pull Request #25170 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

ENH: Added fill option to np.atleast_2d and np.atleast_3d #25170

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
dispatch and signature fix
  • Loading branch information
eliegoudout committed Nov 12, 2023
commit b8fadd358fdfd4b3846ecc000ff314c27612df4e
4 changes: 2 additions & 2 deletions numpy/_core/shape_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def atleast_1d(*arys):
return res


def _atleast_2d_dispatcher(*arys):
def _atleast_2d_dispatcher(*arys, fill=None):
return arys


Expand Down Expand Up @@ -137,7 +137,7 @@ def atleast_2d(*arys, fill='left'):
return res


def _atleast_3d_dispatcher(*arys):
def _atleast_3d_dispatcher(*arys, fill=None):
return arys


Expand Down
20 changes: 14 additions & 6 deletions numpy/_core/shape_base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,26 @@ def atleast_1d(arys: ArrayLike, /) -> NDArray[Any]: ...
def atleast_1d(*arys: ArrayLike) -> list[NDArray[Any]]: ...

@overload
def atleast_2d(arys: _ArrayLike[_SCT], /) -> NDArray[_SCT]: ...
def atleast_2d(
arys: _ArrayLike[_SCT],
/,
fill: str = ...
) -> NDArray[_SCT]: ...
@overload
def atleast_2d(arys: ArrayLike, /) -> NDArray[Any]: ...
def atleast_2d(arys: ArrayLike, /, fill: str = ...) -> NDArray[Any]: ...
@overload
def atleast_2d(*arys: ArrayLike) -> list[NDArray[Any]]: ...
def atleast_2d(*arys: ArrayLike, fill: str = ...) -> list[NDArray[Any]]: ...

@overload
def atleast_3d(arys: _ArrayLike[_SCT], /) -> NDArray[_SCT]: ...
def atleast_3d(
arys: _ArrayLike[_SCT],
/,
fill: str = ...
) -> NDArray[_SCT]: ...
@overload
def atleast_3d(arys: ArrayLike, /) -> NDArray[Any]: ...
def atleast_3d(arys: ArrayLike, /, fill: str = ...) -> NDArray[Any]: ...
@overload
def atleast_3d(*arys: ArrayLike) -> list[NDArray[Any]]: ...
def atleast_3d(*arys: ArrayLike, fill: str = ...) -> list[NDArray[Any]]: ...

@overload
def vstack(
Expand Down
0