-
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
Adding Showalter Index to Thermo Functions #1673
Conversation
This pull request introduces 2 alerts when merging fc559c4 into 9ed0829 - view on LGTM.com new alerts:
|
Thanks for the contribution @michaelavs ! Before delving into the details of the implementation, I have a design question. Right now the function is: def showalter_index(pressure, temperature, lcl850, t500): This requires the users to manually calculate the LCL from 850 hPa as well as pull out the environmental temperature. From your perspective as a user, would it be simpler to use to allow the user to only pass in the profile pressure and temperature and have the function do everything else: def showalter_index(pressure, temperature): ? Or would that miss some use cases? |
I don't see a reason to not narrow down the function to pass only profile pressure and temperature! I will be pushing a newer version here shortly with that change! |
This pull request introduces 1 alert when merging 3e39f67 into 3adfbd8 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 3e39f67 into 1aaf805 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging cb5619e into 90e92c8 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging 9a21918 into 90e92c8 - view on LGTM.com new alerts:
|
This pull request introduces 1 alert when merging ea3c914 into 90e92c8 - view on LGTM.com new alerts:
|
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.
Thanks for the contribution! This is generally in pretty good, and thanks for including a test. I have a few comments to make things fit pep8 style better, plus a few clean-ups. Also, there are apparently some "blank" lines that have spaces--those seem to be angering the style checker.
@dopplershift |
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 can't believe it's been 4 weeks--time flies! This is looking good! Just a few things the style checker is complaining about. Also, can you add showalter_index
to our list of functions in docs/_templates/overrides/metpy.calc.rst
under "Soundings"? That way it will show up in the right table in our docs.
Thanks for working on this!
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 looking really good, thanks for sticking with us. One last thing: we have, internally MetPy banned the syntax like a * units.hPa
because with arrays it can lead to hidden bugs when using masked arrays.
So while what you had wasn't in any way wrong, can you update to what I suggested to make the checker happy?
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.
🎉 Just need the bots to pass and this will be in!
Congrats on your first contribution to MetPy @michaelavs ! |
Description Of Changes
Adding a function to calculate the Showalter Index. Currently an individual file in the directory for testing purposes but will eventually be added to the "thermo.py" file when ready for approval/merging. Tested using dataset available in the GeoCAT-datafiles library and then by hand using guidelines for the function described by Galway on the visualization of the dataset in the GeoCAT-examples gallery.
Checklist