ufl icon indicating copy to clipboard operation
ufl copied to clipboard

ufl.constantvalue.as_ufl should use the numbers hierarchy

Open dham opened this issue 1 year ago • 1 comments

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.

https://github.com/FEniCS/ufl/blob/e1e8e5627b0c7db17687bdb32857820ac4ddc072/ufl/constantvalue.py#L488C1-L500C1

dham avatar Oct 25 '23 08:10 dham

Obviously any PR will need tests.

dham avatar Oct 25 '23 08:10 dham