Skip to content
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

Merged
merged 1 commit into from
Feb 22, 2024
Merged

P3 - Lambda Testing #321

merged 1 commit into from
Feb 22, 2024

Conversation

anastasia-popova
Copy link
Contributor

@anastasia-popova anastasia-popova commented Feb 13, 2024

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


  • I have read and checked the items on the review checklist.

Copy link

codecov bot commented Feb 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2a2d62f) 98.71% compared to head (8532881) 98.72%.
Report is 1 commits behind head on main.

❗ Current head 8532881 differs from pull request most recent head bdaa5d6. Consider uploading reports for the commit bdaa5d6 to get more accurate results

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.
📢 Have feedback on the report? Share it here.

import RootSolvers as RS
import CairoMakie as Plt

FT = Float64
Copy link
Member

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?

Copy link
Contributor Author

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

) where {FT}

ρ_rs = range(ρ_r_min, stop = ρ_r_max, length = numPlots)

Copy link
Member

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?

λSteps::Int,
F_rSteps::Int,
) where {FT}
λs = range(λ_min, stop = λ_max, length = λSteps)
Copy link
Member

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)
Copy link
Member

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)

Copy link
Member

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

@anastasia-popova anastasia-popova force-pushed the ap/lambdas branch 8 times, most recently from 19c96c8 to e966b7b Compare February 20, 2024 22:48
@anastasia-popova anastasia-popova marked this pull request as ready for review February 20, 2024 23:09
@anastasia-popova anastasia-popova self-assigned this Feb 21, 2024
@trontrytel trontrytel self-requested a review February 21, 2024 22:33
@anastasia-popova anastasia-popova merged commit 7fbe344 into main Feb 22, 2024
8 checks passed
@anastasia-popova anastasia-popova deleted the ap/lambdas branch February 22, 2024 19:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants