-
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
BUG: Allow data_label as pos arg #1644
Conversation
Codecov ReportBase: 86.35% // Head: 86.36% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## main #1644 +/- ##
=======================================
Coverage 86.35% 86.36%
=======================================
Files 95 95
Lines 9627 9634 +7
=======================================
+ Hits 8313 8320 +7
Misses 1314 1314
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. |
I'm worried this is a slippery slope... although in this case it might be worth the convenience. Is switching the order of the positional arguments too big of an API break? If we do stick with this, should we at least raise a warning? |
Hmm. Maybe @rosteen can chime in here since he encountered this use case. |
Personally I think we should just switch the order of the keyword arguments so |
Currently |
Right, I vote for pulling it out of |
Re: #1644 (comment) This is made complicated that mosviz parser accepts |
I think that the Mosviz helper methods can be left as-is and not be affected by this. For example, |
But what if you pass in |
Well, I think I'd argue that that's already possible and fixing it is out of scope for this PR 😆 . Plus, if Could always catch |
I'll have to think about this. If we make it explicit, it will also break existing API passing in |
for Imviz, Cubeviz, and Specviz load_data methods for their helpers.
21993e3
to
33473e0
Compare
Okay... I completely changed the implementation. Please re-review. Thanks! |
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 to me now, thanks!
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'd personally like to also see the orders in mosviz and specviz2d changed to parallel this more closely, but realize that would definitely be considered an API-breaking change and require a lot more thought... so let's leave those out for now.
Specviz already supports data_label
as the second positional argument in its load_spectrum
. We may also want to consider renaming that (with deprecation) to load_data
to be more consistent, but that can also be handled later.
Was parser_reference
ever passed anywhere in docs/examples notebooks that would justify the need for deprecation or a version bump here? Otherwise, I don't see any issues with this as-is in a minor release. Definitely will avoid some possible confusion when a user first start using jdaviz!
No, I think adding Deprecating |
I agree, we'd definitely need a long (perhaps infinitely long) deprecation period. At least having the alias for |
Description
This pull request is to allow common user mistake passing in data_label as positional argument. This approach is kinda hacky but is less disruptive than throwing error if data_label is not a keyword argument.
Fixes #1617
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.CHANGES.rst
?