-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Deprecate inplace #2524
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
Deprecate inplace #2524
Changes from 4 commits
10fc573
edf1a0a
3a5cf5d
b1ed4df
484d71f
63d4175
66d3cea
4359403
62faebc
7a0d37b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,14 @@ | |
| OrderedDict, basestring, bytes_type, dask_array_type, iteritems) | ||
|
|
||
|
|
||
| def _check_inplace(inplace): | ||
| if inplace is None: | ||
| inplace = False | ||
| else: | ||
| warnings.warn('The inplace argument has been deprecated and will be ' | ||
| 'removed in xarray 0.12.0.', FutureWarning) | ||
|
||
|
|
||
|
|
||
| def alias_message(old_name, new_name): | ||
| return '%s has been deprecated. Use %s instead.' % (old_name, new_name) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -23,6 +23,7 @@ | |
| requires_scipy, source_ndarray) | ||
|
|
||
|
|
||
| @pytest.mark.filterwarnings('ignore:The inplace argument') | ||
|
||
| class TestDataArray(object): | ||
| @pytest.fixture(autouse=True) | ||
| def setup(self): | ||
|
|
||
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.
@shoyer What's the right thing to do here? Changing the default to None/False breaks a lot of test.
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.
Dataset.update()has always been an in-place operation for consistency withdict.update(). I don't think it really makes sense to change that.I would suggest that we do the deprecation the other direction here: remove the
inplaceargument but keep the behavior as always inplace.