Skip to content

Commit 006dd3e

Browse files
committed
Remove deprecated traversal.{to,from}_numpy
1 parent fa4b942 commit 006dd3e

File tree

2 files changed

+0
-34
lines changed

2 files changed

+0
-34
lines changed

arraycontext/__init__.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
flat_size_and_dtype,
5252
flatten,
5353
freeze,
54-
from_numpy,
5554
map_array_container,
5655
map_reduce_array_container,
5756
mapped_over_array_containers,
@@ -66,7 +65,6 @@
6665
rec_multimap_reduce_array_container,
6766
stringify_array_container_tree,
6867
thaw,
69-
to_numpy,
7068
unflatten,
7169
with_array_context,
7270
)
@@ -147,7 +145,6 @@
147145
"flat_size_and_dtype",
148146
"flatten",
149147
"freeze",
150-
"from_numpy",
151148
"get_container_context_opt",
152149
"get_container_context_recursively",
153150
"get_container_context_recursively_opt",
@@ -172,7 +169,6 @@
172169
"stringify_array_container_tree",
173170
"tag_axes",
174171
"thaw",
175-
"to_numpy",
176172
"unflatten",
177173
"with_array_context",
178174
"with_container_arithmetic",

arraycontext/container/traversal.py

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,40 +1106,10 @@ def _flat_size(subary: ArrayOrContainerOrScalar) -> Array | int | np.integer:
11061106
size = _flat_size(ary)
11071107
return size, common_dtype
11081108

1109-
# }}}
11101109

11111110
class _HasOuterBcastTypes(Protocol):
11121111
_outer_bcast_types: ClassVar[Collection[type]]
11131112

1114-
# {{{ numpy conversion
1115-
1116-
def from_numpy(
1117-
ary: np.ndarray | ScalarLike,
1118-
actx: ArrayContext) -> ArrayOrContainerOrScalar:
1119-
"""Convert all :mod:`numpy` arrays in the :class:`~arraycontext.ArrayContainer`
1120-
to the base array type of :class:`~arraycontext.ArrayContext`.
1121-
1122-
The conversion is done using :meth:`arraycontext.ArrayContext.from_numpy`.
1123-
"""
1124-
warn("Calling from_numpy(ary, actx) is deprecated, call actx.from_numpy(ary)"
1125-
" instead. This will stop working in 2023.",
1126-
DeprecationWarning, stacklevel=2)
1127-
1128-
return actx.from_numpy(ary)
1129-
1130-
1131-
def to_numpy(ary: ArrayOrContainer, actx: ArrayContext) -> ArrayOrContainer:
1132-
"""Convert all arrays in the :class:`~arraycontext.ArrayContainer` to
1133-
:mod:`numpy` using the provided :class:`~arraycontext.ArrayContext` *actx*.
1134-
1135-
The conversion is done using :meth:`arraycontext.ArrayContext.to_numpy`.
1136-
"""
1137-
warn("Calling to_numpy(ary, actx) is deprecated, call actx.to_numpy(ary)"
1138-
" instead. This will stop working in 2023.",
1139-
DeprecationWarning, stacklevel=2)
1140-
1141-
return actx.to_numpy(ary)
1142-
11431113
# }}}
11441114

11451115

0 commit comments

Comments
 (0)