-
Notifications
You must be signed in to change notification settings - Fork 13
feature/ES-803 pressure to altitude #229
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
feature/ES-803 pressure to altitude #229
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## development #229 +/- ##
===============================================
+ Coverage 70.94% 71.35% +0.41%
===============================================
Files 35 35
Lines 3221 3278 +57
===============================================
+ Hits 2285 2339 +54
- Misses 936 939 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 comments, some of which I mentioned over Teams a while back:
- The exact string match for finding pressure/temperature columns is a bit brittle; looking for a substring would probably be more reliable.
- It looks like you are adding a new column to the results; since this is a 'conversion' function (and doesn't modify the input in-place), it might make more sense to replace the pressure column with the new altitude column.
- It might be useful to allow the user to specify a particular column as the pressure column, possibly temperature column as well, in case there is more than one. This isn't a requirement, though.
- The descriptions of the
base_*kwargs in the docstring could be more clear.
tests/calc/test_utils.py
Outdated
| np.testing.assert_allclose(utils.convert_units('degC', 'degF', df).Val[1], 32) | ||
|
|
||
|
|
||
| def test_to_altitude(): |
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 think this test does the right stuff, but it is going to get a bit harder to maintain as time goes on. What do you think about updating it to use parameterization to take in an input dataframe, parameters, expected result, and maybe an error message, and then essentially looping through the code?
Something like the 2nd example in https://hutchinson-digital.atlassian.net/wiki/spaces/GE/pages/167575568/Best+Practices+for+Python+Testing#Testing-Exceptions we can discuss if it is unclear
I agree with this, except number 2, adding a column vs replacing a column. I prefer the way you have it, returning a new dataframe with an added column. We don't expect memory to be an issue in this data, and I think it is easier to drop a column you don't want rather than add in the column you do. |
pscheidler
left a comment
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 looks a lot better, great work
No description provided.