inducer / inducer/arraycontext

DeprecationWarning when broadcasting scalar array type over DOFArray

未关闭
#292 3 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Python
星标
9
派生
11
平均合并
17 小时 12 分钟
30 天内合并 PR
2

描述

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

```

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。