-
Notifications
You must be signed in to change notification settings - Fork 32
Fix Profile1DExport storing identical profiles by appending view inst… #1047
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
Conversation
|
@hhy2022 there seem to be some conflicts with your PR. Let me know if you need help resolving them |
RemDelaporteMathurin
left a comment
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.
Thanks for this quick fix @hhy2022 !
You need to resolve the conflicts with the fenicsx branch and then make sure your test is 1) really testing something and catching the bug (ie. failing without your fix, with an assert) 2) encapsulated inside a python function
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.
Tests need to be inside functions:
def test_profile1dexport():
...
...
assert profile.data[1] != profile.data[0]
Thank you for your guidance. This issue first appeared when I was working with the v2.0-beta release for the V-V book. I updated to the latest |
|
Closing since it was fixed by #1042 |
Proposed changes
Fix
Profile1DExportstoring identical profiles by appending view instead of copyThis PR fixes a bug in
Profile1DExportwhere profile data were stored as views of the same underlying array rather than independent copies. As a result, all exported profiles at different timesteps ended up containing identical values, which corresponding to the last computed timestep, regardless of the requested export times.This bug was discussed in Issue #1046
Fixes #1046.
Types of changes
What types of changes does your code introduce to FESTIM?
Checklist
Further comments
This fix is small but crucial for all workflows relying on Profile1DExport, including: