Document the new __repr__
See original GitHub issueSorry I missed that one when it was decided upon in https://github.com/pydata/xarray/pull/1017, but I think the changes in repr
should be documented somewhere (at the minimum in the “Breaking Changes” section of what’s new).
I just updated Salem for it to work well with xarray 0.9.0. The changes I had to make where quite small (that’s a good thing), but it took me a bit of time to understand what was going on.
What I found confusing is following:
In [1]: import xarray as xr
In [2]: ds = xr.DataArray([1, 2, 3]).to_dataset(name='var')
In [3]: ds
Out[3]:
<xarray.Dataset>
Dimensions: (dim_0: 3)
Coordinates:
o dim_0 (dim_0) -
Data variables:
var (dim_0) int64 1 2 3
In [4]: 'dim_0' in ds.coords
Out[4]: False
dim_0
is listed as coordinate, but 'dim_0' in ds.coords
is False
. I think it should remain like this, but maybe we should document somewhere what the “o” and “*” mean?
(possibly here)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:23 (23 by maintainers)
Top Results From Across the Web
repr — Python Reference (The Right Way) 0.1 documentation
Returns a string containing a printable representation of an object. Syntax¶. repr (object). object: Required. A valid Python object. Return Value ...
Read more >Built-in Functions — Python 3.11.1 documentation
As repr() , return a string containing a printable representation of an object, but escape the non-ASCII characters in the string returned by...
Read more >G-28, Notice of Entry of Appearance as Attorney or ... - USCIS
G-28, Notice of Entry of Appearance as Attorney or Accredited Representative. Use this form to provide information about your eligibility to act on...
Read more >Filing Representatives - Buildings - NYC.gov
Class 1 Filing Representatives are registered with the Department to present, submit, or furnish applications or construction documents, and remove documents ...
Read more >Form 2848 (Rev. January 2021) - IRS
Internal Revenue Service. Power of Attorney and Declaration of Representative. ▷ Go to www.irs.gov/Form2848 for instructions and the latest information.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I suppose we do something even more explicit, e.g., “Dimensions without a corresponding coordinate”. That feels too long to me, though.
I don’t like “Dimensions without index variable” because it emphasizes that they don’t have an index rather than that they don’t have a variable.
For now I think “Dimensions without coordinates” is my favorite.
I like the currently implemented behavior, which is the second bullet in https://github.com/pydata/xarray/pull/1017#issuecomment-249908900. We could potentially switch to the behavior of the first bullet (issue
TypeError
instead), but I think this would be less convenient.