-
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
Do not exercise diagnostics when disabled #3038
Conversation
If the user defines customized diagnostics in the yaml file (e.g. here) but set |
2c26cc0
to
a745bdc
Compare
There's no documentation/defaults on |
a745bdc
to
d462a7f
Compare
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.
Maybe the more important question is, why do you find yourself disabling this piece of code? What needs to be changed so that you don't have to do that?
integrator, | ||
scheduled_diagnostics, | ||
) | ||
if config.parsed_args["enable_diagnostics"] |
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 config.parsed_args["enable_diagnostics"] | |
if !isnothing(scheduled_diagnostics) |
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.
I don't want to exercise this code, that is the point of this PR.
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.
I don't understand. If you add the suggestion above (in the other code chunk), this code is not exercised when there are no diagnostics
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.
So, if you want to not exercise this code, you can just comment out the diagnostics from your configuration
There is documentation. It's here: https://clima.github.io/ClimaAtmos.jl/dev/diagnostics/ And I don't think we should add another redundant switch that effectively just disables other yaml configurations: it makes handling interaction between configurations harder to predict and maintain. |
Thanks, sorry, I should have specified that I was referring to the flag in the source code.
Because the diagnostics is still brittle. I already gave feedback on the diagnostics and |
It's not redundant in that it ensures that our diagnostics are not exercised, the other flags do not do this. Think of this as a developer flag |
I am happy to have this PR merged, but please, report these issues and tag me so that we can fix them. I didn't know you or @bloops had problems.
I think that my suggestion is equivalent in terms of code not being exercised but does not add an extra configuration that needs to be maintained. |
Thank you, I appreciate your flexibility. I'm happy to open issues. I'll see if I can reproduce the one I ran into this morning.
Thats fair, but it does require users to specify both flags to disable diagnostics (and the |
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.
Thats fair, but it does require users to specify both flags to disable diagnostics (and the
diagnostics
flag does not seem to have a default), and those may or may not live in two different files for a particular configuration. I'm happy to (eventually) remove this flag, but I don't see it as adding major overhead, and I think that the name and docs are clear.
It's not a major overhead, but I would like to try resisting configuration creep, especially when other flags are very close in scope. We have already more than 100 and it is so easy to end up with configurations that are misconfigured and find unexpected results.
The default value for diagnostics
is its absence. diagnostics
is not a flag, but a nested structure, and it cannot be described in the same way we use for the other flags in default_config.yml
. We can probably add it by having it parse as nothing
by default, and handle that case specially.
This PR allows users to fully disable diagnostics, so that it is not exercised, when disabled. I find myself having to do this locally quite often, so I thought that it might be a good thing to merge.