Commit a917dad
Allow passing region to GMTBackendEntrypoint.open_dataset (#3932)
Support passing in a region as a Sequence [xmin, xmax, ymin, ymax] or
ISO country code to `xarray.open_dataset` when using `engine="gmt"`.
* Refactor _load_remote_dataset internals to use xr.load_dataarray
Remove duplicated code calling GMT read, since
`xr.load_dataarray(engine="gmt")` now works with region argument.
* Update TypeError regex for test_xarray_backend_gmt_read_invalid_kind
* Don't need to re-load GMTDataArray accessor info in GMTBackendEntrypoint
GMTDataArrayAccessor info should already be loaded by calling
`virtualfile_to_raster` which calls
`self.read_virtualfile(vfname, kind=kind).contents.to_xarray()`
that sets registration and gtype from the header.
* Add doctest for load_dataarray with region argument
* Remove @kwargs_to_strings from _load_remote_dataset
* Sort list of source files alphabetically
---------
Co-authored-by: Dongdong Tian <[email protected]>1 parent 12f9776 commit a917dad
File tree
3 files changed
+82
-34
lines changed- pygmt
- datasets
- tests
- xarray
3 files changed
+82
-34
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
11 | 10 | | |
12 | | - | |
13 | | - | |
14 | 11 | | |
15 | 12 | | |
16 | 13 | | |
| |||
502 | 499 | | |
503 | 500 | | |
504 | 501 | | |
505 | | - | |
506 | 502 | | |
507 | 503 | | |
508 | 504 | | |
| |||
581 | 577 | | |
582 | 578 | | |
583 | 579 | | |
584 | | - | |
585 | | - | |
586 | | - | |
587 | | - | |
588 | | - | |
589 | | - | |
590 | | - | |
591 | | - | |
592 | | - | |
593 | | - | |
594 | | - | |
595 | | - | |
596 | | - | |
597 | | - | |
598 | | - | |
599 | | - | |
600 | | - | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
601 | 583 | | |
602 | 584 | | |
603 | 585 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | | - | |
| 43 | + | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
55 | 74 | | |
56 | 75 | | |
57 | | - | |
58 | | - | |
| 76 | + | |
| 77 | + | |
59 | 78 | | |
60 | 79 | | |
61 | 80 | | |
| |||
64 | 83 | | |
65 | 84 | | |
66 | 85 | | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
67 | 102 | | |
68 | 103 | | |
69 | 104 | | |
| |||
88 | 123 | | |
89 | 124 | | |
90 | 125 | | |
91 | | - | |
92 | | - | |
93 | | - | |
| 126 | + | |
94 | 127 | | |
95 | 128 | | |
96 | 129 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
11 | | - | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
33 | 37 | | |
34 | 38 | | |
35 | 39 | | |
| |||
68 | 72 | | |
69 | 73 | | |
70 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
71 | 100 | | |
72 | 101 | | |
73 | 102 | | |
74 | | - | |
| 103 | + | |
75 | 104 | | |
76 | 105 | | |
| 106 | + | |
77 | 107 | | |
78 | 108 | | |
79 | 109 | | |
80 | 110 | | |
81 | 111 | | |
82 | 112 | | |
| 113 | + | |
83 | 114 | | |
84 | 115 | | |
85 | 116 | | |
| |||
94 | 125 | | |
95 | 126 | | |
96 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
97 | 131 | | |
98 | 132 | | |
99 | 133 | | |
100 | 134 | | |
101 | 135 | | |
102 | 136 | | |
103 | 137 | | |
104 | | - | |
| 138 | + | |
105 | 139 | | |
106 | 140 | | |
107 | 141 | | |
| |||
111 | 145 | | |
112 | 146 | | |
113 | 147 | | |
114 | | - | |
| 148 | + | |
115 | 149 | | |
116 | | - | |
| 150 | + | |
117 | 151 | | |
118 | | - | |
119 | 152 | | |
0 commit comments