-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Fix action space check #331
Fix action space check #331
Conversation
4e6729b
to
59820fc
Compare
59820fc
to
f2a9c8a
Compare
This ruff thing is ridiculous |
You can add: ruff enforces code style simeq to black, which makes life easier for contributors as they can run ruff format and ruff check to ensure that everyone uses a consistent code style. This also reduces the diff’s for each PR (except when ruff adds new rules). see for instance #330 |
@@ -159,29 +157,36 @@ def __hash__(self): | |||
|
|||
def _check_function_spaces(left, right): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dear code reviewers,
Please ignore the rest of the diff, that's just ruff.
Only take a look at this function.
Thank you.
@jorgensd FeniCSx CI fails, but I suspect it is for an unrelated reason? |
@finsberg, it seems like you missed a test with your latest PR: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks right.
@@ -9,15 +9,14 @@ | |||
|
|||
from itertools import chain | |||
|
|||
from ufl import matrix # noqa 401 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ufl.matrix
wants to be imported before ufl.action
. Also note that ufl.action.Action
is the first class to be imported within __init__.py
Fix action space check ruff unsafe ruff symmetric space check fix import conflict Fix action space check (FEniCS#331) * Fix action space check * ruff * unsafe ruff * symmetric space check * fix import conflict remove apply_default_restrictions() (FEniCS#329) * ruff==0.8.0 * remove apply_default_restrictions() --------- Co-authored-by: Matthew Scroggs <[email protected]>
The space check in
action
was not quite right, it is hard to tell exactly why. Previously it only passed becauseV == V.dual()
in Firedrake.This PR removes the need to check specific types of the arguments and handles them in a more symmetric way.