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

Aerosol activation emulators: GP, ET, and ARG-informed #349

Merged
merged 2 commits into from
Mar 13, 2024

Conversation

sajjadazimi
Copy link
Member

This PR follows #318 with adding the remaining parts of the work of @mikhailmints. Here we add Gaussian processes and Evotrees. Also, informing data with ARG for training is enabled.

Copy link

codecov bot commented Mar 10, 2024

Codecov Report

Attention: Patch coverage is 93.33333% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 98.57%. Comparing base (d38910d) to head (edc4021).
Report is 1 commits behind head on main.

Files Patch % Lines
ext/Common.jl 93.33% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #349      +/-   ##
==========================================
+ Coverage   98.11%   98.57%   +0.46%     
==========================================
  Files          35       35              
  Lines        1165     1195      +30     
==========================================
+ Hits         1143     1178      +35     
+ Misses         22       17       -5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

ext/Common.jl Outdated
@@ -68,6 +71,67 @@ function preprocess_aerosol_data(X::DataFrame)
return X
end

function get_ARG_act_frac(data_row::NamedTuple)

FT = Float32
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to pass in the FT and the parameter structs as arguments, instead of defining them here?

pv0 = TD.saturation_vapor_pressure(tps, FT(T), TD.Liquid())
vapor_mix_ratio = pv0 / TD.Parameters.molmass_ratio(tps) / (p - pv0)
q_vap = vapor_mix_ratio / (vapor_mix_ratio + 1)
q = TD.PhasePartition(FT(q_vap), FT(0), 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.

Are we sure there is never any cloud condensate in this data?

FT = Float32

# If the ML model already exists load it in.
# If it does not exist, train a NN
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# If it does not exist, train a NN
# If it does not exist, train

ml_model = "NN",
machine_name = "2modal_nn_machine_naive.jls",
)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we encapsulate individual tests with

TT.@testset "0M_microphysics" begin

end

blocks? I think this way they display nicer in the test summary in the CI

@trontrytel trontrytel self-requested a review March 11, 2024 23:00
Copy link
Member

@trontrytel trontrytel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for doing this! My two asks would be to:

  • not hardcode the FT and parameter structs in Common.jl
  • add some small documentation page about the available extensions. Apologies I didn't do it with the initial NN extension. I was planning to add it when we have the other guys. I was thinking to add a short section in the Aerosol Activation part of our docs and mention there that we have those additional models. (We can add plots, once we have them for the paper)

@trontrytel
Copy link
Member

Actually, one more thought. Is there a way to add the N_activated_per_mode that we define in ext to the API docs?

@trontrytel trontrytel added the enhancement New feature or request label Mar 12, 2024
@sajjadazimi
Copy link
Member Author

I tried loading the extension in docs to make Julia understand we have this extra function, but it doesn't add it to API. Maybe documenter goes over the specific files of each module to get the documentations and does not do it with the extensions.

@sajjadazimi sajjadazimi merged commit c5ea233 into main Mar 13, 2024
9 of 10 checks passed
@sajjadazimi sajjadazimi deleted the sa/ml_aerosol_activation_ET_GP branch March 13, 2024 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Approved 🍀 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants