File tree 5 files changed +21
-19
lines changed
5 files changed +21
-19
lines changed Original file line number Diff line number Diff line change @@ -69,8 +69,8 @@ in with default values:
69
69
70
70
As you can see, dimension names are always present in the xarray data model: if
71
71
you do not provide them, defaults of the form ``dim_N `` will be created.
72
- However, coordinates are optional. If you do not specific coordinates for a
73
- dimension, the axis name will appear under the list of "Unindexed dimensions" .
72
+ However, coordinates are always optional, and dimensions do not have automatic
73
+ coordinate labels .
74
74
75
75
.. note ::
76
76
Original file line number Diff line number Diff line change @@ -13,6 +13,16 @@ What's New
13
13
import xarray as xr
14
14
np.random.seed(123456 )
15
15
16
+
17
+ .. _whats-new.0.9.1 :
18
+
19
+ v0.9.1 (30 January 2017)
20
+ ------------------------
21
+
22
+ Renamed the "Unindexed dimensions" section in the ``Dataset `` and
23
+ ``DataArray `` repr (added in v0.9.0) to "Dimensions without coordinates"
24
+ (:issue: `1199 `).
25
+
16
26
.. _whats-new.0.9.0 :
17
27
18
28
v0.9.0 (25 January 2017)
@@ -48,9 +58,9 @@ Breaking changes
48
58
~~~~~~~~~~~~~~~~
49
59
50
60
- Index coordinates for each dimensions are now optional, and no longer created
51
- by default :issue: `1017 `. You can identify such dimensions without indexes by
52
- their appearance in list of "Unindexed dimensions " in the `` Dataset `` or
53
- ``DataArray `` repr:
61
+ by default :issue: `1017 `. You can identify such dimensions without coordinates
62
+ by their appearance in list of "Dimensions without coordinates " in the
63
+ ``Dataset `` or `` DataArray `` repr:
54
64
55
65
.. ipython ::
56
66
:verbatim:
@@ -59,10 +69,7 @@ Breaking changes
59
69
Out[1]:
60
70
<xarray.Dataset>
61
71
Dimensions: (x: 1, y: 2)
62
- Coordinates:
63
- *empty *
64
- Unindexed dimensions:
65
- x, y
72
+ Dimensions without coordinates: x, y
66
73
Data variables:
67
74
foo (x, y) int64 1 2
68
75
Original file line number Diff line number Diff line change @@ -327,7 +327,7 @@ def unindexed_dims_repr(dims, coords):
327
327
unindexed_dims = [d for d in dims if d not in coords ]
328
328
if unindexed_dims :
329
329
dims_str = u', ' .join (u'%s' % d for d in unindexed_dims )
330
- return u'Unindexed dimensions: \n ' + u' ' * 4 + dims_str
330
+ return u'Dimensions without coordinates: ' + dims_str
331
331
else :
332
332
return None
333
333
@@ -399,7 +399,8 @@ def dataset_repr(ds):
399
399
dims_start = pretty_print (u'Dimensions:' , col_width )
400
400
summary .append (u'%s(%s)' % (dims_start , dim_summary (ds )))
401
401
402
- summary .append (coords_repr (ds .coords , col_width = col_width ))
402
+ if ds .coords :
403
+ summary .append (coords_repr (ds .coords , col_width = col_width ))
403
404
404
405
unindexed_dims_str = unindexed_dims_repr (ds .dims , ds .coords )
405
406
if unindexed_dims_str :
Original file line number Diff line number Diff line change @@ -47,8 +47,7 @@ def test_repr(self):
47
47
Coordinates:
48
48
* x (x) int64 0 1 2
49
49
other int64 0
50
- Unindexed dimensions:
51
- time
50
+ Dimensions without coordinates: time
52
51
Attributes:
53
52
foo: bar""" )
54
53
self .assertEqual (expected , repr (data_array ))
Original file line number Diff line number Diff line change @@ -91,8 +91,7 @@ def test_repr(self):
91
91
* dim2 (dim2) float64 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0
92
92
* dim3 (dim3) %s 'a' 'b' 'c' 'd' 'e' 'f' 'g' 'h' 'i' 'j'
93
93
numbers (dim3) int64 0 1 2 0 0 1 1 2 2 3
94
- Unindexed dimensions:
95
- dim1
94
+ Dimensions without coordinates: dim1
96
95
Data variables:
97
96
var1 (dim1, dim2) float64 -1.086 0.9973 0.283 -1.506 -0.5786 1.651 ...
98
97
var2 (dim1, dim2) float64 1.162 -1.097 -2.123 1.04 -0.4034 -0.126 ...
@@ -110,8 +109,6 @@ def test_repr(self):
110
109
expected = dedent ("""\
111
110
<xarray.Dataset>
112
111
Dimensions: ()
113
- Coordinates:
114
- *empty*
115
112
Data variables:
116
113
*empty*""" )
117
114
actual = '\n ' .join (x .rstrip () for x in repr (Dataset ()).split ('\n ' ))
@@ -123,8 +120,6 @@ def test_repr(self):
123
120
expected = dedent ("""\
124
121
<xarray.Dataset>
125
122
Dimensions: ()
126
- Coordinates:
127
- *empty*
128
123
Data variables:
129
124
foo float64 1.0""" )
130
125
actual = '\n ' .join (x .rstrip () for x in repr (data ).split ('\n ' ))
You can’t perform that action at this time.
0 commit comments