Skip to content

Commit 6cdee45

Browse files
pbrubeckclaude
andcommitted
Type the form argument rule with the classes that have an element
FormArgument itself declares neither ufl_function_space nor ufl_element, so annotating the handler with it fails mypy. Its subclasses Argument and Coefficient are what actually reach the rule, and both carry them. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent e3c2bbf commit 6cdee45

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ufl/algorithms/apply_function_pullbacks.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from functools import singledispatchmethod
1212

1313
from ufl.algorithms.map_integrands import map_integrands
14-
from ufl.classes import Expr, FormArgument, Interpolate, ReferenceValue
14+
from ufl.classes import Argument, Coefficient, Expr, FormArgument, Interpolate, ReferenceValue
1515
from ufl.corealg.dag_traverser import DAGTraverser
1616
from ufl.domain import extract_unique_domain
1717
from ufl.form import BaseForm
@@ -39,7 +39,7 @@ def _(self, o: Expr) -> Expr:
3939
return self.reuse_if_untouched(o)
4040

4141
@process.register(FormArgument)
42-
def _(self, o: FormArgument) -> Expr:
42+
def _(self, o: Argument | Coefficient) -> Expr:
4343
"""Represent 0-derivatives of a form argument on the reference element."""
4444
r = ReferenceValue(o)
4545
space = o.ufl_function_space()

0 commit comments

Comments
 (0)