-
Notifications
You must be signed in to change notification settings - Fork 5
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
Use ifelse
in liquid_fraction
, plus a comment about condensate probability
#178
Conversation
ifelse
in liquid_fraction, plus a commentifelse
in liquid_fraction
, plus a comment about saturation adjustment
ifelse
in liquid_fraction
, plus a comment about saturation adjustmentifelse
in liquid_fraction
, plus a comment about condensate probability
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #178 +/- ##
==========================================
+ Coverage 92.96% 93.03% +0.06%
==========================================
Files 10 10
Lines 1152 1149 -3
==========================================
- Hits 1071 1069 -2
+ Misses 81 80 -1 ☔ 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.
Thank you!
Should we do a performance benchmark with ClimaAtmos before merging? If we're concerned about performance that's also a good reason to split this |
Yeah, I'll add some kernel benchmarks to CI here, and that way we can get a better idea of optimizations without needing to test against ClimaAtmos. |
If you can point me to it, I am happy to run some ClimaAtmos benchmarks before and after this change to report the results. I'd be more comfortable knowing for sure that the changes aren't detrimental (at the least). |
I would probably suggest just running CI with this branch and look at a few GPU jobs (with moisture). That said, we're in the middle of updating dependencies, so we'll need to wait until that is resolved. In the mean time, I did add some kernel benchmarks: https://github.com/CliMA/Thermodynamics.jl/blob/main/perf/kernel_bm.jl |
c1a4614
to
6643b27
Compare
I went ahead and rebased |
6643b27
to
0731196
Compare
Update src/relations.jl Revert inconsistent name
0731196
to
2f6ff0f
Compare
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.
I'm fine with merging, the doc string is a nice improvement, thanks @glwagner!
This PR makes moves towards resolving #177 by updating
liquid_fraction
to useifelse
rather thanif
,else
.I also changed the formatting a bit and added a comment about the condensate probability model that's implemented. The philosophy of the formatting change is to attempt to sharply distinguish between the two ways we have of writing expressions: mathematical notation (symbolic, concise), and in natural language (in this case, english). In my opinion, the current style does not use either concise mathematical notation or natural language, but rather a kind of frankenstein of the two that I find difficult to read (eg verbose, but symbolic).
There are only a few more places that
if
,else
occurs. If these changes are welcome then I'll also fix the others.Also curious --- there are many annotations of the kind
FT <: Real
andvar::FT
. What is the motivation for these? I don't think they speed up compilation. They do serve as a sort of self-documentation for the code though. For example, many functions are diagonalized (many input types are forced to all have typeFT
), even though the function would likely be valid and work as intended if one or more of the types were an integer, for example.