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

clean up image parsing and tests #210

Merged
merged 1 commit into from
Feb 10, 2024

Conversation

cshanahan1
Copy link
Contributor

@cshanahan1 cshanahan1 commented Feb 9, 2024

  1. Moved _get_data_from_image, which was previously part of _parse_image but used on its own in Background, to a method in _ImageParser instead of a function in the same module, to clean up imports.
  2. Fixed some tests in test_image_parsing. Previously to test _ImageParser.parse_image, the method was being accessed through FlatTrace (which inherits _ImageParser and therefore has parse_image), and 'object' was used seemingly to avoid failing when 'self' was accessed. This was working for the time being, but will cause issues when other methods are called within _parse_image (like the one added in this PR)

Copy link

codecov bot commented Feb 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (715361e) 81.77% compared to head (951646e) 81.94%.
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #210      +/-   ##
==========================================
+ Coverage   81.77%   81.94%   +0.17%     
==========================================
  Files          10       10              
  Lines        1004     1008       +4     
==========================================
+ Hits          821      826       +5     
+ Misses        183      182       -1     

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

@cshanahan1 cshanahan1 marked this pull request as ready for review February 9, 2024 02:48
Copy link
Contributor

@tepickering tepickering left a comment

Choose a reason for hiding this comment

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

looks good and cleans up the namespace. one question: if a class has a leading _, do its static and other methods need them as well? i would lean towards "no", but don't feel that strongly about it.

@cshanahan1
Copy link
Contributor Author

if a class has a leading _, do its static and other methods need them as well? i would lean towards "no", but don't feel that strongly about it.

thats a good question, i can see the case for both ways. if the class is 'private' i guess it would be implied its methods are too, so another leading underscore would be redundant? but it also would seem logical for them to have a leading underscore as well. in another PR i can do some cleanup and make sure everything follows one convention or the other.

@cshanahan1 cshanahan1 merged commit 85e1b20 into astropy:main Feb 10, 2024
11 checks passed
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.

2 participants