-
Notifications
You must be signed in to change notification settings - Fork 8
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
Ability to generate planar metric terms and addition of test_eta.py
unit test
#65
Conversation
…tion for surface level (no eta_file specified)
Given that metric terms, and the grid generation methods as a whole are a part of NDSL, does it make sense to move the unit test |
Yes, please pull it down. We decided that the FV grid would come preset with NDSL, let's commit fully to it. |
…ed eta_file generator script for testing
test_eta.py
unit test
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.
Minor documentation changes mostly, otherwise lgtm
tests/grid/test_eta.py
Outdated
"""This test checks to see that the program | ||
fails when (1) the eta_file is not specified in the yaml | ||
configuration file; and (2), the computed eta values | ||
increase non-monotonically. For the latter test, the eta_file | ||
is specified in test_config_not_mono.yaml file and | ||
the ak and bk values in the eta_file have been changed nonsensically | ||
to result in erronenous eta values. |
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.
It looks like this test only does the first of these two, so the docstring should reflect that
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 docstring still needs to be updated
tests/grid/test_eta.py
Outdated
"""This test checks to see that the program | ||
fails when (1) the eta_file is not specified in the yaml | ||
configuration file; and (2), the computed eta values | ||
increase non-monotonically. For the latter test, the eta_file | ||
is specified in test_config_not_mono.yaml file and | ||
the ak and bk values in the eta_file have been changed nonsensically | ||
to result in erronenous eta values. | ||
""" |
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.
Same as above, please update the docstring to reflect the test
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.
same with this one
Co-authored-by: Oliver Elbert <[email protected]>
Co-authored-by: Oliver Elbert <[email protected]>
tests/grid/test_eta.py
Outdated
"""This test checks to see that the program | ||
fails when (1) the eta_file is not specified in the yaml | ||
configuration file; and (2), the computed eta values | ||
increase non-monotonically. For the latter test, the eta_file | ||
is specified in test_config_not_mono.yaml file and | ||
the ak and bk values in the eta_file have been changed nonsensically | ||
to result in erronenous eta values. |
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 docstring still needs to be updated
tests/grid/test_eta.py
Outdated
"""This test checks to see that the program | ||
fails when (1) the eta_file is not specified in the yaml | ||
configuration file; and (2), the computed eta values | ||
increase non-monotonically. For the latter test, the eta_file | ||
is specified in test_config_not_mono.yaml file and | ||
the ak and bk values in the eta_file have been changed nonsensically | ||
to result in erronenous eta values. | ||
""" |
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.
same with this one
self._ak, | ||
self._bk, | ||
) = self._set_hybrid_pressure_coefficients(eta_file, ak, bk) | ||
else: |
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.
Is this the behavior we want? I thought we'd rather raise a ValueError or something here?
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.
A ValueError is raised deeper in when the file specified is either non-existent, and even lower if the values do not fit the size passed in the config. My thought was that we could still have hybrid pressure values; zero valued if no file passed, or specified when passed.
… eta_file variable in generation.py to use an empty string in conditional statement for hybrid pressure generation
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.
Cleanup the default eta_file using the pythonic None
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.
Fix a type hint and we are ready to go
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.
LGTM
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.
👍
Description
A conditional statement has been added to the
__init__
method of theMetricTerms
class to allow for generating surface level metric terms (no hybrid pressure values). Initialization of such aMetricTerms
object will now contain zero-valued hybrid pressures.The unit test
test_eta.py
frompace/tests/main/grid
has now been moved intondsl/tests/grid
along with a python module for generating the test eta level containing files.This PR must be reviewed and merged after PR 92 is merged in pace
How Has This Been Tested?
Tested via the tests contained within the
tests
directory of NDSL, and in the tests of the dependent repositoriesPace tests will fail as the changes from PR 92 in Pace are necessary for passing.
Checklist: