This repository was archived by the owner on Oct 24, 2024. It is now read-only.
Commit 9a6f674
Replace .ds with immutable DatasetView (#99)
* sketching out changes needed to integrate variables into DataTree
* fixed some other basic conflicts
* fix mypy errors
* can create basic datatree node objects again
* child-variable name collisions dectected correctly
* in-progres
* add _replace method
* updated tests to assert identical instead of check .ds is expected_ds
* refactor .ds setter to use _replace
* refactor init to use _replace
* refactor test tree to avoid init
* attempt at copy methods
* rewrote implementation of .copy method
* xfailing test for deepcopying
* pseudocode implementation of DatasetView
* Revert "pseudocode implementation of DatasetView"
This reverts commit 52ef23b.
* pseudocode implementation of DatasetView
* removed duplicated implementation of copy
* reorganise API docs
* expose data_vars, coords etc. properties
* try except with calculate_dimensions private import
* add keys/values/items methods
* don't use has_data when .variables would do
* change asserts to not fail just because of differing types
* full sketch of how DatasetView could work
* added tests for DatasetView
* remove commented pseudocode
* explanation of basic properties
* add data structures page to index
* revert adding documentation in favour of that going in a different PR
* correct deepcopy tests
* use .data_vars in copy tests
* add test for arithmetic with .ds
* remove reference to wrapping node in DatasetView
* clarify type through renaming variables
* remove test for out-of-node access
* make imports depend on most recent version of xarray
Co-authored-by: Mattia Almansi <[email protected]>
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* remove try except for internal import
* depend on latest pre-release of xarray
* correct name of version
* xarray pre-release under pip in ci envs
* correct methods
* whatsnews
* fix fixture in test
* whatsnew
* improve docstrings
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Co-authored-by: Mattia Almansi <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>1 parent c2b6400 commit 9a6f674
File tree
4 files changed
+204
-34
lines changed- datatree
- tests
- docs/source
4 files changed
+204
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
89 | 219 | | |
90 | 220 | | |
91 | 221 | | |
| |||
217 | 347 | | |
218 | 348 | | |
219 | 349 | | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
224 | 357 | | |
225 | 358 | | |
226 | 359 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
| 195 | + | |
196 | 196 | | |
197 | 197 | | |
198 | 198 | | |
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
207 | | - | |
| 207 | + | |
208 | 208 | | |
209 | 209 | | |
210 | 210 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
69 | | - | |
| 69 | + | |
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
| 103 | + | |
103 | 104 | | |
104 | | - | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
109 | | - | |
110 | | - | |
111 | | - | |
112 | | - | |
| 105 | + | |
113 | 106 | | |
114 | 107 | | |
115 | 108 | | |
| |||
275 | 268 | | |
276 | 269 | | |
277 | 270 | | |
278 | | - | |
| 271 | + | |
279 | 272 | | |
280 | 273 | | |
281 | 274 | | |
282 | 275 | | |
283 | 276 | | |
284 | | - | |
| 277 | + | |
285 | 278 | | |
286 | 279 | | |
287 | 280 | | |
| |||
292 | 285 | | |
293 | 286 | | |
294 | 287 | | |
295 | | - | |
| 288 | + | |
296 | 289 | | |
297 | 290 | | |
298 | 291 | | |
299 | 292 | | |
300 | 293 | | |
301 | 294 | | |
302 | | - | |
| 295 | + | |
303 | 296 | | |
304 | 297 | | |
305 | 298 | | |
306 | 299 | | |
307 | 300 | | |
308 | 301 | | |
309 | | - | |
| 302 | + | |
310 | 303 | | |
311 | 304 | | |
312 | 305 | | |
| |||
341 | 334 | | |
342 | 335 | | |
343 | 336 | | |
344 | | - | |
| 337 | + | |
345 | 338 | | |
346 | 339 | | |
347 | 340 | | |
| |||
355 | 348 | | |
356 | 349 | | |
357 | 350 | | |
358 | | - | |
| 351 | + | |
359 | 352 | | |
360 | 353 | | |
361 | 354 | | |
362 | 355 | | |
363 | | - | |
| 356 | + | |
364 | 357 | | |
365 | | - | |
| 358 | + | |
366 | 359 | | |
367 | | - | |
| 360 | + | |
368 | 361 | | |
369 | 362 | | |
370 | 363 | | |
| |||
373 | 366 | | |
374 | 367 | | |
375 | 368 | | |
376 | | - | |
| 369 | + | |
377 | 370 | | |
378 | 371 | | |
379 | 372 | | |
380 | 373 | | |
381 | 374 | | |
382 | | - | |
| 375 | + | |
383 | 376 | | |
384 | 377 | | |
385 | 378 | | |
| |||
409 | 402 | | |
410 | 403 | | |
411 | 404 | | |
412 | | - | |
413 | | - | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
414 | 443 | | |
415 | 444 | | |
416 | 445 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
32 | 36 | | |
33 | 37 | | |
34 | 38 | | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
38 | 46 | | |
39 | 47 | | |
40 | 48 | | |
| |||
0 commit comments