Skip to content

Commit c724cb1

Browse files
committed
Rework dataclass array container arithmetic
- Deprecate automatic broadcasting of array context arrays - Introduce Bcast as an object to represent broadcast rules - Warn about uses of numpy array broadcasting, deprecated earlier - Clarify documentation, warning wording
1 parent 046e57a commit c724cb1

File tree

4 files changed

+451
-61
lines changed

4 files changed

+451
-61
lines changed

arraycontext/__init__.py

+15-2
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,15 @@
4343
register_multivector_as_array_container,
4444
serialize_container,
4545
)
46-
from .container.arithmetic import with_container_arithmetic
46+
from .container.arithmetic import (
47+
Bcast,
48+
Bcast1,
49+
Bcast2,
50+
Bcast3,
51+
BcastNLevels,
52+
BcastUntilActxArray,
53+
with_container_arithmetic,
54+
)
4755
from .container.dataclass import dataclass_array_container
4856
from .container.traversal import (
4957
flat_size_and_dtype,
@@ -103,6 +111,12 @@
103111
"ArrayOrContainerOrScalarT",
104112
"ArrayOrContainerT",
105113
"ArrayT",
114+
"Bcast",
115+
"Bcast1",
116+
"Bcast2",
117+
"Bcast3",
118+
"BcastNLevels",
119+
"BcastUntilActxArray",
106120
"CommonSubexpressionTag",
107121
"EagerJAXArrayContext",
108122
"ElementwiseMapKernelTag",
@@ -151,7 +165,6 @@
151165
"unflatten",
152166
"with_array_context",
153167
"with_container_arithmetic",
154-
"with_container_arithmetic"
155168
)
156169

157170

0 commit comments

Comments
 (0)