-
Notifications
You must be signed in to change notification settings - Fork 76
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
Change nan fallback in MOS Table to avoid JSON Serialization Warning #1958
Change nan fallback in MOS Table to avoid JSON Serialization Warning #1958
Conversation
Codecov ReportBase: 91.93% // Head: 91.94% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1958 +/- ##
=======================================
Coverage 91.93% 91.94%
=======================================
Files 140 140
Lines 15310 15314 +4
=======================================
+ Hits 14076 14081 +5
+ Misses 1234 1233 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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'm not sure exactly how to test this, but it looks like it does the job.
11b7b9f
to
51a83b5
Compare
51a83b5
to
b0b68c6
Compare
As per discussion with the team, the included nan-check didn't seem worth the additional dependency, so I removed the check and rebased. This should be ready for rereview! |
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.
Simple and elegant. Thanks!
Is a change log needed? I am on the fence. |
Ooops... looks like this affects tested behavior:
|
Probably wanna add extra logic to jdaviz/jdaviz/configs/mosviz/helper.py Lines 335 to 336 in 74c7655
|
Tests are passing! (Just pushed up a changelog, but nothing in the code changed). Thanks for the assist @pllim! |
Co-authored-by: P. L. Lim <[email protected]>
You got 2 approvals, so feel free to merge when CI is green. 😸 |
Thanks for the eyes! |
Owee, I'm MrMeeseeks, Look at me. There seem to be a conflict, please backport manually. Here are approximate instructions:
And apply the correct labels and milestones. Congratulations — you did some good work! Hopefully your backport PR will be tested by the continuous integration and merged soon! Remember to remove the If these instructions are inaccurate, feel free to suggest an improvement. |
Grr... auto backport failed. Do we care enough to manually backport? |
I am neutral... 😬 |
Description
Our traitlet messaging infrastructure does not support
nans
in the payload, as they are not JSON serializable. I changed the default fallback for missing RA/Dec values fromnan
to our defaultUnspecified
we use for the Filter and Grating. Unfortunately this means it's a string rather than a float, and thereby a different type, but oh well.I also add a preemptive sanitization check in
_add_to_table
to convert anynans
to string 'nan's in case the user actually provides anan
directly. The issue/slightly controversial step here is the need to addpandas
to our dependencies to actually perform the nan check.numpy.isnan
doesn't support complex objects and will spit an error, as opposed topandas.isna
. We can debate whether we want this or not; I can easily remove itFixes #
Change log entry
CHANGES.rst
? If you want to avoid merge conflicts,list the proposed change log here for review and add to
CHANGES.rst
before merge. If no, maintainershould add a
no-changelog-entry-needed
label.Checklist for package maintainer(s)
This checklist is meant to remind the package maintainer(s) who will review this pull request of some common things to look for. This list is not exhaustive.
trivial
label.