question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Document the new __repr__

See original GitHub issue

Sorry 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_0is 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:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:23 (23 by maintainers)

github_iconTop GitHub Comments

1reaction
shoyercommented, Jan 27, 2017

Any use case for dimensions which don’t have an index (i.e., an IndexVariable) but have coordinates? This would be confusing too:

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.

1reaction
shoyercommented, Jan 17, 2017

Sorry, I’m not sure to understand: do you mean you’d rather stay with the current behavior as you said in #1017 (comment) ?

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found