inducer / inducer/arraycontext

DeprecationWarning when broadcasting scalar array type over DOFArray

Đang mở
#292 3 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
9
Fork
11
Merge trung bình
17 giờ 12 phút
Pull request đã merge (30 ngày)
2

Mô tả

As discussed from CS meeting earlier, I am getting a `DeprecationWarning` when dividing a DOFArray by an arraycontext scalar:

```
/Users/nnytko2/Git/ceesd-nonlinear-solve/code/actx_issue.py:17: DeprecationWarning: Broadcasting over array context array type is deprecated and will no longer work in 2025. There is no replacement as of right now. See the discussion in https://github.com/inducer/arraycontext/pull/190.
y = x / flat_norm(x) # Warning occurs here
```

And minimal reproducing example:
```python
import numpy as np
import pyopencl as cl
from grudge.discretization import make_discretization_collection
from meshmode.array_context import PyOpenCLArrayContext
from meshmode.mesh.generation import generate_box_mesh
from meshmode.dof_array import flat_norm
from pytools.obj_array import flat_obj_array

ctx = cl.create_some_context()
queue = cl.CommandQueue(ctx)
actx = PyOpenCLArrayContext(queue)

mesh = generate_box_mesh((np.linspace(0, 1, 10),))
dcoll = make_discretization_collection(actx, mesh, order=1)

x = dcoll.zeros(actx) + 1.
y = x / flat_norm(x) # Warning occurs here

```

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.