terrakio-core 0.4.98__py3-none-any.whl → 0.4.98.1b1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of terrakio-core might be problematic. Click here for more details.
- terrakio_core/async_client.py +26 -169
- terrakio_core/config.py +3 -44
- terrakio_core/endpoints/auth.py +96 -47
- terrakio_core/endpoints/dataset_management.py +120 -54
- terrakio_core/endpoints/group_management.py +269 -76
- terrakio_core/endpoints/mass_stats.py +704 -581
- terrakio_core/endpoints/model_management.py +213 -109
- terrakio_core/endpoints/user_management.py +106 -21
- terrakio_core/exceptions.py +371 -1
- terrakio_core/sync_client.py +9 -124
- {terrakio_core-0.4.98.dist-info → terrakio_core-0.4.98.1b1.dist-info}/METADATA +2 -1
- terrakio_core-0.4.98.1b1.dist-info/RECORD +23 -0
- terrakio_core-0.4.98.dist-info/RECORD +0 -23
- {terrakio_core-0.4.98.dist-info → terrakio_core-0.4.98.1b1.dist-info}/WHEEL +0 -0
terrakio_core/exceptions.py
CHANGED
|
@@ -17,4 +17,374 @@ class DownloadError(Exception):
|
|
|
17
17
|
|
|
18
18
|
class ValidationError(Exception):
|
|
19
19
|
"""Exception raised for invalid request parameters."""
|
|
20
|
-
pass
|
|
20
|
+
pass
|
|
21
|
+
|
|
22
|
+
class NetworkError(Exception):
|
|
23
|
+
"""Exception raised for network errors."""
|
|
24
|
+
pass
|
|
25
|
+
|
|
26
|
+
class AuthenticationExpireError(Exception):
|
|
27
|
+
"""Exception raised for authentication expire errors."""
|
|
28
|
+
def __init__(self, message: str, status_code: int = None):
|
|
29
|
+
super().__init__(message)
|
|
30
|
+
self.status_code = status_code
|
|
31
|
+
|
|
32
|
+
class QuotaError(Exception):
|
|
33
|
+
"""Exception raised for quota errors."""
|
|
34
|
+
def __init__(self, message: str, status_code: int = None):
|
|
35
|
+
super().__init__(message)
|
|
36
|
+
self.status_code = status_code
|
|
37
|
+
|
|
38
|
+
class UserInfoError(Exception):
|
|
39
|
+
"""Exception raised for user info errors."""
|
|
40
|
+
def __init__(self, message: str, status_code: int = None):
|
|
41
|
+
super().__init__(message)
|
|
42
|
+
self.status_code = status_code
|
|
43
|
+
|
|
44
|
+
class APIKeyError(Exception):
|
|
45
|
+
"""Exception raised for API key errors."""
|
|
46
|
+
def __init__(self, message: str, status_code: int = None):
|
|
47
|
+
super().__init__(message)
|
|
48
|
+
self.status_code = status_code
|
|
49
|
+
|
|
50
|
+
class RefreshAPIKeyError(Exception):
|
|
51
|
+
"""Exception raised for refresh API key errors."""
|
|
52
|
+
def __init__(self, message: str, status_code: int = None):
|
|
53
|
+
super().__init__(message)
|
|
54
|
+
self.status_code = status_code
|
|
55
|
+
|
|
56
|
+
class InvalidUsernamePasswordError(Exception):
|
|
57
|
+
"""Exception raised for invalid username or password errors."""
|
|
58
|
+
def __init__(self, message: str, status_code: int = None):
|
|
59
|
+
super().__init__(message)
|
|
60
|
+
self.status_code = status_code
|
|
61
|
+
|
|
62
|
+
class LoginError(Exception):
|
|
63
|
+
"""Exception raised for login errors."""
|
|
64
|
+
def __init__(self, message: str, status_code: int = None):
|
|
65
|
+
super().__init__(message)
|
|
66
|
+
self.status_code = status_code
|
|
67
|
+
|
|
68
|
+
class ResetPasswordError(Exception):
|
|
69
|
+
"""Exception raised for reset password errors."""
|
|
70
|
+
def __init__(self, message: str, status_code: int = None):
|
|
71
|
+
super().__init__(message)
|
|
72
|
+
self.status_code = status_code
|
|
73
|
+
|
|
74
|
+
class SignupError(Exception):
|
|
75
|
+
"""Exception raised for signup errors."""
|
|
76
|
+
def __init__(self, message: str, status_code: int = None):
|
|
77
|
+
super().__init__(message)
|
|
78
|
+
self.status_code = status_code
|
|
79
|
+
|
|
80
|
+
class InvalidEmailFormatError(Exception):
|
|
81
|
+
"""Exception raised for invalid email format errors."""
|
|
82
|
+
def __init__(self, message: str, status_code: int = None):
|
|
83
|
+
super().__init__(message)
|
|
84
|
+
self.status_code = status_code
|
|
85
|
+
|
|
86
|
+
class EmailAlreadyExistsError(Exception):
|
|
87
|
+
"""Exception raised for email already exists errors."""
|
|
88
|
+
def __init__(self, message: str, status_code: int = None):
|
|
89
|
+
super().__init__(message)
|
|
90
|
+
self.status_code = status_code
|
|
91
|
+
|
|
92
|
+
class UserNotFoundError(Exception):
|
|
93
|
+
"""Exception raised for user not found errors."""
|
|
94
|
+
def __init__(self, message: str, status_code: int = None):
|
|
95
|
+
super().__init__(message)
|
|
96
|
+
self.status_code = status_code
|
|
97
|
+
|
|
98
|
+
class GetUserByIdError(Exception):
|
|
99
|
+
"""Exception raised for get user by id errors."""
|
|
100
|
+
def __init__(self, message: str, status_code: int = None):
|
|
101
|
+
super().__init__(message)
|
|
102
|
+
self.status_code = status_code
|
|
103
|
+
|
|
104
|
+
class GetUserByEmailError(Exception):
|
|
105
|
+
"""Exception raised for get user by email errors."""
|
|
106
|
+
def __init__(self, message: str, status_code: int = None):
|
|
107
|
+
super().__init__(message)
|
|
108
|
+
self.status_code = status_code
|
|
109
|
+
|
|
110
|
+
class ListUsersError(Exception):
|
|
111
|
+
"""Exception raised for list users errors."""
|
|
112
|
+
def __init__(self, message: str, status_code: int = None):
|
|
113
|
+
super().__init__(message)
|
|
114
|
+
self.status_code = status_code
|
|
115
|
+
|
|
116
|
+
class EditUserError(Exception):
|
|
117
|
+
"""Exception raised for edit user errors."""
|
|
118
|
+
def __init__(self, message: str, status_code: int = None):
|
|
119
|
+
super().__init__(message)
|
|
120
|
+
self.status_code = status_code
|
|
121
|
+
|
|
122
|
+
class ResetQuotaError(Exception):
|
|
123
|
+
"""Exception raised for reset quota errors."""
|
|
124
|
+
def __init__(self, message: str, status_code: int = None):
|
|
125
|
+
super().__init__(message)
|
|
126
|
+
self.status_code = status_code
|
|
127
|
+
|
|
128
|
+
class DeleteUserError(Exception):
|
|
129
|
+
"""Exception raised for delete user errors."""
|
|
130
|
+
def __init__(self, message: str, status_code: int = None):
|
|
131
|
+
super().__init__(message)
|
|
132
|
+
self.status_code = status_code
|
|
133
|
+
|
|
134
|
+
class ChangeRoleError(Exception):
|
|
135
|
+
"""Exception raised for change role errors."""
|
|
136
|
+
def __init__(self, message: str, status_code: int = None):
|
|
137
|
+
super().__init__(message)
|
|
138
|
+
self.status_code = status_code
|
|
139
|
+
|
|
140
|
+
class ListGroupsError(Exception):
|
|
141
|
+
"""Exception raised for list groups errors."""
|
|
142
|
+
def __init__(self, message: str, status_code: int = None):
|
|
143
|
+
super().__init__(message)
|
|
144
|
+
self.status_code = status_code
|
|
145
|
+
|
|
146
|
+
class GetGroupError(Exception):
|
|
147
|
+
"""Exception raised for get group errors."""
|
|
148
|
+
def __init__(self, message: str, status_code: int = None):
|
|
149
|
+
super().__init__(message)
|
|
150
|
+
self.status_code = status_code
|
|
151
|
+
|
|
152
|
+
class GetGroupDatasetsError(Exception):
|
|
153
|
+
"""Exception raised for get group datasets errors."""
|
|
154
|
+
def __init__(self, message: str, status_code: int = None):
|
|
155
|
+
super().__init__(message)
|
|
156
|
+
self.status_code = status_code
|
|
157
|
+
|
|
158
|
+
class NoDatasetsFoundForGroupError(Exception):
|
|
159
|
+
"""Exception raised for no datasets found for group errors."""
|
|
160
|
+
def __init__(self, message: str, status_code: int = None):
|
|
161
|
+
super().__init__(message)
|
|
162
|
+
self.status_code = status_code
|
|
163
|
+
|
|
164
|
+
class CreateGroupError(Exception):
|
|
165
|
+
"""Exception raised for create group errors."""
|
|
166
|
+
def __init__(self, message: str, status_code: int = None):
|
|
167
|
+
super().__init__(message)
|
|
168
|
+
self.status_code = status_code
|
|
169
|
+
|
|
170
|
+
class DeleteGroupError(Exception):
|
|
171
|
+
"""Exception raised for delete group errors."""
|
|
172
|
+
def __init__(self, message: str, status_code: int = None):
|
|
173
|
+
super().__init__(message)
|
|
174
|
+
self.status_code = status_code
|
|
175
|
+
|
|
176
|
+
class AddUserToGroupError(Exception):
|
|
177
|
+
"""Exception raised for add user to group errors."""
|
|
178
|
+
def __init__(self, message: str, status_code: int = None):
|
|
179
|
+
super().__init__(message)
|
|
180
|
+
self.status_code = status_code
|
|
181
|
+
|
|
182
|
+
class AddGroupToDatasetError(Exception):
|
|
183
|
+
"""Exception raised for add group to dataset errors."""
|
|
184
|
+
def __init__(self, message: str, status_code: int = None):
|
|
185
|
+
super().__init__(message)
|
|
186
|
+
self.status_code = status_code
|
|
187
|
+
|
|
188
|
+
class AddUserToDatasetError(Exception):
|
|
189
|
+
"""Exception raised for add user to dataset errors."""
|
|
190
|
+
def __init__(self, message: str, status_code: int = None):
|
|
191
|
+
super().__init__(message)
|
|
192
|
+
self.status_code = status_code
|
|
193
|
+
|
|
194
|
+
class RemoveUserFromGroupError(Exception):
|
|
195
|
+
"""Exception raised for remove user from group errors."""
|
|
196
|
+
def __init__(self, message: str, status_code: int = None):
|
|
197
|
+
super().__init__(message)
|
|
198
|
+
self.status_code = status_code
|
|
199
|
+
|
|
200
|
+
class RemoveUserFromDatasetError(Exception):
|
|
201
|
+
"""Exception raised for remove user from dataset errors."""
|
|
202
|
+
def __init__(self, message: str, status_code: int = None):
|
|
203
|
+
super().__init__(message)
|
|
204
|
+
self.status_code = status_code
|
|
205
|
+
|
|
206
|
+
class GroupNotFoundError(Exception):
|
|
207
|
+
"""Exception raised for group not found errors."""
|
|
208
|
+
def __init__(self, message: str, status_code: int = None):
|
|
209
|
+
super().__init__(message)
|
|
210
|
+
self.status_code = status_code
|
|
211
|
+
|
|
212
|
+
class GroupPermissionError(Exception):
|
|
213
|
+
"""Exception raised for group permission errors."""
|
|
214
|
+
def __init__(self, message: str, status_code: int = None):
|
|
215
|
+
super().__init__(message)
|
|
216
|
+
self.status_code = status_code
|
|
217
|
+
|
|
218
|
+
class CommandPermissionError(Exception):
|
|
219
|
+
"""Exception raised for command permission errors."""
|
|
220
|
+
def __init__(self, message: str, status_code: int = None):
|
|
221
|
+
super().__init__(message)
|
|
222
|
+
self.status_code = status_code
|
|
223
|
+
|
|
224
|
+
class DatasetNotFoundError(Exception):
|
|
225
|
+
"""Exception raised for dataset not found errors."""
|
|
226
|
+
def __init__(self, message: str, status_code: int = None):
|
|
227
|
+
super().__init__(message)
|
|
228
|
+
self.status_code = status_code
|
|
229
|
+
|
|
230
|
+
class RemoveGroupFromDatasetError(Exception):
|
|
231
|
+
"""Exception raised for remove group from dataset errors."""
|
|
232
|
+
def __init__(self, message: str, status_code: int = None):
|
|
233
|
+
super().__init__(message)
|
|
234
|
+
self.status_code = status_code
|
|
235
|
+
|
|
236
|
+
class ListDatasetsError(Exception):
|
|
237
|
+
"""Exception raised for list datasets errors."""
|
|
238
|
+
def __init__(self, message: str, status_code: int = None):
|
|
239
|
+
super().__init__(message)
|
|
240
|
+
self.status_code = status_code
|
|
241
|
+
|
|
242
|
+
class GetUsersByRoleError(Exception):
|
|
243
|
+
"""Exception raised for get users by role errors."""
|
|
244
|
+
def __init__(self, message: str, status_code: int = None):
|
|
245
|
+
super().__init__(message)
|
|
246
|
+
self.status_code = status_code
|
|
247
|
+
|
|
248
|
+
class RoleDoNotExistError(Exception):
|
|
249
|
+
"""Exception raised for role does not exist errors."""
|
|
250
|
+
def __init__(self, message: str, status_code: int = None):
|
|
251
|
+
super().__init__(message)
|
|
252
|
+
self.status_code = status_code
|
|
253
|
+
|
|
254
|
+
class ChangeRoleError(Exception):
|
|
255
|
+
"""Exception raised for change role errors."""
|
|
256
|
+
def __init__(self, message: str, status_code: int = None):
|
|
257
|
+
super().__init__(message)
|
|
258
|
+
self.status_code = status_code
|
|
259
|
+
|
|
260
|
+
class GetDatasetError(Exception):
|
|
261
|
+
"""Exception raised for get dataset errors."""
|
|
262
|
+
def __init__(self, message: str, status_code: int = None):
|
|
263
|
+
super().__init__(message)
|
|
264
|
+
self.status_code = status_code
|
|
265
|
+
|
|
266
|
+
class DatasetPermissionError(Exception):
|
|
267
|
+
"""Exception raised for dataset permission errors."""
|
|
268
|
+
def __init__(self, message: str, status_code: int = None):
|
|
269
|
+
super().__init__(message)
|
|
270
|
+
self.status_code = status_code
|
|
271
|
+
|
|
272
|
+
class CreateDatasetError(Exception):
|
|
273
|
+
"""Exception raised for create dataset errors."""
|
|
274
|
+
def __init__(self, message: str, status_code: int = None):
|
|
275
|
+
super().__init__(message)
|
|
276
|
+
self.status_code = status_code
|
|
277
|
+
|
|
278
|
+
class DatasetAlreadyExistsError(Exception):
|
|
279
|
+
"""Exception raised for dataset already exists errors."""
|
|
280
|
+
def __init__(self, message: str, status_code: int = None):
|
|
281
|
+
super().__init__(message)
|
|
282
|
+
self.status_code = status_code
|
|
283
|
+
|
|
284
|
+
class DeleteDatasetError(Exception):
|
|
285
|
+
"""Exception raised for delete dataset errors."""
|
|
286
|
+
def __init__(self, message: str, status_code: int = None):
|
|
287
|
+
super().__init__(message)
|
|
288
|
+
self.status_code = status_code
|
|
289
|
+
|
|
290
|
+
class OverwriteDatasetError(Exception):
|
|
291
|
+
"""Exception raised for overwrite dataset errors."""
|
|
292
|
+
def __init__(self, message: str, status_code: int = None):
|
|
293
|
+
super().__init__(message)
|
|
294
|
+
self.status_code = status_code
|
|
295
|
+
|
|
296
|
+
class ListCollectionsError(Exception):
|
|
297
|
+
"""Exception raised for list collections errors."""
|
|
298
|
+
def __init__(self, message: str, status_code: int = None):
|
|
299
|
+
super().__init__(message)
|
|
300
|
+
self.status_code = status_code
|
|
301
|
+
|
|
302
|
+
class GetCollectionError(Exception):
|
|
303
|
+
"""Exception raised for get collection errors."""
|
|
304
|
+
def __init__(self, message: str, status_code: int = None):
|
|
305
|
+
super().__init__(message)
|
|
306
|
+
self.status_code = status_code
|
|
307
|
+
|
|
308
|
+
class CreateCollectionError(Exception):
|
|
309
|
+
"""Exception raised for create collection errors."""
|
|
310
|
+
def __init__(self, message: str, status_code: int = None):
|
|
311
|
+
super().__init__(message)
|
|
312
|
+
self.status_code = status_code
|
|
313
|
+
|
|
314
|
+
class CollectionNotFoundError(Exception):
|
|
315
|
+
"""Exception raised for collection not found errors."""
|
|
316
|
+
def __init__(self, message: str, status_code: int = None):
|
|
317
|
+
super().__init__(message)
|
|
318
|
+
self.status_code = status_code
|
|
319
|
+
|
|
320
|
+
class CollectionAlreadyExistsError(Exception):
|
|
321
|
+
"""Exception raised for collection already exists errors."""
|
|
322
|
+
def __init__(self, message: str, status_code: int = None):
|
|
323
|
+
super().__init__(message)
|
|
324
|
+
self.status_code = status_code
|
|
325
|
+
|
|
326
|
+
class InvalidCollectionTypeError(Exception):
|
|
327
|
+
"""Exception raised for invalid collection type errors."""
|
|
328
|
+
def __init__(self, message: str, status_code: int = None):
|
|
329
|
+
super().__init__(message)
|
|
330
|
+
self.status_code = status_code
|
|
331
|
+
|
|
332
|
+
class DeleteCollectionError(Exception):
|
|
333
|
+
"""Exception raised for delete collection errors."""
|
|
334
|
+
def __init__(self, message: str, status_code: int = None):
|
|
335
|
+
super().__init__(message)
|
|
336
|
+
self.status_code = status_code
|
|
337
|
+
|
|
338
|
+
class ListTasksError(Exception):
|
|
339
|
+
"""Exception raised for list tasks errors."""
|
|
340
|
+
def __init__(self, message: str, status_code: int = None):
|
|
341
|
+
super().__init__(message)
|
|
342
|
+
self.status_code = status_code
|
|
343
|
+
|
|
344
|
+
class UploadRequestsError(Exception):
|
|
345
|
+
"""Exception raised for upload requests errors."""
|
|
346
|
+
def __init__(self, message: str, status_code: int = None):
|
|
347
|
+
super().__init__(message)
|
|
348
|
+
self.status_code = status_code
|
|
349
|
+
|
|
350
|
+
class UploadArtifactsError(Exception):
|
|
351
|
+
"""Exception raised for upload artifacts errors."""
|
|
352
|
+
def __init__(self, message: str, status_code: int = None):
|
|
353
|
+
super().__init__(message)
|
|
354
|
+
self.status_code = status_code
|
|
355
|
+
|
|
356
|
+
class GetTaskError(Exception):
|
|
357
|
+
"""Exception raised for get task errors."""
|
|
358
|
+
def __init__(self, message: str, status_code: int = None):
|
|
359
|
+
super().__init__(message)
|
|
360
|
+
self.status_code = status_code
|
|
361
|
+
|
|
362
|
+
class TaskNotFoundError(Exception):
|
|
363
|
+
"""Exception raised for task not found errors."""
|
|
364
|
+
def __init__(self, message: str, status_code: int = None):
|
|
365
|
+
super().__init__(message)
|
|
366
|
+
self.status_code = status_code
|
|
367
|
+
|
|
368
|
+
class DownloadFilesError(Exception):
|
|
369
|
+
"""Exception raised for download files errors."""
|
|
370
|
+
def __init__(self, message: str, status_code: int = None):
|
|
371
|
+
super().__init__(message)
|
|
372
|
+
self.status_code = status_code
|
|
373
|
+
|
|
374
|
+
class CancelTaskError(Exception):
|
|
375
|
+
"""Exception raised for cancel task errors."""
|
|
376
|
+
def __init__(self, message: str, status_code: int = None):
|
|
377
|
+
super().__init__(message)
|
|
378
|
+
self.status_code = status_code
|
|
379
|
+
|
|
380
|
+
class CancelCollectionTasksError(Exception):
|
|
381
|
+
"""Exception raised for cancel collection tasks errors."""
|
|
382
|
+
def __init__(self, message: str, status_code: int = None):
|
|
383
|
+
super().__init__(message)
|
|
384
|
+
self.status_code = status_code
|
|
385
|
+
|
|
386
|
+
class CancelAllTasksError(Exception):
|
|
387
|
+
"""Exception raised for cancel all tasks errors."""
|
|
388
|
+
def __init__(self, message: str, status_code: int = None):
|
|
389
|
+
super().__init__(message)
|
|
390
|
+
self.status_code = status_code
|
terrakio_core/sync_client.py
CHANGED
|
@@ -249,135 +249,20 @@ class SyncClient:
|
|
|
249
249
|
)
|
|
250
250
|
return self._run_async(coro)
|
|
251
251
|
|
|
252
|
-
def zonal_stats(
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
expr: str,
|
|
256
|
-
conc: int = 20,
|
|
257
|
-
in_crs: str = "epsg:4326",
|
|
258
|
-
out_crs: str = "epsg:4326",
|
|
259
|
-
resolution: int = -1,
|
|
260
|
-
geom_fix: bool = False,
|
|
261
|
-
mass_stats: bool = False,
|
|
262
|
-
id_column: Optional[str] = None,
|
|
263
|
-
) -> GeoDataFrame:
|
|
264
|
-
|
|
265
|
-
"""
|
|
266
|
-
Compute zonal statistics for all geometries in a GeoDataFrame (synchronous version).
|
|
267
|
-
|
|
268
|
-
Args:
|
|
269
|
-
gdf (GeoDataFrame): GeoDataFrame containing geometries
|
|
270
|
-
expr (str): Terrakio expression to evaluate, can include spatial aggregations
|
|
271
|
-
conc (int): Number of concurrent requests to make
|
|
272
|
-
in_crs (str): Input coordinate reference system
|
|
273
|
-
out_crs (str): Output coordinate reference system
|
|
274
|
-
resolution (int): Resolution parameter
|
|
275
|
-
geom_fix (bool): Whether to fix the geometry (default False)
|
|
276
|
-
mass_stats (bool): Whether to use mass stats for processing (default False)
|
|
277
|
-
id_column (Optional[str]): Name of the ID column to use (default None)
|
|
278
|
-
|
|
279
|
-
Returns:
|
|
280
|
-
geopandas.GeoDataFrame: GeoDataFrame with added columns for results
|
|
281
|
-
|
|
282
|
-
Raises:
|
|
283
|
-
ValueError: If concurrency is too high or if data exceeds memory limit without streaming
|
|
284
|
-
APIError: If the API request fails
|
|
285
|
-
"""
|
|
286
|
-
coro = self._async_client.zonal_stats(
|
|
287
|
-
gdf=gdf,
|
|
288
|
-
expr=expr,
|
|
289
|
-
conc=conc,
|
|
290
|
-
in_crs=in_crs,
|
|
291
|
-
out_crs=out_crs,
|
|
292
|
-
resolution=resolution,
|
|
293
|
-
geom_fix=geom_fix,
|
|
294
|
-
mass_stats=mass_stats,
|
|
295
|
-
id_column=id_column,
|
|
296
|
-
)
|
|
252
|
+
def zonal_stats(self, *args, **kwargs) -> GeoDataFrame:
|
|
253
|
+
"""Proxy to async zonal_stats with full argument passthrough (sync wrapper)."""
|
|
254
|
+
coro = self._async_client.zonal_stats(*args, **kwargs)
|
|
297
255
|
return self._run_async(coro)
|
|
298
256
|
|
|
299
|
-
def create_dataset_file(
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
aoi: str,
|
|
303
|
-
expression: str,
|
|
304
|
-
output: str,
|
|
305
|
-
in_crs: str = "epsg:4326",
|
|
306
|
-
res: float = 0.0001,
|
|
307
|
-
region: str = "aus",
|
|
308
|
-
to_crs: str = "epsg:4326",
|
|
309
|
-
overwrite: bool = True,
|
|
310
|
-
skip_existing: bool = False,
|
|
311
|
-
non_interactive: bool = True,
|
|
312
|
-
poll_interval: int = 30,
|
|
313
|
-
download_path: str = "/home/user/Downloads",
|
|
314
|
-
mask = True,
|
|
315
|
-
max_file_size_mb: int = 5120, # Default to 5GB
|
|
316
|
-
tile_size: int = 1024,
|
|
317
|
-
) -> dict:
|
|
318
|
-
"""Create a dataset file using mass stats operations (synchronous version)."""
|
|
319
|
-
coro = self._async_client.create_dataset_file(
|
|
320
|
-
aoi=aoi,
|
|
321
|
-
expression=expression,
|
|
322
|
-
output=output,
|
|
323
|
-
in_crs=in_crs,
|
|
324
|
-
res=res,
|
|
325
|
-
region=region,
|
|
326
|
-
to_crs=to_crs,
|
|
327
|
-
overwrite=overwrite,
|
|
328
|
-
skip_existing=skip_existing,
|
|
329
|
-
non_interactive=non_interactive,
|
|
330
|
-
poll_interval=poll_interval,
|
|
331
|
-
download_path=download_path,
|
|
332
|
-
name=name,
|
|
333
|
-
mask=mask,
|
|
334
|
-
max_file_size_mb=max_file_size_mb,
|
|
335
|
-
tile_size=tile_size
|
|
336
|
-
)
|
|
257
|
+
def create_dataset_file(self, *args, **kwargs) -> dict:
|
|
258
|
+
"""Proxy to async create_dataset_file with full argument passthrough (sync wrapper)."""
|
|
259
|
+
coro = self._async_client.create_dataset_file(*args, **kwargs)
|
|
337
260
|
return self._run_async(coro)
|
|
338
261
|
|
|
339
262
|
|
|
340
|
-
def geo_queries(
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
conc: int = 20,
|
|
344
|
-
) -> Union[float, GeoDataFrame]:
|
|
345
|
-
"""
|
|
346
|
-
Execute multiple geo queries concurrently (synchronous version).
|
|
347
|
-
|
|
348
|
-
Args:
|
|
349
|
-
queries (list[dict]): List of dictionaries containing query parameters.
|
|
350
|
-
Each query must have 'expr', 'feature', and 'in_crs' keys.
|
|
351
|
-
conc (int): Number of concurrent requests to make (default 20, max 100)
|
|
352
|
-
|
|
353
|
-
Returns:
|
|
354
|
-
Union[float, geopandas.GeoDataFrame]:
|
|
355
|
-
- float: Average of all results if results are integers
|
|
356
|
-
- GeoDataFrame: GeoDataFrame with geometry and dataset columns if results are xarray datasets
|
|
357
|
-
|
|
358
|
-
Raises:
|
|
359
|
-
ValueError: If queries list is empty, concurrency is too high, or queries are malformed
|
|
360
|
-
APIError: If the API request fails
|
|
361
|
-
|
|
362
|
-
Example:
|
|
363
|
-
queries = [
|
|
364
|
-
{
|
|
365
|
-
'expr': 'WCF.wcf',
|
|
366
|
-
'feature': {'type': 'Feature', 'geometry': {...}, 'properties': {}},
|
|
367
|
-
'in_crs': 'epsg:4326'
|
|
368
|
-
},
|
|
369
|
-
{
|
|
370
|
-
'expr': 'NDVI.ndvi',
|
|
371
|
-
'feature': {'type': 'Feature', 'geometry': {...}, 'properties': {}},
|
|
372
|
-
'in_crs': 'epsg:4326'
|
|
373
|
-
}
|
|
374
|
-
]
|
|
375
|
-
result = client.geo_queries(queries)
|
|
376
|
-
"""
|
|
377
|
-
coro = self._async_client.geo_queries(
|
|
378
|
-
queries=queries,
|
|
379
|
-
conc=conc,
|
|
380
|
-
)
|
|
263
|
+
def geo_queries(self, *args, **kwargs) -> Union[float, GeoDataFrame]:
|
|
264
|
+
"""Proxy to async geo_queries with full argument passthrough (sync wrapper)."""
|
|
265
|
+
coro = self._async_client.geo_queries(*args, **kwargs)
|
|
381
266
|
return self._run_async(coro)
|
|
382
267
|
|
|
383
268
|
# Context manager support
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: terrakio-core
|
|
3
|
-
Version: 0.4.98
|
|
3
|
+
Version: 0.4.98.1b1
|
|
4
4
|
Summary: Core package for the terrakio-python-api
|
|
5
5
|
Requires-Python: >=3.11
|
|
6
6
|
Requires-Dist: aiofiles>=24.1.0
|
|
@@ -14,6 +14,7 @@ Requires-Dist: onnxruntime>=1.22.1
|
|
|
14
14
|
Requires-Dist: psutil>=7.0.0
|
|
15
15
|
Requires-Dist: scipy>=1.16.1
|
|
16
16
|
Requires-Dist: shapely>=2.1.1
|
|
17
|
+
Requires-Dist: typer>=0.19.2
|
|
17
18
|
Requires-Dist: xarray>=2025.7.1
|
|
18
19
|
Provides-Extra: ml
|
|
19
20
|
Requires-Dist: scikit-learn>=1.7.1; extra == 'ml'
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
terrakio_core/__init__.py,sha256=hkasb_FxE6X1_xNNarBjYhIsniejs1HACh87DwzzNrg,274
|
|
2
|
+
terrakio_core/accessors.py,sha256=UZIi9y4RpBxouSmKuwuNYLIYqDxD8BH-GnUzwJuc1JI,47570
|
|
3
|
+
terrakio_core/async_client.py,sha256=aCLjiAmhRS20efrA11hhGUbtwsxapIBp4hBAwG79K6Y,9766
|
|
4
|
+
terrakio_core/client.py,sha256=VXP7BtJWIfpPPZR7_yNdSTcGwNgTwhb7KorusqkQrzk,5603
|
|
5
|
+
terrakio_core/config.py,sha256=Zja4F1r8PjmeH4poBnRR8SHKmzZRfGPsLWHBHugVMvc,2695
|
|
6
|
+
terrakio_core/exceptions.py,sha256=uKUwqTmR6Via6D5ji1g-YkH4_7p0hxAITS7DaJUZ8tw,14421
|
|
7
|
+
terrakio_core/sync_client.py,sha256=m5ybuQdWmjg2lIjWZED91iBXE094lOPGn-S-01ee8w4,10802
|
|
8
|
+
terrakio_core/convenience_functions/create_dataset_file.py,sha256=RDTAQnKUigyczv3EKhKrs34VMDZDCgL4iz0bge1d9e4,4774
|
|
9
|
+
terrakio_core/convenience_functions/geoquries.py,sha256=7E3drOD5ffNk2-rKLbwKsNp3_Berq-S1lQk5wwHSuAo,3786
|
|
10
|
+
terrakio_core/convenience_functions/zonal_stats.py,sha256=7PI--RI0hiF1pzZ7_7hqtyOMOyw607HvHedD8BnYuJo,26630
|
|
11
|
+
terrakio_core/endpoints/auth.py,sha256=5WvAO39aLsbJAVtxISwiOZseKr3B9I5tHjamPRehDBQ,8327
|
|
12
|
+
terrakio_core/endpoints/dataset_management.py,sha256=jpwftiKOI59NhXXypqm6wtILIkfyjy9NfYifRIvhZS0,16791
|
|
13
|
+
terrakio_core/endpoints/group_management.py,sha256=V0KOGTXwmePBFeym55G_m3ONR-jVj2IU4OVLiL5UKz4,15869
|
|
14
|
+
terrakio_core/endpoints/mass_stats.py,sha256=YOtV1_yiTJwtJF-hXY5SrOZ7_tpHeXFk5HLoXcL1Yuc,30064
|
|
15
|
+
terrakio_core/endpoints/model_management.py,sha256=AqQkFPIdPuApYC58VLRG0GxD-s6gic7Ffa9InG8lb3I,56505
|
|
16
|
+
terrakio_core/endpoints/space_management.py,sha256=YWb55nkJnFJGlALJ520DvurxDqVqwYtsvqQPWzxzhDs,2266
|
|
17
|
+
terrakio_core/endpoints/user_management.py,sha256=L_g4ysrh2xyz_JbObUU_tCxgHxisrDUPntWgQOs15GE,7709
|
|
18
|
+
terrakio_core/helper/bounded_taskgroup.py,sha256=wiTH10jhKZgrsgrFUNG6gig8bFkUEPHkGRT2XY7Rgmo,677
|
|
19
|
+
terrakio_core/helper/decorators.py,sha256=L6om7wmWNgCei3Wy5U0aZ-70OzsCwclkjIf7SfQuhCg,2289
|
|
20
|
+
terrakio_core/helper/tiles.py,sha256=lcLCO6KiP05lCI9vngo3zCZJ6Z9C0pUxHSQS4H58EHc,2699
|
|
21
|
+
terrakio_core-0.4.98.1b1.dist-info/METADATA,sha256=UluyW9jLpf-OQwjuwUt2AHuqY30nNJiBfS_GqTUGcuM,1184
|
|
22
|
+
terrakio_core-0.4.98.1b1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
23
|
+
terrakio_core-0.4.98.1b1.dist-info/RECORD,,
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
terrakio_core/__init__.py,sha256=hkasb_FxE6X1_xNNarBjYhIsniejs1HACh87DwzzNrg,274
|
|
2
|
-
terrakio_core/accessors.py,sha256=UZIi9y4RpBxouSmKuwuNYLIYqDxD8BH-GnUzwJuc1JI,47570
|
|
3
|
-
terrakio_core/async_client.py,sha256=txdSsX3IwqtHlcS86u6N6vjV0-PIiermxNOIjEMQ3Yg,14950
|
|
4
|
-
terrakio_core/client.py,sha256=VXP7BtJWIfpPPZR7_yNdSTcGwNgTwhb7KorusqkQrzk,5603
|
|
5
|
-
terrakio_core/config.py,sha256=r8NARVYOca4AuM88VP_j-8wQxOk1s7VcRdyEdseBlLE,4193
|
|
6
|
-
terrakio_core/exceptions.py,sha256=4qnpOM1gOxsNIXDXY4qwY1d3I4Myhp7HBh7b2D0SVrU,529
|
|
7
|
-
terrakio_core/sync_client.py,sha256=jbG2sMnbR3QPvhAxQX2dBWeX_6f-Qx_MFSRLLpvfRh4,14604
|
|
8
|
-
terrakio_core/convenience_functions/create_dataset_file.py,sha256=RDTAQnKUigyczv3EKhKrs34VMDZDCgL4iz0bge1d9e4,4774
|
|
9
|
-
terrakio_core/convenience_functions/geoquries.py,sha256=7E3drOD5ffNk2-rKLbwKsNp3_Berq-S1lQk5wwHSuAo,3786
|
|
10
|
-
terrakio_core/convenience_functions/zonal_stats.py,sha256=7PI--RI0hiF1pzZ7_7hqtyOMOyw607HvHedD8BnYuJo,26630
|
|
11
|
-
terrakio_core/endpoints/auth.py,sha256=FdLsPScPIBo-Gxl6ZnE-46cp2molggAJtL72LssN3fg,6049
|
|
12
|
-
terrakio_core/endpoints/dataset_management.py,sha256=D2foX8DGbSXQ4vYLRt0Es3j96a_qfd920Ct3uN3dd7Y,13641
|
|
13
|
-
terrakio_core/endpoints/group_management.py,sha256=VFl3jakjQa9OPi351D3DZvLU9M7fHdfjCzGhmyJsx3U,6309
|
|
14
|
-
terrakio_core/endpoints/mass_stats.py,sha256=Vb6Tf8kKf5Hlch4ddsrQnfayfiK6z7NSjO8D0pop4p8,25699
|
|
15
|
-
terrakio_core/endpoints/model_management.py,sha256=LH_gHPrqYA-_45KWpDBRcFbwHgm-Kg0zk1ealy7P_C0,52379
|
|
16
|
-
terrakio_core/endpoints/space_management.py,sha256=YWb55nkJnFJGlALJ520DvurxDqVqwYtsvqQPWzxzhDs,2266
|
|
17
|
-
terrakio_core/endpoints/user_management.py,sha256=WlFr3EfK8iI6DfkpMuYLHZUPk2n7_DHHO6z1hndmZB4,3816
|
|
18
|
-
terrakio_core/helper/bounded_taskgroup.py,sha256=wiTH10jhKZgrsgrFUNG6gig8bFkUEPHkGRT2XY7Rgmo,677
|
|
19
|
-
terrakio_core/helper/decorators.py,sha256=L6om7wmWNgCei3Wy5U0aZ-70OzsCwclkjIf7SfQuhCg,2289
|
|
20
|
-
terrakio_core/helper/tiles.py,sha256=lcLCO6KiP05lCI9vngo3zCZJ6Z9C0pUxHSQS4H58EHc,2699
|
|
21
|
-
terrakio_core-0.4.98.dist-info/METADATA,sha256=EyTojmXAa4ldDolEPC_VcB014s-BfjZ8mwnUGxk81YU,1151
|
|
22
|
-
terrakio_core-0.4.98.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
23
|
-
terrakio_core-0.4.98.dist-info/RECORD,,
|
|
File without changes
|