-
Notifications
You must be signed in to change notification settings - Fork 81
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
Cleanup plugin apis #3453
Cleanup plugin apis #3453
Conversation
* if we have need for any kwargs passed through load_regions, we can explicitly include/document those as well
* user API is now hardcoded to update=True, which was not the previous default (BEHAVIOR CHANGE)
* deprecation warning already exists for the old helper methods, and plugin APIs have not been released yet, so no need to add deprecations here
@@ -830,6 +830,26 @@ def set_center(self, new_cen, subset_name=None, update=False): | |||
self.subset_definitions = [] | |||
self.subset_definitions = tmp | |||
|
|||
def set_center(self, new_cen, subset_name=None): |
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.
Hmm I thought we agreed to just remove it from the public API exposure?
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.
that's effectively what this does, but we want it to always be True now, whereas the internal method defaults to False
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 was thinking more along the line of a one-line change here:
'get_center', 'set_center', |
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.
oh that removes set_center
entirely, we don't want to do that, we just don't want to expose the update
keyword argument
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.
did we decide that we didn't want it exposed at all anymore? Maybe I just misunderstood/misremembered
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 thought we said it shouldn't be public API in the first place, right, @javerbukh ?
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.
Yes it shouldn't be public since it doesn't really make sense as API. The Recenter button provides a new center (as an estimate) which is what the subset is then centered on. Using that method with API would require the user to come up with the center themselves and at that point they should just use the update subset public API (which does not exist yet).
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.
ok, then I can revert that here and maybe we should wait until the alternative (upcoming) edit subset API is in place and then deprecate this method then?
This reverts commit 02b73db.
fb4285c
to
8f78d52
Compare
Codecov ReportAttention: Patch coverage is
❌ Your patch status has failed because the patch coverage (60.00%) is below the target coverage (90.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #3453 +/- ##
==========================================
- Coverage 87.59% 87.58% -0.01%
==========================================
Files 128 128
Lines 20047 20042 -5
==========================================
- Hits 17560 17554 -6
- Misses 2487 2488 +1 ☔ View full report in Codecov by Sentry. |
@@ -987,6 +987,35 @@ def get_model_parameters(self, models=None, model_label=None, x=None, y=None): | |||
|
|||
return parameters_cube | |||
|
|||
def get_model_parameters(self, model_label=None, x=None, y=None): |
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 this not need a change log?
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 think so (see explanation in description), but can add it if you think there should
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.
LGTM. 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, thanks!
Description
This pull request cleans up exposed plugin APIs which are meant for internal use only, including:
**kwargs
fromsubset_tools.import_region(..., **kwargs)
with explicitregion_format=None
. If there are other kwargs passed toload_regions
that we want the user to access, we should explicitly add and document those as well.remove. (see discussion at Cleanup plugin apis #3453 (comment))update=False
insubset_tools.set_center(..., update=False)
and hardcode toupdate=True
. IMPORTANT: this is technically a change in behavior. Do we need to deprecate or is a changelog entry in a minor release sufficient?set_center
was first made public in 4.1 by Rename Subsets Plugin #3304.models=None
frommodel_fitting.get_model_parameters(models=None, ...)
. The helper-method is already deprecated and the plugin-method has not been released yet, so the existing deprecation should be sufficient.models=None
frommodel_fitting.get_models(models=None, ...)
. The helper-method is already deprecated and the plugin-method has not been released yet, so the existing deprecation should be sufficient.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.