ufl icon indicating copy to clipboard operation
ufl copied to clipboard

Use @property decorators

Open jorgensd opened this issue 4 years ago • 5 comments

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

  • [x] #169

jorgensd avatar Jan 14 '22 18:01 jorgensd

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.

wence- avatar Jan 17 '22 12:01 wence-

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.

jorgensd avatar Jan 17 '22 13:01 jorgensd

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

jhale avatar Jan 17 '22 13:01 jhale

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.

dham avatar Jan 17 '22 13:01 dham

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

jorgensd avatar Jan 17 '22 13:01 jorgensd