-
Notifications
You must be signed in to change notification settings - Fork 3
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
Enable broadcasting with mismatched spaces. #80
Conversation
0f9f6cf
to
d477150
Compare
function __init__() | ||
Logging.disable_logging(Logging.Warn) # disable warnings (for broadcasting with mismatched spaces) | ||
end |
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.
@charleskawczynski @simonbyrne is there a better way to prevent these warnings from printing?
One option is to remove the warning all together if we think that the error should only be disabled when coupling anyways.
Another is perhaps to change the @warn
to @debug
so that they are at the lowest logging level and hidden by default.
Any suggestions?
5610591
to
b67df50
Compare
b67df50
to
f79b814
Compare
Fields.allow_mismatched_diagonalized_spaces() = true | ||
Operators.allow_mismatched_fd_spaces() = true |
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.
This should be moved into the test folder, it must be done at global scope.
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.
The rest of the changes in this file can probably be deleted
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.
Can you explain your reasoning for both of these points? I was thinking we want to disable these errors anytime we are using the coupler. Maybe that is simply too broad? The benefit is that coupler users won't have to think about these levers.
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.
This is kind of like type piracy. We should probably avoid changing other packages default behavior under the hood. What's the issue with doing this at the global level? I'm fairly certain it'll work, it's simple, and more transparent.
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.
That makes sense to me r.e. transparency. I just wanted to allow the user to not have to think about this when coupling and these errors are something we will want to disable pretty much every time we are coupling, therefore something more automatic seemed warranted.
Maybe a method that redefines these would be a happy medium? Something like
function allow_mismatched_spaces()
@eval Fields.allow_mismatched_diagonalized_spaces() = true
@eval Operators.allow_mismatched_fd_spaces() = true
end
I just feel that allow_mismatched_diagonalized_spaces
and allow_mismatched_fd_spaces
are pretty niche.
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 just wanted to allow the user to not have to think about this
This is not transparent.
I recommend not using @eval
. My recommendation is to include this at the top level. That is by far the simplest way to handle this situation. We can hide it later if we want to make things pretty.
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 recommend not using @eval. My recommendation is to include this at the top level. That is by far the simplest way to handle this situation. We can hide it later if we want to make things pretty.
Ok, I'm fine with holding off then.
Purpose and Content
Turns off broadcasting errors that stem from mismatched spaces using the tools from ClimaCore#640.
Benefits and Risks
This is necessary to couple components without using
parent
. Will allow #60 to be addressed. Current risks surround warning suppression - to prevent a warnings from being printed each broadcast, warnings and below are disabled in the logger. A more target approach would be more useful to only hide warnings stemming from broadcasting with mismatched spaces.Linked Issues
PR Checklist