-
Notifications
You must be signed in to change notification settings - Fork 19
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
Throw a more informative error for unsupported config dictionary entries #2844
Conversation
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.
Looks good to me. I added @nefrathenrici to take a look, too.
hyperdiff
does have an entry in our automated docs: https://clima.github.io/ClimaAtmos.jl/dev/config/#Default-Configuration. It looks like none
turns off hyperdiffusion
Ok great, I didn't know about that docs page. The docs also suggest making a Are config dictionaries fully supported, or are there options that can only be provided in a yml file? I'm happy to work on making the changes that allow us to avoid the yml file step (this will be especially useful for developing a coupled model). |
I agree, but I do think that there is a split between the parameters being tuned, and those not.
So, we can technically do whatever we want in the REPL. The driver has if !(@isdefined config)
config = CA.AtmosConfig()
end
simulation = CA.get_simulation(config)
(; integrator) = simulation
sol_res = CA.solve_atmos!(simulation) And you can define your own For example, you could do: import ClimaAtmos as CA
config = CA.AtmosConfig()
config.parsed_args["rad"] = "clearsky"; # use clearsky RRTMGP
# run with this config:
include(joinpath(pkgdir(CA), "examples", "hybrid", "driver.jl")) Also, there is import ClimaAtmos as CA
include(joinpath(pkgdir(CA), "perf", "common.jl"))
config = TargetJobConfig("gpu_aquaplanet_dyamond") # get GPU aquaplanet dyamond job config, from our buildkite CI
# run with this config:
include(joinpath(pkgdir(CA), "examples", "hybrid", "driver.jl")) |
The point is just that for developing the Earth system model, we'd like to be able to build Changing |
Note that we don't want to run the driver... we need to build |
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 for adding this, the error before was very unclear.
Config dictionaries are fully supported, and are the easiest way to set the configuration interactively:
import ClimaAtmos as CA
config_dict = Dict("hyperdiff" => "false", "t_end" => "10days")
config = CA.AtmosConfig(config_dict)
simulation = CA.get_simulation(config)
sol_res = CA.solve_atmos!(simulation)
Awesome thank you! Just as a side comment, we don't want to use PS I think |
I made one more change to error messages. I mixed up the |
Just a note --- this approach recommended by @charleskawczynski is not fully supported right now, because |
This PR helps users debug configuration dictionaries by throwing an error that indicates which entry is problematic and why.
After this PR,
throw the error
whereas previously users were greeted with the more mysterious
(I'm also wondering how to turn hyperdiffusion off).
It also improves the error users get when their "config" is not valid (note that the term "config" is being used to mean multiple things --- either
AtmosConfig
, or the "config type", which can be sphere, column, etc. This should probably be improved because it is another source of bugs...)For example if we try to use
config = "crazy configuration"
we get the error: