@@ -131,9 +131,9 @@ def _infer_direction(self):
131131 """Return True if a coordinate is increasing, otherwise return
132132 False.
133133
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.
137137
138138 If the direction can not be inferred from the data not bounds then
139139 the coordinate's units are used.
@@ -168,12 +168,12 @@ def _infer_direction(self):
168168 c = data ._get_cached_elements ()
169169 if c :
170170 try :
171- return bool (c .get (0 ) < c .get (1 ))
171+ return bool (c .get (0 ) <= c .get (1 ))
172172 except TypeError :
173173 pass
174174
175175 data = data [:2 ].compute ()
176- return bool (data .item (0 ) < data .item (1 ))
176+ return bool (data .item (0 ) <= data .item (1 ))
177177
178178 # Still here?
179179 data = self .get_bounds_data (None , _fill_value = False )
@@ -182,12 +182,12 @@ def _infer_direction(self):
182182 c = data ._get_cached_elements ()
183183 if c :
184184 try :
185- return bool (c .get (0 ) < c .get (1 ))
185+ return bool (c .get (0 ) <= c .get (1 ))
186186 except TypeError :
187187 pass
188188
189189 b = data [0 ].compute ()
190- return bool (b .item (0 ) < b .item (1 ))
190+ return bool (b .item (0 ) <= b .item (1 ))
191191
192192 # Still here? Then infer the direction from the units.
193193 return not self .Units .ispressure
0 commit comments