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

BUG: fix handling of nan input for Time properties #463

Merged
merged 3 commits into from
Jul 27, 2023

Conversation

bsipocz
Copy link
Member

@bsipocz bsipocz commented Jul 25, 2023

This should fix the current test failure with the IRAS record from CADC.

Fix #460

@bsipocz bsipocz requested a review from andamian July 25, 2023 21:45
@bsipocz bsipocz added this to the v1.5 milestone Jul 25, 2023
@codecov
Copy link

codecov bot commented Jul 25, 2023

Codecov Report

Merging #463 (533390f) into main (500ce4d) will decrease coverage by 0.08%.
The diff coverage is 11.11%.

@@            Coverage Diff             @@
##             main     #463      +/-   ##
==========================================
- Coverage   80.08%   80.00%   -0.08%     
==========================================
  Files          52       52              
  Lines        6020     6027       +7     
==========================================
+ Hits         4821     4822       +1     
- Misses       1199     1205       +6     
Files Changed Coverage Δ
pyvo/dal/sia2.py 76.96% <11.11%> (-1.14%) ⬇️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@bsipocz bsipocz modified the milestones: v1.5, v1.4.2 Jul 25, 2023
@bsipocz
Copy link
Member Author

bsipocz commented Jul 25, 2023

(ignore the changelog failure, I was testing the milestone check and while it's been fixed, it doesn't trigger a rerun and thus a green checkmark)

Copy link
Contributor

@tomdonaldson tomdonaldson left a comment

Choose a reason for hiding this comment

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

Thanks @bsipocz . This is clearly better than before.

I do agree that it feels like there would be a better way to deal with this. It's unclear to me how (or currently if) this property is used, so maybe that would help, but I wonder how useful or important it is for this getter to return a Time object. Any opportunity for a getter to fail makes it more fragile.

With this one now returning either a time or something that isn't np.finite(), a consumer of the value likely still needs to check which it is, so they may as well be the ones to create the Time object if that's what they want.

@bsipocz
Copy link
Member Author

bsipocz commented Jul 26, 2023

The issue with returning a Time object is that there isn't really an empty time object, as opposed to e.g. a Quantity/etc.

That being said, I'm happy to return whatever you think is better. And I have just checked and SIA we return None for the dateobs property, so that's an easy thing to do here, too.

@tomdonaldson
Copy link
Contributor

The issue with returning a Time object is that there isn't really an empty time object, as opposed to e.g. a Quantity/etc.

That being said, I'm happy to return whatever you think is better. And I have just checked and SIA we return None for the dateobs property, so that's an easy thing to do here, too.

Yes, maybe None is a little better in that it might be a more intuitive thing for a consumer to check on, though they still have to check, so it circles back to me not knowing how this is intended to be used. I'm happy either way for this PR.

@bsipocz
Copy link
Member Author

bsipocz commented Jul 26, 2023

so it circles back to me not knowing how this is intended to be used

honestly, I don't understand why pyvo is so heavy peppered through with these properties, IMO it that makes the API more complex, but it's likely I miss some point somewhere.

@bsipocz bsipocz force-pushed the SIA2_fix_nan_times_properties branch from 82a9c4b to 533390f Compare July 26, 2023 22:24
@msdemlei
Copy link
Contributor

msdemlei commented Jul 27, 2023 via email

@msdemlei
Copy link
Contributor

msdemlei commented Jul 27, 2023 via email

@bsipocz
Copy link
Member Author

bsipocz commented Jul 27, 2023

OK, so everyone seems to be happy with the None case, so I go ahead and merge this. Thanks for the fast review cycle!

@bsipocz bsipocz merged commit b96a950 into astropy:main Jul 27, 2023
9 of 11 checks passed
bsipocz added a commit that referenced this pull request Aug 16, 2023
BUG: fix handling of nan input for Time properties
@bsipocz bsipocz deleted the SIA2_fix_nan_times_properties branch October 20, 2023 18:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CADC SIA2 test failure
4 participants