-
Notifications
You must be signed in to change notification settings - Fork 0
Plotting functions cleanup #21
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
Conversation
|
|
||
| # Output contours in RA, dec instead of theta, phi | ||
| saving_contours = [] | ||
| saving_contours: list = [] |
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 isn't needed unless you subscript a sub-type
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 mypy was complaining here.
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.
skyreader/result.py:1097: error: Need type annotation for "saving_contours" (hint: "saving_contours: List[<type>] = ...") [var-annotated]
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.
odd... but okay if mypy says so!
| extra_header = fits_header, overwrite=True) | ||
| # Dump the whole contour | ||
| path = unique_id + ".contour.pkl" | ||
| print("Saving contour to", path) |
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.
You have several prints. Generally, I recommend avoiding this pattern for anything other than scripts (I see this package as a library) and using logs instead. What's the intended use of these plotting functions?
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.
Yes, I don't like it either, it is a pattern inherited from the old code. Surely we can implement proper loggers.
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 would say this is a todo for a future PR.
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.
sure, can you make an issue for it?
ric-evans
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.
A few comments for you.
The rest looks more up @tianluyuan's wheelhouse
tianluyuan
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.
Looks good! I added a few comments.
I was the one who removed the npz test files from skymap-scanner, as I didn't see it being used in any of its tests. I didn't realize they were still used here but it's ok as long as we keep npz support for a bit longer, i have some older scans that only exists in that format.
I added the npz test exactly for the purpose of the CI testing of the Skymap Scanner (we did not want the CI testing of the scanner failing because of SkyReader not reading npz), so no big deal indeed. |
|
I have added some minor modifications for partial compliance with Some of |
@mlincett @tianluyuan how about we add a separate script to convert npz to json? that way, we can remove npz support without abandoning the old format entirely |
yea that could work as a fail-safe for older scans and I would be fine with removing the npz support once the script is available. |
This PR cleans up a bit the plotting code, but does not yet address #22.
Important:
.npzfiles were removed fromskymap_scanner, hence the CI testing fornpzreading was failing. I have removed such test altogether as I believe we are not going to support.npzanymore in the future.