Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
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
2 changes: 0 additions & 2 deletions array_api_compat/common/_aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -720,8 +720,6 @@ def iinfo(type_: DType | Array, /, xp: Namespace) -> Any:
"finfo",
"iinfo",
]
_all_ignore = ["inspect", "array_namespace", "NamedTuple"]


def __dir__() -> list[str]:
return __all__
2 changes: 0 additions & 2 deletions array_api_compat/common/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1042,7 +1042,5 @@ def is_lazy_array(x: object) -> bool:
"to_device",
]

_all_ignore = ["sys", "math", "inspect", "warnings"]

def __dir__() -> list[str]:
return __all__
2 changes: 0 additions & 2 deletions array_api_compat/common/_linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,8 +225,6 @@ def trace(
'matrix_transpose', 'svdvals', 'vecdot', 'vector_norm', 'diagonal',
'trace']

_all_ignore = ['math', 'normalize_axis_tuple', 'get_xp', 'np', 'isdtype']


def __dir__() -> list[str]:
return __all__
3 changes: 2 additions & 1 deletion array_api_compat/cupy/_aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,4 +161,5 @@ def count_nonzero(
'bitwise_invert', 'bitwise_right_shift',
'bool', 'concat', 'count_nonzero', 'pow', 'sign']

_all_ignore = ['cp', 'get_xp']
def __dir__() -> list[str]:
return __all__
1 change: 0 additions & 1 deletion array_api_compat/cupy/_typing.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from __future__ import annotations

__all__ = ["Array", "DType", "Device"]
_all_ignore = ["cp"]

from typing import TYPE_CHECKING

Expand Down
2 changes: 0 additions & 2 deletions array_api_compat/dask/array/_aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -369,8 +369,6 @@ def count_nonzero(
"bitwise_left_shift", "bitwise_right_shift", "bitwise_invert",
] # fmt: skip
__all__ += _aliases.__all__
_all_ignore = ["array_namespace", "get_xp", "da", "np"]


def __dir__() -> list[str]:
return __all__
4 changes: 3 additions & 1 deletion array_api_compat/dask/array/fft.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,6 @@
rfftfreq = get_xp(da)(_fft.rfftfreq)

__all__ = fft_all + ["fftfreq", "rfftfreq"]
_all_ignore = ["da", "fft_all", "get_xp", "warnings"]

def __dir__() -> list[str]:
return __all__
3 changes: 2 additions & 1 deletion array_api_compat/dask/array/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,5 @@ def svdvals(x: _Array) -> _Array:
"cholesky", "matrix_rank", "matrix_norm", "svdvals",
"vector_norm", "diagonal"]

_all_ignore = ['get_xp', 'da', 'linalg_all', 'warnings']
def __dir__() -> list[str]:
return __all__
4 changes: 1 addition & 3 deletions array_api_compat/numpy/_aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def count_nonzero(
else:
unstack = get_xp(np)(_aliases.unstack)

__all__ = [
__all__ = _aliases.__all__ + [
"__array_namespace_info__",
"asarray",
"astype",
Expand All @@ -176,8 +176,6 @@ def count_nonzero(
"count_nonzero",
"pow",
]
__all__ += _aliases.__all__
_all_ignore = ["np", "get_xp"]


def __dir__() -> list[str]:
Expand Down
1 change: 0 additions & 1 deletion array_api_compat/numpy/_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
Array: TypeAlias = np.ndarray

__all__ = ["Array", "DType", "Device"]
_all_ignore = ["np"]


def __dir__() -> list[str]:
Expand Down
11 changes: 1 addition & 10 deletions array_api_compat/numpy/fft.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import numpy as np
from numpy.fft import __all__ as fft_all
from numpy.fft import fft2, ifft2, irfft2, rfft2

from .._internal import get_xp
Expand All @@ -21,15 +20,7 @@
ifftshift = get_xp(np)(_fft.ifftshift)


__all__ = ["rfft2", "irfft2", "fft2", "ifft2"]
__all__ += _fft.__all__

__all__ = _fft.__all__ + ["rfft2", "irfft2", "fft2", "ifft2"]

def __dir__() -> list[str]:
return __all__


del get_xp
del np
del fft_all
del _fft
7 changes: 3 additions & 4 deletions array_api_compat/numpy/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def solve(x1: Array, x2: Array, /) -> Array:
vector_norm = get_xp(np)(_linalg.vector_norm)


__all__ = [
__all__ = _linalg.__all__ + [
"LinAlgError",
"cond",
"det",
Expand All @@ -132,12 +132,11 @@ def solve(x1: Array, x2: Array, /) -> Array:
"matrix_power",
"multi_dot",
"norm",
"solve",
"tensorinv",
"tensorsolve",
"vector_norm",
]
__all__ += _linalg.__all__
__all__ += ["solve", "vector_norm"]


def __dir__() -> list[str]:
return __all__
2 changes: 0 additions & 2 deletions array_api_compat/torch/_aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -841,5 +841,3 @@ def sign(x: Array, /) -> Array:
'unique_all', 'unique_counts', 'unique_inverse', 'unique_values',
'matmul', 'matrix_transpose', 'vecdot', 'tensordot', 'isdtype',
'take', 'take_along_axis', 'sign', 'finfo', 'iinfo', 'repeat']

_all_ignore = ['torch', 'get_xp']
2 changes: 0 additions & 2 deletions array_api_compat/torch/fft.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,3 @@ def ifftshift(
"fftshift",
"ifftshift",
]

_all_ignore = ['torch']
4 changes: 0 additions & 4 deletions array_api_compat/torch/linalg.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,5 @@ def vector_norm(
__all__ = linalg_all + ['outer', 'matmul', 'matrix_transpose', 'tensordot',
'cross', 'vecdot', 'solve', 'trace', 'vector_norm']

_all_ignore = ['torch_linalg', 'sum']

del linalg_all

def __dir__() -> list[str]:
return __all__
Loading
Loading