firedrakeproject / firedrake

Firedrake is an automated system for the portable solution of partial differential equations using the finite element method (FEM)
https://firedrakeproject.org
Other
517 stars 160 forks source link

BUG: `Cofunction += Cofunction` leads to `DeprecationWarning`s #3871

Open jrmaddison opened 3 days ago

jrmaddison commented 3 days ago

Describe the bug

import warnings

warnings.simplefilter("default")

import firedrake as fd

mesh = fd.UnitIntervalMesh(1)
space = fd.FunctionSpace(mesh, "DG", 0)

u = fd.Cofunction(space.dual())
u += fd.Cofunction(space.dual())

leads to the warnings

/home/jmaddis2/build/firedrake/firedrake/src/PyOP2/pyop2/types/dat.py:408: DeprecationWarning: Expression.index(i) is deprecated and will be removed in 2H2025. Use 'expr[i] 'instead.
  lhs = _self.index(i)
/home/jmaddis2/build/firedrake/firedrake/src/PyOP2/pyop2/types/dat.py:416: DeprecationWarning: Expression.index(i) is deprecated and will be removed in 2H2025. Use 'expr[i] 'instead.
  rhs = _other.index(i)

Expected behavior No warning.

Environment: Ubuntu 24.04, new Firedrake build.

Ig-dolci commented 2 days ago

Does this warning belong to one of the loopy related warnings, @connorjward?

connorjward commented 2 days ago

This is a result of the update to pymbolic 2024.1. Since we are currently trying to move PyOP2 into the Firedrake repository I think fixing this should wait until that happens.