-
Notifications
You must be signed in to change notification settings - Fork 416
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
Check that pressure decreases monotonically in parcel calculations #1967
Conversation
Hmm, will need to see if the xarray tutorial actually uses a non-monotonic sounding. |
Yes, the xarray tutorial is calling |
I went ahead and fixed the tutorial. Will be pushing the revisions shortly. |
This commit addresses Unidata#1339 using ideas from Unidata#1654. A new exception is added on the theory that parcel calculations are complicated, so there may be other problems with input soundings (extreme supersaturation?) that might want to be flagged in the future.
The xarray tutorial called mpcalc.surface_based_cape_cin with a dataset where the pressure increased with increasing index, but the function requires the other order. Here, we correct the order. In addition, the latitude is changed to a location where the CAPE is nonzero.
Codacy doesn't like the added file to define the exception. I can make adjustments as needed, just let me know. |
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 in really good shape, thanks for taking this on. Codacy is flagging the new file as increasing complexity (😆 ok, whatever), I think its actual problem is some unused variables in the new test. I commented there, let's see if that change quiets Codacy. Otherwise, only "major" change is to make the new exception part of the public API by importing in metpy.calc.__init__
.
Thanks for knocking this out @sgdecker ! |
This commit addresses #1339 using ideas from #1654. A new exception
is added on the theory that parcel calculations are complicated, so
there may be other problems with input soundings (extreme
supersaturation?) that might want to be flagged in the future.
Description Of Changes
See commit message above.
Checklist