-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Add a FutureWarning to Dataset.__iter__ and Dataset.__len__ #1658
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
Merged
Merged
Changes from 1 commit
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,14 +78,22 @@ Breaking changes | |
disk when calling ``repr`` (:issue:`1522`). | ||
By `Guido Imperiale <https://github.com/crusaderky>`_. | ||
|
||
- Deprecations: | ||
- Several existing features have been deprecated and will change to new | ||
behavior in xarray v0.11. If you use any of them with xarray v0.10, you | ||
should see a ``FutureWarning`` that describes how to update your code: | ||
|
||
- ``Dataset.T`` has been deprecated an alias for ``Dataset.transpose()`` | ||
(:issue:`1232`). | ||
- ``key in data_array`` currently checks for membership in | ||
``data_array.coords``. This is now deprecated: in the future, it will check | ||
membership in ``data_array.values`` instead. | ||
|
||
(:issue:`1232`). In the next major version of xarray, it will provide short- | ||
cut lookup for variables or attributes with name ``'T'``. | ||
- ``DataArray.__contains__`` (e.g., ``key in data_array``) currently checks | ||
for membership in ``DataArray.coords``. In the next major version of | ||
xarray, it will check membership in the array data found in | ||
``DataArray.values`` instead (:issue:`1267`). | ||
- Directly iteration over and counting a ``Dataset`` (e.g., ``[k for k in ds]``, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Directly->Direct There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||
``ds.keys()``, ``ds.values()``, ``len(ds)`` and ``if ds``) currently | ||
includes all variables, both data and coordinates. For improved usability | ||
and consistency with pandas, in the next major version of xarray these will | ||
change to only include data variables (:issue:`884`). | ||
|
||
Backward Incompatible Changes | ||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
This could use some polishing. The first sentence should probably be split in two. Also, the "please prefer" statement is a bit awkward.
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 tried to keep this as a simple version of the full deprecation warning, and leave the detailed rationale to
whats-new.rst
. Let me know if this is any better...