Skip to content
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

Raise on inplace=True #3260

Merged
merged 9 commits into from
Aug 26, 2019
Merged

Raise on inplace=True #3260

merged 9 commits into from
Aug 26, 2019

Conversation

max-sixty
Copy link
Collaborator

@max-sixty max-sixty commented Aug 24, 2019

Do we want to raise an explicit error for another minor release (rather than remove all traces of inplace)? I'd vote +0.5 - it's likely that some people don't check deprecation warnings and this states the problem clearly

What do we want to do re .update (#2951)?

@max-sixty max-sixty mentioned this pull request Aug 24, 2019
2 tasks
Copy link
Member

@shoyer shoyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would also be nice to also update these methods to avoid using the inplace argument internally (e.g., to replace it with a literal Boolean if necessary).

"removed in a future version of xarray.",
FutureWarning,
stacklevel=3,
raise ValueError(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably be TypeError, which is what Python uses for unrecognized arguments.

@max-sixty
Copy link
Collaborator Author

Great - what are your thoughts on .inplace @shoyer ?

@max-sixty
Copy link
Collaborator Author

All done, unless anyone has thoughts re inplace

@shoyer
Copy link
Member

shoyer commented Aug 26, 2019

Could we make _check_inplace() entirely non-assigning? e.g., inplace = _check_inplace(inplace) -> _check_inplace(inplace)?

@max-sixty
Copy link
Collaborator Author

Could we make _check_inplace() entirely non-assigning? e.g., inplace = _check_inplace(inplace) -> _check_inplace(inplace)?

Yes, good idea.

Currently ds.update(inplace=[True|False]) will raise, by default it'll be True, is that OK?

@shoyer
Copy link
Member

shoyer commented Aug 26, 2019

Yes, ds.update() should always be inplace.

Copy link
Member

@shoyer shoyer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks @max-sixty !

@shoyer shoyer merged commit e3b3bed into pydata:master Aug 26, 2019
@max-sixty max-sixty deleted the inplace branch August 26, 2019 18:44
dcherian added a commit to dcherian/xarray that referenced this pull request Aug 26, 2019
* upstream/master:
  Initialize empty or full DataArray (pydata#3159)
  Raise on inplace=True (pydata#3260)
  added support for rasterio geotiff tags (pydata#3249)
  Remove sel_points (pydata#3261)
  Fix sparse ops that were calling bottleneck (pydata#3254)
  New feature of filter_by_attrs added (pydata#3259)
  Update filter_by_attrs to use 'variables' instead of 'data_vars' (pydata#3247)
@mathause mathause mentioned this pull request Nov 4, 2020
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants