Skip to content

Commit

Permalink
add thermo params test
Browse files Browse the repository at this point in the history
  • Loading branch information
nefrathenrici committed Dec 12, 2023
1 parent 3c2fc20 commit 54085d8
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions test/test_map.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ import Thermodynamics.Parameters.ThermodynamicsParameters
end


ThermodynamicsParameterMap = Dict(
ThermodynamicsParameterMap = (
:temperature_min_at_reference => :T_min_ref,
:entropy_water_vapor => :entropy_water_vapor,
:entropy_dry_air => :entropy_dry_air,
Expand Down Expand Up @@ -67,20 +67,20 @@ import Thermodynamics.Parameters.ThermodynamicsParameters
:potential_temperature_reference_pressure => :p_ref_theta,
)

# # Example function for thermo params - essentially a specific constuctor of `create_parameter_struct`
# function ThermodynamicsParameters(toml_dict)
# params = CP.get_parameter_values(toml_dict, ThermodynamicsParameterMap)
# FT = CP.float_type(toml_dict)
# ThermodynamicsParameters{FT}(; params...)
# end
# Example function for thermo params - essentially a specific constuctor of `create_parameter_struct`
function thermo_params(toml_dict)
params = CP.get_parameter_values(toml_dict, ThermodynamicsParameterMap)
FT = CP.float_type(toml_dict)
ThermodynamicsParameters{FT}(; params...)
end

# @testset "Test `create_parameter_struct`" begin
# thermo_params = ThermodynamicsParameters(toml_dict)
# @test thermo_params == CP.create_parameter_struct(
# ThermodynamicsParameters,
# toml_dict,
# ThermodynamicsParameterMap,
# )
# end
@testset "Test `create_parameter_struct`" begin
_thermo_params = thermo_params(toml_dict)
@test _thermo_params == CP.create_parameter_struct(
ThermodynamicsParameters,
toml_dict,
ThermodynamicsParameterMap,
)
end

end

0 comments on commit 54085d8

Please sign in to comment.