-
Notifications
You must be signed in to change notification settings - Fork 22
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
Reset derived quantity objects data and t at the beginning of a simulation #733
base: fenicsx
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## fenicsx #733 +/- ##
========================================
Coverage 98.39% 98.40%
========================================
Files 27 27
Lines 1437 1439 +2
========================================
+ Hits 1414 1416 +2
Misses 23 23 ☔ View full report in Codecov by Sentry. |
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.
Initial round of comments, the fix obviously works fine, but it's not the right place for it.
export.t = [] | ||
export.data = [] |
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.
Doing it here is not the right place.
This iterates through all the exports, which can be derived quantities, but also VTXExport or XDMFExport etc.
Instead, we could do it in write()
, making use of the self._is_first_time_export
attribute. For example here:
FESTIM/festim/exports/surface_quantity.py
Lines 75 to 76 in f08f0b5
if self._first_time_export: | |
header = ["t(s)", f"{title}"] |
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.
Alternatively we could do it here, but with an additional type check to only do this for derived quantities.
my_export = F.SurfaceFlux( | ||
field=H, | ||
surface=surf, | ||
) |
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.
Can you parametrise this test to also check for other derived quantities (eg. TotalVolume)
Hey @Allentro what is the status of this? |
Hi Remi, sorry this has slipped my list. I'll get this complete tomorrow! |
Hi @Allentro! Do you want someone else to pick up this PR? |
Hi Remi, This slipped my inbox.. I was just scrolling through my mentions and saw this. I'm happy to work on this tomorrow evening. Sorry for the delay on this. |
Proposed changes
I have implemented a fix to reset export.t and export.data at the beginning of a simulation, accompanied by a respective test. This PR resolves #728
Types of changes
Checklist