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

Fix unused ElementType #2432

Merged
merged 1 commit into from
Nov 7, 2022
Merged

Conversation

tiagovla
Copy link
Contributor

@tiagovla tiagovla commented Nov 4, 2022

Fixes #2377.

@tiagovla
Copy link
Contributor Author

tiagovla commented Nov 4, 2022

Running:

pytest test/unit/fem/test_mixed_element.py::test_mixed_element

Results in:

FAILED test/unit/fem/test_mixed_element.py::test_mixed_element[FiniteElement-Lag
range-1-cell0] - TypeError: 'NoneType' object is not iterable
#...

This error happens in:

for integral_type, data in sd.get(domain).items():
# Check that the subdomain data for each integral of this type is
# the same
assert all([id(d) == id(data[0]) for d in data])
subdomains[integral_type] = data[0]

since sd.get(domain) = {'cell': None}. Checking if data is not None fixes it.

Maybe there's something else missing that I'm not aware.

@garth-wells
Copy link
Member

@jpdean is this related to your recent chages?

@jpdean
Copy link
Member

jpdean commented Nov 7, 2022

Yes, I'll take a look

@jpdean
Copy link
Member

jpdean commented Nov 7, 2022

@tiagovla I am unable to reproduce this error with your test. For me, sd.get(domain) returns {'cell': [None]}, as expected. Are you using the latest version of UFL?

@tiagovla
Copy link
Contributor Author

tiagovla commented Nov 7, 2022

@tiagovla I am unable to reproduce this error with your test. For me, sd.get(domain) returns {'cell': [None]}, as expected. Are you using the latest version of UFL?

That was it! I had #4e3868d. After upgrading it, the test passed.

@garth-wells garth-wells added ci Continuous Integration housekeeping Tidying and style improvements testing Test system issues and removed ci Continuous Integration labels Nov 7, 2022
@garth-wells garth-wells merged commit 597becc into FEniCS:main Nov 7, 2022
@tiagovla tiagovla deleted the test_mixed_element branch November 7, 2022 19:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
housekeeping Tidying and style improvements testing Test system issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ElementType not used in test
3 participants