Commit 781877c
* add a DataTreeCoordinates class
* passing read-only properties tests
* tests for modifying in-place
* WIP making the modification test pass
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* get to the delete tests
* test
* improve error message
* implement delitem
* test KeyError
* subclass Coordinates instead of DatasetCoordinates
* use Frozen(self._data._coord_variables)
* Simplify when to raise KeyError
Co-authored-by: Stephan Hoyer <[email protected]>
* correct bug in suggestion
* Update xarray/core/coordinates.py
Co-authored-by: Stephan Hoyer <[email protected]>
* simplify _update_coords by creating new node data first
* update indexes correctly
* passes test
* update ._drop_indexed_coords
* some mypy fixes
* remove the apparently-unused _drop_indexed_coords method
* fix import error
* test that Dataset and DataArray constructors can handle being passed a DataTreeCoordinates object
* test dt.coords can be passed to DataTree constructor
* improve readability of inline comment
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* initial tests with inherited coords
* ignore typeerror indicating dodgy inheritance
* try to avoid Unbound type error
* cast return value correctly
* cehck that .coords works with inherited coords
* fix data->dataset
* fix return type of __getitem__
* Use .dataset instead of .to_dataset()
Co-authored-by: Stephan Hoyer <[email protected]>
* _check_alignment -> check_alignment
* remove dict comprehension
Co-authored-by: Stephan Hoyer <[email protected]>
* KeyError message formatting
Co-authored-by: Stephan Hoyer <[email protected]>
* keep generic types for .dims and .sizes
* test verifying you cant delete inherited coord
* fix mypy complaint
* type hint as accepting objects
* update note about .dims returning all dims
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Stephan Hoyer <[email protected]>
1 parent fac2c89 commit 781877c
File tree
3 files changed
+293
-30
lines changed- xarray
- core
- tests
3 files changed
+293
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
39 | 40 | | |
40 | 41 | | |
41 | 42 | | |
| |||
197 | 198 | | |
198 | 199 | | |
199 | 200 | | |
200 | | - | |
201 | | - | |
| 201 | + | |
| 202 | + | |
202 | 203 | | |
203 | | - | |
| 204 | + | |
204 | 205 | | |
205 | | - | |
| 206 | + | |
206 | 207 | | |
207 | 208 | | |
208 | 209 | | |
| |||
704 | 705 | | |
705 | 706 | | |
706 | 707 | | |
| 708 | + | |
707 | 709 | | |
708 | 710 | | |
709 | 711 | | |
| |||
771 | 773 | | |
772 | 774 | | |
773 | 775 | | |
774 | | - | |
775 | | - | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | | - | |
780 | | - | |
781 | | - | |
782 | 776 | | |
783 | 777 | | |
784 | 778 | | |
| |||
796 | 790 | | |
797 | 791 | | |
798 | 792 | | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
| 798 | + | |
| 799 | + | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
| 803 | + | |
| 804 | + | |
| 805 | + | |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
| 843 | + | |
| 844 | + | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
799 | 892 | | |
800 | 893 | | |
801 | 894 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
97 | 99 | | |
98 | 100 | | |
99 | 101 | | |
| |||
125 | 127 | | |
126 | 128 | | |
127 | 129 | | |
128 | | - | |
| 130 | + | |
129 | 131 | | |
130 | 132 | | |
131 | 133 | | |
| |||
151 | 153 | | |
152 | 154 | | |
153 | 155 | | |
154 | | - | |
| 156 | + | |
155 | 157 | | |
156 | 158 | | |
157 | 159 | | |
| |||
417 | 419 | | |
418 | 420 | | |
419 | 421 | | |
420 | | - | |
| 422 | + | |
421 | 423 | | |
422 | 424 | | |
423 | 425 | | |
| |||
473 | 475 | | |
474 | 476 | | |
475 | 477 | | |
476 | | - | |
| 478 | + | |
477 | 479 | | |
478 | 480 | | |
479 | 481 | | |
| |||
498 | 500 | | |
499 | 501 | | |
500 | 502 | | |
501 | | - | |
502 | | - | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
503 | 507 | | |
504 | 508 | | |
505 | 509 | | |
| |||
514 | 518 | | |
515 | 519 | | |
516 | 520 | | |
517 | | - | |
518 | | - | |
519 | | - | |
520 | | - | |
521 | | - | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
522 | 528 | | |
523 | 529 | | |
524 | 530 | | |
| |||
762 | 768 | | |
763 | 769 | | |
764 | 770 | | |
765 | | - | |
| 771 | + | |
766 | 772 | | |
767 | 773 | | |
768 | 774 | | |
| |||
1187 | 1193 | | |
1188 | 1194 | | |
1189 | 1195 | | |
1190 | | - | |
| 1196 | + | |
1191 | 1197 | | |
1192 | 1198 | | |
1193 | 1199 | | |
1194 | | - | |
| 1200 | + | |
1195 | 1201 | | |
1196 | 1202 | | |
1197 | 1203 | | |
| |||
0 commit comments