-
Notifications
You must be signed in to change notification settings - Fork 4
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
TST: Fix lightkurve 2.0.x compat, improve test header #50
Conversation
Codecov Report
@@ Coverage Diff @@
## master #50 +/- ##
==========================================
+ Coverage 79.96% 80.00% +0.03%
==========================================
Files 18 18
Lines 1188 1190 +2
==========================================
+ Hits 950 952 +2
Misses 238 238
Continue to review full report at Codecov.
|
flat = lc.flatten(window_length=81) | ||
flat.flux = flat.flux - 1.0 | ||
flat.flux = flat.flux.value - 1.0 |
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 am not sure if this is completely correct fix, though it does make the test pass again.
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 guess ideally we would like to make sure that flat.flux persists as a quantiity instead of as a float. So I think this line should be
from astropy import units as u
flat.flux = flat.flux.value - 1.0) * u.electron/u.electron
The units will be dimensionless, there may be a better way to assign dimensionless units.
(The units returned by lk.flatten are actually incorrect.)
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.
Does the math of minus 1 e and then divided by 1 e make sense? What if somehow another input has flux in Jy? Then, what?
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.
In the tag up today, Susan and I agreed to leave this as-is for now as not to change the currently behavior.
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 these changes to make it work with lightkurve 2.0 look good. I can't comment on the test header part. I suggested one change to how to do the flatten -1 in that it starts as a quantity, so it should probably end as a quantity, but that quantity should be dimensionless. I doubt it will break anything if we don't make this change.
As I was playing I realize that we still need to update vetters.ModShift to use |
I am 👎 on this. Given that corazon already uses lightkurve 2.0, I don't see a real need for such compatibility layer. It is only going to increase maintenance burden. Why do you still need lightkurve 1.0? |
This compatibility layer already exists. I wrote it so I could work with corazon and lightkurve at the same time. It seems to me the easiest path forward is to just make ModShift use the same layer and we can phase it out once we are sure everything is working correctly with lightkurve 2.0. I have no plans to long term support it, but since we already do, it is more work to take it out. |
I don't have time to work on this today or the next few days, so feel free to fix modshift if you want. Thanks! |
As per tag up today, I will wait till Susan applied her modshift changes before wrapping this up, to avoid conflict. |
I think this is ready to go. Merge when you are ready. I'd officially approve it, but I can't find the github button. |
Thanks! I merged it. I'll open a separate issue for the dev job as it is pending reply from Geert. |
Looks like
lightkurve
finally changed their API.Also add additional dependencies to test header.
TODO
How to handle UserWarning: dropping mask in Quantity column 'flux': masked Quantity not supported lightkurve/lightkurve#988 (dev job)?See TST: Handle UserWarning in dev job #52