@@ -131,9 +131,9 @@ def _infer_direction(self):
131
131
"""Return True if a coordinate is increasing, otherwise return
132
132
False.
133
133
134
- A dimension coordinate construct is considered to be increasing if
135
- its data array values are increasing in index space, or if it has
136
- no data nor bounds.
134
+ A dimension coordinate construct is considered to be
135
+ increasing if its data array values are not strictly
136
+ decreasing in index space, or if it has no data nor bounds.
137
137
138
138
If the direction can not be inferred from the data not bounds then
139
139
the coordinate's units are used.
@@ -168,12 +168,12 @@ def _infer_direction(self):
168
168
c = data ._get_cached_elements ()
169
169
if c :
170
170
try :
171
- return bool (c .get (0 ) < c .get (1 ))
171
+ return bool (c .get (0 ) <= c .get (1 ))
172
172
except TypeError :
173
173
pass
174
174
175
175
data = data [:2 ].compute ()
176
- return bool (data .item (0 ) < data .item (1 ))
176
+ return bool (data .item (0 ) <= data .item (1 ))
177
177
178
178
# Still here?
179
179
data = self .get_bounds_data (None , _fill_value = False )
@@ -182,12 +182,12 @@ def _infer_direction(self):
182
182
c = data ._get_cached_elements ()
183
183
if c :
184
184
try :
185
- return bool (c .get (0 ) < c .get (1 ))
185
+ return bool (c .get (0 ) <= c .get (1 ))
186
186
except TypeError :
187
187
pass
188
188
189
189
b = data [0 ].compute ()
190
- return bool (b .item (0 ) < b .item (1 ))
190
+ return bool (b .item (0 ) <= b .item (1 ))
191
191
192
192
# Still here? Then infer the direction from the units.
193
193
return not self .Units .ispressure
0 commit comments