-
Notifications
You must be signed in to change notification settings - Fork 8
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
P3 - Lambda Testing #321
P3 - Lambda Testing #321
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #321 +/- ##
==========================================
+ Coverage 98.71% 98.72% +0.01%
==========================================
Files 33 33
Lines 1088 1101 +13
==========================================
+ Hits 1074 1087 +13
Misses 14 14 ☔ View full report in Codecov by Sentry. |
p3_sandbox/p3_lambdaTests.jl
Outdated
import RootSolvers as RS | ||
import CairoMakie as Plt | ||
|
||
FT = Float64 |
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.
Do things also work for Float32 now, or is that still an issue given our units?
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.
That is still an issue
p3_sandbox/p3_lambdaTests.jl
Outdated
) where {FT} | ||
|
||
ρ_rs = range(ρ_r_min, stop = ρ_r_max, length = numPlots) | ||
|
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.
Based on the plots shown here, could we add more test cases to the p3 scheme tests? Maybe not 100x100 for each ρ_rs
but 10x10. We could just check if the error is lower than some eps estimated from the plots?
p3_sandbox/p3_lambdaTests.jl
Outdated
λSteps::Int, | ||
F_rSteps::Int, | ||
) where {FT} | ||
λs = range(λ_min, stop = λ_max, length = λSteps) |
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.
If you are testing for Float32
and running into types issues it may be that we need FT(λ_min)
here
@@ -228,7 +228,7 @@ Returns the shape parameter μ for a given λ value | |||
Eq. 3 in Morrison and Milbrandt (2015). | |||
""" | |||
function DSD_μ(p3::PSP3, λ::FT) where {FT} | |||
@assert λ > FT(0) | |||
#@assert λ > FT(0) |
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.
Should we have an assert like this somewhere in the P3 scheme code? (Maybe not necessarily here)
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.
Lets try with the gamma functions
19c96c8
to
e966b7b
Compare
8532881
to
bdaa5d6
Compare
Purpose
Find range of Lambdas for which the shape solver is successful
To-do
Content
This PR contains the updated lambda linear guesser, and updated docs with plots
Still TO DO in following PR: make the assert statement in mu function work (potentially through taking the max between a value and the calculated lambda so it is never negative) and add more extensive tests for lambda calculator