DerivedQuantities for fenicsx#735
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## fenicsx #735 +/- ##
===========================================
+ Coverage 98.90% 98.95% +0.05%
===========================================
Files 28 35 +7
Lines 1550 1631 +81
===========================================
+ Hits 1533 1614 +81
Misses 17 17 ☔ View full report in Codecov by Sentry. |
|
@JonathanGSDUFOUR glad to see progress on this! Have you tried testing your implementation on an example? |
Not yet, but it's a good next step indeed |
|
Would it be better to test each quantity separately or can we test them all in one case ? |
We want to test each quantity ensuring it computes the expected value. |
|
@JonathanGSDUFOUR I don't know if you are aware but:
|
Yeah I currently have an issue with the version of dolfinx on my environment so the test don't run correctly, so I'm a bit blind on that, I wanted to share some of the new additions on the PR. |
What's the issue? |
I had the latest version of dolfinx in my conda env (0.8.0) but it's solved now (I have one with 0.7.3 that runs the test correctly) |
|
@JonathanGSDUFOUR tests pass yay 🎉 |
There was a problem hiding this comment.
This is looking very good!
- Not for this PR but I think it would be good to raise an issue to remind ourselves to write tests for the surface classes in 2D since
MaximumSurfaceMinimumSurfaceAverageSurfaceandTotalSurfaceall give the exact same value in 1D. - To test that
MinimumVolumeandMaximumVolumecompute the right value in the right subdomain, could we write tests for a multi-material problem? I guess I have the same concerns about other classes
| value, bool | ||
| ): | ||
| raise TypeError("surface should be an int or F.SurfaceSubdomain1D") | ||
| if not isinstance(value, (int, F.SurfaceSubdomain)) or isinstance(value, bool): |
There was a problem hiding this comment.
Can you remind me where we have the type check for bool here @jhdark ?
There was a problem hiding this comment.
You can simplify this to:
| if ( | |
| isinstance(export, F.SurfaceFlux) | |
| or isinstance(export, F.TotalSurface) | |
| or isinstance(export, F.AverageSurface) | |
| ): | |
| if isinstance(export, (F.SurfaceFlux, F.TotalSurface, F.AverageSurface)): |
There was a problem hiding this comment.
Same comment as above
RemDelaporteMathurin
left a comment
There was a problem hiding this comment.
hey @JonathanGSDUFOUR this is good to go! Just two small refactoring comments and we can merge 🎉
RemDelaporteMathurin
left a comment
There was a problem hiding this comment.
This is all good to go @JonathanGSDUFOUR ! Thanks for this effort! 🎉
Proposed changes
A first look into what I have for now in trying to work on Issue #638 .
Types of changes
What types of changes does your code introduce to FESTIM?
Checklist
Further comments