-
Notifications
You must be signed in to change notification settings - Fork 79
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Subset refactor part 1: new get_data API #1984
Subset refactor part 1: new get_data API #1984
Conversation
Codecov ReportBase: 92.04% // Head: 92.06% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1984 +/- ##
==========================================
+ Coverage 92.04% 92.06% +0.02%
==========================================
Files 140 140
Lines 15206 15285 +79
==========================================
+ Hits 13996 14072 +76
- Misses 1210 1213 +3
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 am liking the simplicity of the API and the lack of a returned dictionary more and more. I haven't actually tried this out yet, but how is it expected to work for the flux cube in cubeviz (how do you tell the API whether to access the cube or collapsed spectrum with the same label)?
jdaviz/core/helpers.py
Outdated
statistic : {'minimum', 'maximum', 'mean', 'median', 'sum', 'percentile'}, optional | ||
The statistic to use to collapse the dataset |
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 don't love this being in the method for all helpers since its only applicable to cubeviz... but also see how it would be tricky to overload this for the cubeviz helper. Another option might be to_object_kwargs={}
and then overload in cubeviz to have an explicit statistic
kwarg.
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 use the statistic
parameter in a few places in the code so I am hesitant to take it out and only use it for cubeviz.
Correct me if I'm wrong @javerbukh, but it looks like you do this by providing the Jesse, I just started testing this, and it looks like the |
@rosteen That is correct. Ok thank you for letting me know! I will check that out. |
Ok, that makes sense. Will that provide any headaches when migrating internal calls (we'll need to pull the statistic from the spectrum viewer's plot options or state and pass it through the |
@kecnry I think what you said is correct, if we want to get the collapse spectrum in cubeviz we will need to call |
I think its a bit uglier actually: |
Talking to @rosteen we realized that the issue was he was using @kecnry I'm in favor of writing a |
@rosteen Should be fixed now. |
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.
Working in all the cases I've tested now. I still wish you could specify multiple subsets (e.g., a spatial and a spectral in Cubeviz) but we can leave that for potential future enhancements. Approved.
Should providing |
@kecnry can you provide a test case? The only situation where a non-cube will have |
I can't remember if I reviewed before that was added or just missed it - but that looks sufficient for the typo concern - thanks! |
@kecnry Ok, let me know if the latest change satisfies the criteria. |
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.
let me know if the latest change satisfies the criteria.
Looks good to me - thanks!
Just needs a change log (and CI green) before merging.
f664a90
to
42faf39
Compare
Imviz still works. Belated 👍 from me. Thanks! |
Description
This pull request is to address one part of #1921, namely it introduces a new API that changes how data retrieval works.
I will remove the concept notebook when we (probably I again) have transferred the thoughts and notes from there to somewhere more permanent.EDIT: Original issue has been updated.
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.