Skip to content

Conversation

@eoneill-mide
Copy link

No description provided.

@eoneill-mide eoneill-mide changed the base branch from main to development June 30, 2025 12:15
@codecov
Copy link

codecov bot commented Jun 30, 2025

Codecov Report

❌ Patch coverage is 98.27586% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 71.35%. Comparing base (a75ced3) to head (5e1bc05).
⚠️ Report is 15 commits behind head on development.

Files with missing lines Patch % Lines
endaq/calc/utils.py 98.27% 1 Missing ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@eoneill-mide eoneill-mide marked this pull request as ready for review July 11, 2025 13:37
Copy link
Member

@StokesMIDE StokesMIDE left a 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.

np.testing.assert_allclose(utils.convert_units('degC', 'degF', df).Val[1], 32)


def test_to_altitude():
Copy link
Member

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

@pscheidler
Copy link
Member

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.

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.

Copy link
Member

@pscheidler pscheidler left a 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

@eoneill-mide eoneill-mide merged commit ee40200 into development Jul 30, 2025
18 checks passed
@eoneill-mide eoneill-mide deleted the feature/ES-803_pressure_to_altitude branch July 30, 2025 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants