ufl.constantvalue.as_ufl checks values against the intrinsic types float, complex, and int. This breaks for other scalar types, for example entries in numpy arrays. The check should instead be for numbers.Real, numbers.Complex, and numbers.Integral respectively.
ufl.constantvalue.as_ufl
checks values against the intrinsic typesfloat
,complex
, andint
. This breaks for other scalar types, for example entries in numpy arrays. The check should instead be fornumbers.Real
,numbers.Complex
, andnumbers.Integral
respectively.https://github.com/FEniCS/ufl/blob/e1e8e5627b0c7db17687bdb32857820ac4ddc072/ufl/constantvalue.py#L488C1-L500C1