Skip to content
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

Weed out unused utils functions #381

Merged
merged 1 commit into from
Mar 1, 2024
Merged

Weed out unused utils functions #381

merged 1 commit into from
Mar 1, 2024

Conversation

teutoburg
Copy link
Contributor

@teutoburg teutoburg commented Mar 1, 2024

Remove utils functions that were not used anywhere in the codebase (I also checked our other main packages).

@teutoburg teutoburg self-assigned this Mar 1, 2024
@teutoburg teutoburg added the refactor Implementation improvement label Mar 1, 2024
Copy link

codecov bot commented Mar 1, 2024

Codecov Report

Attention: Patch coverage is 60.00000% with 2 lines in your changes are missing coverage. Please review.

Project coverage is 74.94%. Comparing base (8f8963e) to head (afa9616).

Files Patch % Lines
scopesim/utils.py 50.00% 2 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff               @@
##           dev_master     #381      +/-   ##
==============================================
+ Coverage       74.24%   74.94%   +0.69%     
==============================================
  Files              56       56              
  Lines            7867     7770      -97     
==============================================
- Hits             5841     5823      -18     
+ Misses           2026     1947      -79     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@teutoburg teutoburg marked this pull request as ready for review March 1, 2024 00:18
@teutoburg
Copy link
Contributor Author

teutoburg commented Mar 1, 2024

We have two incarnations of zenith distance to airmass (and vice-versa) conversion functions each. The implementations are (shockingly) identical, but the names and level of docstring details differ. Also, only one variant of each is actually used anywhere. However, I slightly prefer the name of the one that is not used and less well documented, mostly for readability. I might just end up replacing the names with the underscore ones, and keeping the variant that's better documented. But for now I just put them next to each other, so it's at least more obvious that we have this duplication (they used to be half a module apart, so I guess the duplication was missed until now).

Also, diff coverage is complaining because I moved the unused (and untested) variants of these functions...

@teutoburg
Copy link
Contributor Author

Docs build fails (also after retry) with another ContentTooShortError, which I think is unrelated.

Copy link
Collaborator

@hugobuddel hugobuddel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These functions being unused and untested is reason enough to remove them, because now they are a liability, not an asset.

About the airmass function names, both names are bad. Maybe I should add the functions zenith_dist_from_airmass() and airmass_from_zenith_dist() to this file 😜!

@teutoburg teutoburg merged commit 53ed24c into dev_master Mar 1, 2024
23 of 25 checks passed
@teutoburg teutoburg deleted the fh/dutch-utils branch March 1, 2024 09:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactor Implementation improvement
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants