Commit e80d3cb
Adapt to deprecation of generic
This PR modifies the few places we relied on a generic `np.timedelta64` dtype to explicitly specify the time resolution:
- It removes `NAT_TYPES` and relies instead on checking the `dtype.kind` in `computation.nanops._maybe_null_out`.
- It infers the time `unit` using `np.datetime_data` from the input `dtype` to determine the `unit` on the returned `fill_value` in `core.dtypes.maybe_promote`.
- It explicitly constructs a zero-valued `np.timedelta64` or `np.datetime64` object for use downstream in `plot.utils._determine_cmap_params`.np.timedelta64 dtype (pydata#11281)1 parent cdf4443 commit e80d3cb
File tree
4 files changed
+29
-18
lines changed- xarray
- computation
- core
- plot
- tests
4 files changed
+29
-18
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
33 | 35 | | |
34 | 36 | | |
35 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
88 | 89 | | |
89 | 90 | | |
90 | 91 | | |
91 | | - | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
92 | 97 | | |
93 | 98 | | |
94 | 99 | | |
| |||
97 | 102 | | |
98 | 103 | | |
99 | 104 | | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
100 | 109 | | |
101 | | - | |
| 110 | + | |
102 | 111 | | |
103 | 112 | | |
104 | 113 | | |
| |||
108 | 117 | | |
109 | 118 | | |
110 | 119 | | |
111 | | - | |
112 | | - | |
113 | | - | |
114 | 120 | | |
115 | 121 | | |
116 | 122 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
192 | 201 | | |
193 | 202 | | |
194 | 203 | | |
| |||
197 | 206 | | |
198 | 207 | | |
199 | 208 | | |
200 | | - | |
| 209 | + | |
201 | 210 | | |
202 | 211 | | |
203 | 212 | | |
204 | 213 | | |
205 | 214 | | |
206 | 215 | | |
207 | 216 | | |
208 | | - | |
| 217 | + | |
209 | 218 | | |
210 | 219 | | |
211 | 220 | | |
| |||
240 | 249 | | |
241 | 250 | | |
242 | 251 | | |
243 | | - | |
| 252 | + | |
244 | 253 | | |
245 | 254 | | |
246 | | - | |
| 255 | + | |
247 | 256 | | |
248 | 257 | | |
249 | 258 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
106 | | - | |
| 105 | + | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
126 | | - | |
127 | | - | |
128 | | - | |
129 | | - | |
130 | | - | |
131 | | - | |
132 | 126 | | |
133 | 127 | | |
134 | 128 | | |
| |||
0 commit comments