-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Calculate Relative Humidity via Magnus Tetens Equation #2286
base: main
Are you sure you want to change the base?
Conversation
@kurt-rhee Perhaps it would be better to continue the discussion in #1744 rather than start a new thread here. |
@adriesse good idea, I've copied the comment above to the thread in question |
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 agree that atmosphere.py
is a better home for this functionality
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.
moved in latest commit
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.
Still need to remove this magnus_tetens.py
file
…, changed type hints in docstring, changed to suggested coefficient format
Co-authored-by: Anton Driesse <[email protected]>
@adriesse agreed, anecdotal and unnecessary, it has been removed. |
I have left the formatting of functions outside of the tdew and rh conversion functions. I can format them to satisfy flake8 linter if that is desired by maintainers. Just let me know how I can help.
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.
Some more comments. A what's new entry will be needed before too long!
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.
Still need to remove this magnus_tetens.py
file
pvlib/tests/test_atmosphere.py
Outdated
@@ -82,12 +82,50 @@ def test_gueymard94_pw(): | |||
pws = atmosphere.gueymard94_pw(temps_humids[:, 0], temps_humids[:, 1]) | |||
|
|||
expected = np.array( | |||
[ 0.1 , 0.33702061, 1.12340202, 0.1 , | |||
[0.1 , 0.33702061, 1.12340202, 0.1 , |
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 suggest reverting the changes to lines 85 and 36, just to prevent the linter from complaining at you
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.
hey @kandersolar thanks for the look and sorry for the late response, I have been out for the holiday. I was wondering, should I try to remove all of the flake8 linter complaints? I could revert how the function looks in main, but flake8 still doesn't like the white space, or I could remove the white space and make the linter happy..
rh, | ||
tdew_rh_conversion_relative_humidity, | ||
check_names=False | ||
) |
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.
For completeness, let's add corresponding tests where the inputs are float and array. We will also need to include tests where alternative coefficient values are specified.
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.
@kandersolar just reworked the unit tests, I added tests which take in a numpy array and a float as well as a pandas series with a different set of coefficients. Let me know what you think, happy to adjust in any way.
Co-authored-by: Kevin Anderson <[email protected]>
Co-authored-by: Kevin Anderson <[email protected]>
Co-authored-by: Kevin Anderson <[email protected]>
Co-authored-by: Kevin Anderson <[email protected]>
Co-authored-by: Kevin Anderson <[email protected]>
Co-authored-by: Kevin Anderson <[email protected]>
docs/sphinx/source/reference
for API changes.docs/sphinx/source/whatsnew
for all changes. Includes link to the GitHub Issue with:issue:`num`
or this Pull Request with:pull:`num`
. Includes contributor name and/or GitHub username (link with:ghuser:`user`
).remote-data
) and Milestone are assigned to the Pull Request and linked Issue.Reasoning
Caveats
Caveat 1
Caveat 2
pvlib.atmosphere.py
where the gueymard94 function exists. I'd like the maintainers opinion before proceeding to update the docs and what's new file.