Add get_healpix_pixel to accept HealpixPixel objects or tuples and change functions to use it#81
Merged
smcguire-cmu merged 6 commits intomainfrom Apr 18, 2023
Conversation
Codecov Report
@@ Coverage Diff @@
## main #81 +/- ##
==========================================
+ Coverage 99.71% 99.73% +0.01%
==========================================
Files 23 24 +1
Lines 706 747 +41
==========================================
+ Hits 704 745 +41
Misses 2 2
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
delucchi-cmu
approved these changes
Apr 18, 2023
healpix_pixel_decorator to accept HealpixPixel objects or tuples and change functions to use itget_healpix_pixel to accept HealpixPixel objects or tuples and change functions to use it
Contributor
Author
|
The decision was made to change the decorator to a function to apply within the method |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
So a thing that came up in the last pull request I made was that we could be using the
HealpixPixelclass as inputs to the methods instead of order and pixel. I wasn't sure if it was nicer to have the object or not, since you have to initialize it if you have order and pixel which is a bit cumbersome. I'm not sure if this is a nice solution or completely horrible, but I wanted to be able to accept both easily, so I made a decorator that you can apply to a function with aHealpixPixelargument and it will then accept either aHealpixPixelobject or a tuple of (order, pixel). It works by inspecting the function arguments then checking if the argument is a tuple, and then converting to aHealpixPixelif it is.There's a few other minor things in here as well. A few more test cases for the PixelTreeBuilder, and I ran black formatting to help with linting which has apparently also changed formatting in a few other files in the paths and pixel margin code.