-
Notifications
You must be signed in to change notification settings - Fork 422
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
Added thermo calculations #337
Conversation
Virtual temperature, virtual potential temperature, and density calculations were added to the thermo module. This addresses need for a density calculation to allow for computation of EPV. See also: #231
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 great--just a few minor stylistic nits that I've pointed out (there are a few more caught by Travis/AppVeyor--they're all the same. See here for instance.)
Big kudos for adding references and the equations in as well.
metpy/calc/tests/test_thermo.py
Outdated
@@ -9,7 +9,8 @@ | |||
from metpy.calc import (dewpoint, dewpoint_rh, dry_lapse, equivalent_potential_temperature, | |||
lcl, lfc, mixing_ratio, moist_lapse, parcel_profile, | |||
potential_temperature, saturation_mixing_ratio, | |||
saturation_vapor_pressure, vapor_pressure) | |||
saturation_vapor_pressure, vapor_pressure, virtual_temperature, | |||
virtual_potential_temperature, density) |
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 move density to the front of the list (it's kept alphabetical)?
metpy/calc/thermo.py
Outdated
""" | ||
return temperature * ((mixing + molecular_weight_ratio)/(molecular_weight_ratio * (1 + mixing))) | ||
|
||
@exporter.export |
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 add an extra blank line?
Can you click next to clahub above and electronically sign our Contributor License Agreement? See here for the rationale behind it. |
@jrleeman will this virtual temperature function be compatible with you CAPE work? |
Clean up code to match metpy/PEP8 style in thermo module See also: #337
Fixed white space and import order in thermo module and tests See also: #337
A previous fix to the test_thermo module led to an incidental double import. This has been fixed. Small PEP8 whitespace issue also fixed. See also: #337
Looks like I fixed the style issues. Let me know if you find anything else to take care of. |
Thanks! I'll have a look and make sure the virtual temperature calculation jives with one on a branch currently and let you know. This is great work! |
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 really minor thing for the doc build.
metpy/calc/thermo.py
Outdated
|
||
Notes | ||
----- | ||
.. math:: T_v = T \frac{\textsl{w} + \epsilon}{\epsilon\,(1 + \textsl{w})} |
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.
Would you mind changing the \textsl to \text? The documentation build doesn't know \textsl and it renders poorly on the online docs. Thanks!
metpy/calc/thermo.py
Outdated
|
||
Notes | ||
----- | ||
.. math:: \Theta_v = \Theta \frac{\textsl{w} + \epsilon}{\epsilon\,(1 + \textsl{w})} |
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 \textsl issue
Removed latex \textsl command causing rendering issues in docs See also: #337
@nawendt - One last thing if you don't mind (if you want we can take care of it on this end as well). The new functions need to be added to the documentation build. In
|
Sphinx-generated docs needed hooks to included newest thermo functions See also: #337
Congratulations on your first Metpy PR--thanks for the contribution! |
Virtual temperature, virtual potential temperature, and density
calculations were added to the thermo module. This addresses need for
a density calculation to allow for computation of EPV. Tests for these
calculations were also added.
See also: #231