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

Add compatibility for ufl 2023 and ufl_legacy #364

Merged
merged 2 commits into from
Dec 7, 2023

Conversation

sblauth
Copy link
Owner

@sblauth sblauth commented Dec 7, 2023

This PR adds support for the new ufl version and backwards support for old ufl, which is called ufl_legacy - see https://fenicsproject.discourse.group/t/announcement-ufl-legacy-and-legacy-dolfin/11583

Closes #358

@sblauth sblauth added the enhancement New feature or request label Dec 7, 2023
@sblauth sblauth self-assigned this Dec 7, 2023
Copy link

codecov bot commented Dec 7, 2023

Codecov Report

Attention: 1 lines in your changes are missing coverage. Please review.

Comparison is base (c228f22) 92.29% compared to head (5b7e1c9) 92.35%.

Files Patch % Lines
cashocs/_forms/control_form_handler.py 83.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #364      +/-   ##
==========================================
+ Coverage   92.29%   92.35%   +0.06%     
==========================================
  Files          84       84              
  Lines        6642     6709      +67     
==========================================
+ Hits         6130     6196      +66     
- Misses        512      513       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@sblauth sblauth merged commit d30d7ea into main Dec 7, 2023
25 checks passed
@sblauth sblauth deleted the dev/ufl2023_compatibility branch December 7, 2023 08:30

from cashocs import _exceptions
from cashocs import _utils
from cashocs._optimization import cost_functional

if TYPE_CHECKING:
try:
from ufl_legacy.core import expr as ufl_expr

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed, the alternative import is needed here. ufl_legacy was imported as ufl above, so I first thought the alternative import is not needed here. But from ufl.core imports independently, so it would access expr from ufl 2023 instead of ufl_legacy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] Consider supporting FEniCS > 2019.1.0
2 participants