FEniCS / ufl

UFL - Unified Form Language
https://fenicsproject.org
GNU Lesser General Public License v3.0
104 stars 64 forks source link

Use @property decorators #81

Open jorgensd opened 2 years ago

jorgensd commented 2 years ago

I think we should start using property decorators, as it would make alot of the code more readable.

wence- commented 2 years ago

A number of the zero-argument property functions currently do some computation to cache expensive results, so it might be worthwhile considering functools.cached_property too.

jorgensd commented 2 years ago

I'm fine with using functools.cached_property as well. I figured a proposal such as this would break quite a lot of code in both DOLFINx and Firedrake, but as long as you, @dham , @garth-wells etc. are happy with this being introduced, Im happy to give it a go over a weekend.

jhale commented 2 years ago

It would be good to create a release/tag with a last working version before proceeding with large changes.

dham commented 2 years ago

I'm in favour of backward-incompatible API improvements in UFL. However I'd rather they came in a limited number of batches, rather than a constant dribble. Users should understand us changing our API for the better, but their appetite for repeatedly changing their code will be limited.

jorgensd commented 2 years ago

It would be good to create a release/tag with a last working version before proceeding with large changes.

The latest version working with DOLFIN (bitbucket) is https://github.com/FEniCS/ufl/commit/1de7f12a2677a3a0c48cf0acd45e43a13de93b28 (or maybe https://github.com/FEniCS/ufl/commit/7a4303fb5d7253e39f9e67ae8da176a11c3c275f) The changes introduced in https://github.com/FEniCS/ufl/pull/77 breaks old ffc as noted in https://github.com/FEniCS/ufl/pull/77#issuecomment-1009769792