@@ -76,6 +76,7 @@ Retrieve data:
76
76
... " data_format" : " grib" ,
77
77
... " download_format" : " unarchived"
78
78
... }
79
+
79
80
>> > client.retrieve(collection_id, request, target = " target_1.grib" ) # blocks
80
81
' target_1.grib'
81
82
@@ -91,6 +92,9 @@ Results(...)
91
92
>> > remote.download(" target_3.grib" )
92
93
' target_3.grib'
93
94
95
+ >> > client.download_results(remote.request_id, " target_4.grib" ) # blocks
96
+ ' target_4.grib'
97
+
94
98
```
95
99
96
100
List all collection IDs sorted by last update:
@@ -142,6 +146,23 @@ Remote(...)
142
146
143
147
```
144
148
149
+ Interact with results:
150
+
151
+ ``` python
152
+ >> > results = client.get_results(remote.request_id)
153
+
154
+ >> > results.content_length > 0
155
+ True
156
+ >> > results.content_type
157
+ ' application/x-grib'
158
+ >> > results.location
159
+ ' ...'
160
+
161
+ >> > results.download(" target_5.grib" )
162
+ ' target_5.grib'
163
+
164
+ ```
165
+
145
166
List all successful jobs, sorted by newest first:
146
167
147
168
``` python
162
183
Interact with a previously submitted job:
163
184
164
185
``` python
165
- >> > remote = client.get_remote(request_ids[ 0 ] )
186
+ >> > remote = client.get_remote(remote.request_id )
166
187
167
188
>> > remote.collection_id == collection_id
168
189
True
@@ -183,8 +204,8 @@ datetime.datetime(...)
183
204
>> > remote.updated_at == remote.finished_at
184
205
True
185
206
186
- >> > remote.download(" target_4 .grib" )
187
- ' target_4 .grib'
207
+ >> > remote.download(" target_6 .grib" )
208
+ ' target_6 .grib'
188
209
189
210
>> > remote.get_results()
190
211
Results(... )
@@ -194,42 +215,17 @@ Results(...)
194
215
195
216
```
196
217
197
- Interact with results:
198
-
199
- ``` python
200
- >> > results = client.get_results(request_ids[1 ])
201
-
202
- >> > results.content_length > 0
203
- True
204
- >> > results.content_type
205
- ' application/x-grib'
206
- >> > results.location
207
- ' ...'
208
-
209
- >> > results.download(" target_5.grib" )
210
- ' target_5.grib'
211
-
212
- ```
213
-
214
218
Apply constraints and find the number of available days in a given month:
215
219
216
220
``` python
217
- >> > month = {" year" : " 2000" , " month" : " 02" } # Leap year
221
+ >> > month = {" year" : " 2000" , " month" : " 02" }
218
222
>> > constrained_request = client.apply_constraints(collection_id, month)
219
223
220
224
>> > len (constrained_request[" day" ])
221
225
29
222
226
223
227
```
224
228
225
- Utility methods:
226
-
227
- ``` python
228
- >> > client.download_results(request_ids[1 ], " target_6.grib" )
229
- ' target_6.grib'
230
-
231
- ```
232
-
233
229
## Workflow for developers/contributors
234
230
235
231
For best experience create a new conda environment (e.g. DEVELOP) with Python 3.11:
0 commit comments