Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update apply_restrictions #271

Closed
wants to merge 13 commits into from
Closed

Update apply_restrictions #271

wants to merge 13 commits into from

Conversation

mscroggs
Copy link
Member

@mscroggs mscroggs commented Apr 19, 2024

Replace multifunction for apply_restrictions with a class method (defined in a protocol). Caching of results is now achieved using functools.lru_cache rather than inside the multifunction.

This will allow apply_restrictions to be implemented for types defined outside UFL without having to add the implementation of this to algorithms/apply_restrictions.py.

As far as users are concerned, there should be no noticable change.

I propose that we aim to make this change for all multifunctions (#273).

@mscroggs mscroggs marked this pull request as ready for review April 22, 2024 09:36
@mscroggs mscroggs marked this pull request as draft April 23, 2024 14:43
@mscroggs mscroggs closed this Apr 24, 2024
@mscroggs mscroggs deleted the mscroggs/apply_restrictions branch May 23, 2024 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant