earthengine-api 1.5.23__py3-none-any.whl → 1.5.24__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 earthengine-api might be problematic. Click here for more details.
- {earthengine_api-1.5.23.dist-info → earthengine_api-1.5.24.dist-info}/METADATA +1 -1
- earthengine_api-1.5.24.dist-info/RECORD +107 -0
- ee/__init__.py +3 -3
- ee/_arg_types.py +6 -6
- ee/_cloud_api_utils.py +35 -35
- ee/_helpers.py +2 -2
- ee/apifunction.py +10 -10
- ee/apitestcase.py +9 -9
- ee/batch.py +39 -39
- ee/blob.py +2 -2
- ee/cli/commands.py +15 -15
- ee/cli/utils.py +5 -5
- ee/collection.py +3 -3
- ee/computedobject.py +6 -6
- ee/confusionmatrix.py +2 -2
- ee/customfunction.py +8 -8
- ee/data.py +55 -55
- ee/daterange.py +2 -2
- ee/deprecation.py +4 -4
- ee/dictionary.py +2 -2
- ee/ee_array.py +2 -2
- ee/ee_date.py +2 -2
- ee/ee_list.py +2 -3
- ee/element.py +3 -3
- ee/errormargin.py +2 -2
- ee/feature.py +5 -5
- ee/featurecollection.py +5 -5
- ee/function.py +5 -5
- ee/geometry.py +10 -10
- ee/image.py +19 -19
- ee/image_converter.py +2 -2
- ee/imagecollection.py +7 -7
- ee/oauth.py +4 -4
- ee/pixeltype.py +2 -2
- ee/projection.py +2 -2
- ee/serializer.py +5 -5
- ee/table_converter.py +4 -4
- ee/tests/blob_test.py +3 -3
- ee/tests/classifier_test.py +3 -3
- ee/tests/clusterer_test.py +3 -3
- ee/tests/confusionmatrix_test.py +3 -3
- ee/tests/daterange_test.py +4 -4
- ee/tests/deprecation_test.py +2 -2
- ee/tests/dictionary_test.py +3 -3
- ee/tests/ee_array_test.py +3 -3
- ee/tests/ee_date_test.py +4 -4
- ee/tests/ee_list_test.py +3 -3
- ee/tests/ee_number_test.py +3 -3
- ee/tests/ee_string_test.py +3 -3
- ee/tests/feature_test.py +4 -4
- ee/tests/featurecollection_test.py +3 -3
- ee/tests/filter_test.py +4 -4
- ee/tests/geometry_point_test.py +3 -3
- ee/tests/image_test.py +3 -3
- ee/tests/imagecollection_test.py +3 -3
- ee/tests/join_test.py +3 -3
- ee/tests/kernel_test.py +3 -3
- ee/tests/model_test.py +5 -5
- ee/tests/pixeltype_test.py +5 -5
- ee/tests/projection_test.py +3 -3
- ee/tests/reducer_test.py +3 -3
- ee/tests/serializer_test.py +4 -4
- ee/tests/table_converter_test.py +3 -3
- ee/tests/terrain_test.py +3 -3
- earthengine_api-1.5.23.dist-info/RECORD +0 -107
- {earthengine_api-1.5.23.dist-info → earthengine_api-1.5.24.dist-info}/WHEEL +0 -0
- {earthengine_api-1.5.23.dist-info → earthengine_api-1.5.24.dist-info}/entry_points.txt +0 -0
- {earthengine_api-1.5.23.dist-info → earthengine_api-1.5.24.dist-info}/licenses/LICENSE +0 -0
- {earthengine_api-1.5.23.dist-info → earthengine_api-1.5.24.dist-info}/top_level.txt +0 -0
ee/data.py
CHANGED
|
@@ -9,7 +9,7 @@ import platform
|
|
|
9
9
|
import re
|
|
10
10
|
import sys
|
|
11
11
|
import threading
|
|
12
|
-
from typing import Any, Callable,
|
|
12
|
+
from typing import Any, Callable, Iterator, Optional, Sequence, Union
|
|
13
13
|
import uuid
|
|
14
14
|
import warnings
|
|
15
15
|
|
|
@@ -359,10 +359,10 @@ def _get_cloud_projects_raw() -> Any:
|
|
|
359
359
|
return _cloud_api_resource_raw.projects()
|
|
360
360
|
|
|
361
361
|
|
|
362
|
-
def _make_request_headers() -> Optional[
|
|
362
|
+
def _make_request_headers() -> Optional[dict[str, Any]]:
|
|
363
363
|
"""Adds headers based on client context."""
|
|
364
|
-
headers:
|
|
365
|
-
client_version_header_values:
|
|
364
|
+
headers: dict[str, Any] = {}
|
|
365
|
+
client_version_header_values: list[Any] = []
|
|
366
366
|
if _cloud_api_client_version is not None:
|
|
367
367
|
client_version_header_values.append('ee-py/' + _cloud_api_client_version)
|
|
368
368
|
if _user_agent is not None:
|
|
@@ -426,7 +426,7 @@ def _translate_cloud_exception(
|
|
|
426
426
|
return ee_exception.EEException(http_error._get_reason()) # pylint: disable=protected-access
|
|
427
427
|
|
|
428
428
|
|
|
429
|
-
def _maybe_populate_workload_tag(body:
|
|
429
|
+
def _maybe_populate_workload_tag(body: dict[str, Any]) -> None:
|
|
430
430
|
"""Populates the workload tag on the request body passed in if applicable.
|
|
431
431
|
|
|
432
432
|
Defaults to the workload tag set by ee.data.setWorkloadTag() or related
|
|
@@ -556,7 +556,7 @@ def getAsset(asset_id: str) -> Any:
|
|
|
556
556
|
|
|
557
557
|
|
|
558
558
|
@deprecation.Deprecated('Use listAssets or listImages')
|
|
559
|
-
def getList(params:
|
|
559
|
+
def getList(params: dict[str, Any]) -> Any:
|
|
560
560
|
"""Get a list of contents for a collection asset.
|
|
561
561
|
|
|
562
562
|
Args:
|
|
@@ -577,8 +577,8 @@ def getList(params: Dict[str, Any]) -> Any:
|
|
|
577
577
|
|
|
578
578
|
|
|
579
579
|
def listImages(
|
|
580
|
-
params: Union[str,
|
|
581
|
-
) ->
|
|
580
|
+
params: Union[str, dict[str, Any]],
|
|
581
|
+
) -> dict[str, Optional[list[Any]]]:
|
|
582
582
|
"""Returns the images in an image collection or folder.
|
|
583
583
|
|
|
584
584
|
Args:
|
|
@@ -615,7 +615,7 @@ def listImages(
|
|
|
615
615
|
return images
|
|
616
616
|
|
|
617
617
|
|
|
618
|
-
def listAssets(params: Union[str,
|
|
618
|
+
def listAssets(params: Union[str, dict[str, Any]]) -> dict[str, list[Any]]:
|
|
619
619
|
"""Returns the assets in a folder.
|
|
620
620
|
|
|
621
621
|
Args:
|
|
@@ -687,7 +687,7 @@ def listBuckets(project: Optional[str] = None) -> Any:
|
|
|
687
687
|
return _execute_cloud_call(_get_cloud_projects().listAssets(parent=project))
|
|
688
688
|
|
|
689
689
|
|
|
690
|
-
def getMapId(params:
|
|
690
|
+
def getMapId(params: dict[str, Any]) -> dict[str, Any]:
|
|
691
691
|
"""Get a Map ID for a given asset.
|
|
692
692
|
|
|
693
693
|
Args:
|
|
@@ -762,7 +762,7 @@ def getMapId(params: Dict[str, Any]) -> Dict[str, Any]:
|
|
|
762
762
|
'tile_fetcher': TileFetcher(url_format, map_name=map_name)}
|
|
763
763
|
|
|
764
764
|
|
|
765
|
-
def getFeatureViewTilesKey(params:
|
|
765
|
+
def getFeatureViewTilesKey(params: dict[str, Any]) -> dict[str, Any]:
|
|
766
766
|
"""Get a tiles key for a given map or asset.
|
|
767
767
|
|
|
768
768
|
Args:
|
|
@@ -801,7 +801,7 @@ def getFeatureViewTilesKey(params: Dict[str, Any]) -> Dict[str, Any]:
|
|
|
801
801
|
}
|
|
802
802
|
|
|
803
803
|
|
|
804
|
-
def _extract_table_converter(params:
|
|
804
|
+
def _extract_table_converter(params: dict[str, Any]) -> Optional[Any]:
|
|
805
805
|
if 'fileFormat' in params:
|
|
806
806
|
file_format = params.get('fileFormat')
|
|
807
807
|
converter = table_converter.from_file_format(file_format)
|
|
@@ -812,7 +812,7 @@ def _extract_table_converter(params: Dict[str, Any]) -> Optional[Any]:
|
|
|
812
812
|
|
|
813
813
|
|
|
814
814
|
def _extract_image_converter(
|
|
815
|
-
params:
|
|
815
|
+
params: dict[str, Any]
|
|
816
816
|
) -> image_converter.ImageConverter:
|
|
817
817
|
file_format = params.get('fileFormat')
|
|
818
818
|
converter = image_converter.from_file_format(file_format)
|
|
@@ -833,7 +833,7 @@ def _generate(func, list_key: str, **kwargs) -> Iterator[Any]:
|
|
|
833
833
|
args['params'].update({'pageToken': response[_NEXT_PAGE_TOKEN_KEY]})
|
|
834
834
|
|
|
835
835
|
|
|
836
|
-
def listFeatures(params:
|
|
836
|
+
def listFeatures(params: dict[str, Any]) -> Any:
|
|
837
837
|
"""List features for a given table or FeatureView asset.
|
|
838
838
|
|
|
839
839
|
Args:
|
|
@@ -878,7 +878,7 @@ def listFeatures(params: Dict[str, Any]) -> Any:
|
|
|
878
878
|
return call(params)
|
|
879
879
|
|
|
880
880
|
|
|
881
|
-
def getPixels(params:
|
|
881
|
+
def getPixels(params: dict[str, Any]) -> Any:
|
|
882
882
|
"""Fetches pixels from an image asset.
|
|
883
883
|
|
|
884
884
|
Args:
|
|
@@ -921,7 +921,7 @@ def getPixels(params: Dict[str, Any]) -> Any:
|
|
|
921
921
|
return data
|
|
922
922
|
|
|
923
923
|
|
|
924
|
-
def computePixels(params:
|
|
924
|
+
def computePixels(params: dict[str, Any]) -> Any:
|
|
925
925
|
"""Computes a tile by performing an arbitrary computation on image data.
|
|
926
926
|
|
|
927
927
|
Args:
|
|
@@ -961,7 +961,7 @@ def computePixels(params: Dict[str, Any]) -> Any:
|
|
|
961
961
|
return data
|
|
962
962
|
|
|
963
963
|
|
|
964
|
-
def computeImages(params:
|
|
964
|
+
def computeImages(params: dict[str, Any]) -> Any:
|
|
965
965
|
"""Computes a list of images by applying a computation to features.
|
|
966
966
|
|
|
967
967
|
Args:
|
|
@@ -987,7 +987,7 @@ def computeImages(params: Dict[str, Any]) -> Any:
|
|
|
987
987
|
)
|
|
988
988
|
|
|
989
989
|
|
|
990
|
-
def computeFeatures(params:
|
|
990
|
+
def computeFeatures(params: dict[str, Any]) -> Any:
|
|
991
991
|
"""Computes a list of features by applying a computation to features.
|
|
992
992
|
|
|
993
993
|
Args:
|
|
@@ -1033,7 +1033,7 @@ def computeFeatures(params: Dict[str, Any]) -> Any:
|
|
|
1033
1033
|
return call(params)
|
|
1034
1034
|
|
|
1035
1035
|
|
|
1036
|
-
def getTileUrl(mapid:
|
|
1036
|
+
def getTileUrl(mapid: dict[str, Any], x: float, y: float, z: float) -> str:
|
|
1037
1037
|
"""Generate a URL for map tiles from a Map ID and coordinates.
|
|
1038
1038
|
|
|
1039
1039
|
Args:
|
|
@@ -1134,7 +1134,7 @@ def computeValue(obj: computedobject.ComputedObject) -> Any:
|
|
|
1134
1134
|
|
|
1135
1135
|
@deprecation.Deprecated('Use getThumbId and makeThumbUrl')
|
|
1136
1136
|
def getThumbnail(
|
|
1137
|
-
params:
|
|
1137
|
+
params: dict[str, Any], thumbType: Optional[str] = None
|
|
1138
1138
|
) -> Any:
|
|
1139
1139
|
"""Get a Thumbnail for a given asset.
|
|
1140
1140
|
|
|
@@ -1169,8 +1169,8 @@ def getThumbnail(
|
|
|
1169
1169
|
|
|
1170
1170
|
|
|
1171
1171
|
def getThumbId(
|
|
1172
|
-
params:
|
|
1173
|
-
) ->
|
|
1172
|
+
params: dict[str, Any], thumbType: Optional[str] = None
|
|
1173
|
+
) -> dict[str, str]:
|
|
1174
1174
|
"""Get a Thumbnail ID for a given asset.
|
|
1175
1175
|
|
|
1176
1176
|
Args:
|
|
@@ -1253,7 +1253,7 @@ def getThumbId(
|
|
|
1253
1253
|
return {'thumbid': result['name'], 'token': ''}
|
|
1254
1254
|
|
|
1255
1255
|
|
|
1256
|
-
def makeThumbUrl(thumbId:
|
|
1256
|
+
def makeThumbUrl(thumbId: dict[str, str]) -> str:
|
|
1257
1257
|
"""Create a thumbnail URL from the given thumbid.
|
|
1258
1258
|
|
|
1259
1259
|
Args:
|
|
@@ -1269,7 +1269,7 @@ def makeThumbUrl(thumbId: Dict[str, str]) -> str:
|
|
|
1269
1269
|
return url
|
|
1270
1270
|
|
|
1271
1271
|
|
|
1272
|
-
def getDownloadId(params:
|
|
1272
|
+
def getDownloadId(params: dict[str, Any]) -> dict[str, str]:
|
|
1273
1273
|
"""Get a Download ID.
|
|
1274
1274
|
|
|
1275
1275
|
Args:
|
|
@@ -1385,7 +1385,7 @@ def getDownloadId(params: Dict[str, Any]) -> Dict[str, str]:
|
|
|
1385
1385
|
return {'docid': result['name'], 'token': ''}
|
|
1386
1386
|
|
|
1387
1387
|
|
|
1388
|
-
def makeDownloadUrl(downloadId:
|
|
1388
|
+
def makeDownloadUrl(downloadId: dict[str, str]) -> str:
|
|
1389
1389
|
"""Create a download URL from the given docid.
|
|
1390
1390
|
|
|
1391
1391
|
Args:
|
|
@@ -1398,7 +1398,7 @@ def makeDownloadUrl(downloadId: Dict[str, str]) -> str:
|
|
|
1398
1398
|
downloadId['docid'])
|
|
1399
1399
|
|
|
1400
1400
|
|
|
1401
|
-
def getTableDownloadId(params:
|
|
1401
|
+
def getTableDownloadId(params: dict[str, Any]) -> dict[str, str]:
|
|
1402
1402
|
"""Get a Download ID.
|
|
1403
1403
|
|
|
1404
1404
|
Args:
|
|
@@ -1447,7 +1447,7 @@ def getTableDownloadId(params: Dict[str, Any]) -> Dict[str, str]:
|
|
|
1447
1447
|
return {'docid': result['name'], 'token': ''}
|
|
1448
1448
|
|
|
1449
1449
|
|
|
1450
|
-
def makeTableDownloadUrl(downloadId:
|
|
1450
|
+
def makeTableDownloadUrl(downloadId: dict[str, str]) -> str:
|
|
1451
1451
|
"""Create a table download URL from a docid.
|
|
1452
1452
|
|
|
1453
1453
|
Args:
|
|
@@ -1501,10 +1501,10 @@ def getAlgorithms() -> Any:
|
|
|
1501
1501
|
|
|
1502
1502
|
@_utils.accept_opt_prefix('opt_path', 'opt_force', 'opt_properties')
|
|
1503
1503
|
def createAsset(
|
|
1504
|
-
value:
|
|
1504
|
+
value: dict[str, Any],
|
|
1505
1505
|
path: Optional[str] = None,
|
|
1506
|
-
properties: Optional[
|
|
1507
|
-
) ->
|
|
1506
|
+
properties: Optional[dict[str, Any]] = None,
|
|
1507
|
+
) -> dict[str, Any]:
|
|
1508
1508
|
"""Creates an asset from a JSON value.
|
|
1509
1509
|
|
|
1510
1510
|
To create an empty image collection or folder, pass in a "value" object
|
|
@@ -1560,7 +1560,7 @@ def createAsset(
|
|
|
1560
1560
|
)
|
|
1561
1561
|
|
|
1562
1562
|
|
|
1563
|
-
def createFolder(path: str) ->
|
|
1563
|
+
def createFolder(path: str) -> dict[str, Any]:
|
|
1564
1564
|
"""Creates an asset folder.
|
|
1565
1565
|
|
|
1566
1566
|
Returns a description of the newly created folder.
|
|
@@ -1624,7 +1624,7 @@ def deleteAsset(assetId: str) -> None:
|
|
|
1624
1624
|
_execute_cloud_call(_get_cloud_projects().assets().delete(name=name))
|
|
1625
1625
|
|
|
1626
1626
|
|
|
1627
|
-
def newTaskId(count: int = 1) ->
|
|
1627
|
+
def newTaskId(count: int = 1) -> list[str]:
|
|
1628
1628
|
"""Generate an ID for a long-running task.
|
|
1629
1629
|
|
|
1630
1630
|
Args:
|
|
@@ -1637,7 +1637,7 @@ def newTaskId(count: int = 1) -> List[str]:
|
|
|
1637
1637
|
|
|
1638
1638
|
|
|
1639
1639
|
@deprecation.Deprecated('Use listOperations')
|
|
1640
|
-
def getTaskList() ->
|
|
1640
|
+
def getTaskList() -> list[Any]:
|
|
1641
1641
|
"""Retrieves a list of the user's tasks.
|
|
1642
1642
|
|
|
1643
1643
|
Returns:
|
|
@@ -1649,7 +1649,7 @@ def getTaskList() -> List[Any]:
|
|
|
1649
1649
|
for o in listOperations()]
|
|
1650
1650
|
|
|
1651
1651
|
|
|
1652
|
-
def listOperations(project: Optional[str] = None) ->
|
|
1652
|
+
def listOperations(project: Optional[str] = None) -> list[Any]:
|
|
1653
1653
|
"""Retrieves a list of the user's tasks.
|
|
1654
1654
|
|
|
1655
1655
|
Args:
|
|
@@ -1676,7 +1676,7 @@ def listOperations(project: Optional[str] = None) -> List[Any]:
|
|
|
1676
1676
|
|
|
1677
1677
|
|
|
1678
1678
|
@deprecation.Deprecated('Use getOperation')
|
|
1679
|
-
def getTaskStatus(taskId: Union[
|
|
1679
|
+
def getTaskStatus(taskId: Union[list[str], str]) -> list[Any]:
|
|
1680
1680
|
"""Retrieve status of one or more long-running tasks.
|
|
1681
1681
|
|
|
1682
1682
|
Args:
|
|
@@ -1740,7 +1740,7 @@ def cancelOperation(operation_name: str) -> None:
|
|
|
1740
1740
|
)
|
|
1741
1741
|
|
|
1742
1742
|
|
|
1743
|
-
def exportImage(request_id: str, params:
|
|
1743
|
+
def exportImage(request_id: str, params: dict[str, Any]) -> Any:
|
|
1744
1744
|
"""Starts an image export task running.
|
|
1745
1745
|
|
|
1746
1746
|
This is a low-level method. The higher-level ee.batch.Export.image object
|
|
@@ -1767,7 +1767,7 @@ def exportImage(request_id: str, params: Dict[str, Any]) -> Any:
|
|
|
1767
1767
|
)
|
|
1768
1768
|
|
|
1769
1769
|
|
|
1770
|
-
def exportTable(request_id: str, params:
|
|
1770
|
+
def exportTable(request_id: str, params: dict[str, Any]) -> Any:
|
|
1771
1771
|
"""Starts a table export task running.
|
|
1772
1772
|
|
|
1773
1773
|
This is a low-level method. The higher-level ee.batch.Export.table object
|
|
@@ -1794,7 +1794,7 @@ def exportTable(request_id: str, params: Dict[str, Any]) -> Any:
|
|
|
1794
1794
|
)
|
|
1795
1795
|
|
|
1796
1796
|
|
|
1797
|
-
def exportVideo(request_id: str, params:
|
|
1797
|
+
def exportVideo(request_id: str, params: dict[str, Any]) -> Any:
|
|
1798
1798
|
"""Starts a video export task running.
|
|
1799
1799
|
|
|
1800
1800
|
This is a low-level method. The higher-level ee.batch.Export.video object
|
|
@@ -1821,7 +1821,7 @@ def exportVideo(request_id: str, params: Dict[str, Any]) -> Any:
|
|
|
1821
1821
|
)
|
|
1822
1822
|
|
|
1823
1823
|
|
|
1824
|
-
def exportMap(request_id: str, params:
|
|
1824
|
+
def exportMap(request_id: str, params: dict[str, Any]) -> Any:
|
|
1825
1825
|
"""Starts a map export task running.
|
|
1826
1826
|
|
|
1827
1827
|
This is a low-level method. The higher-level ee.batch.Export.map object
|
|
@@ -1848,7 +1848,7 @@ def exportMap(request_id: str, params: Dict[str, Any]) -> Any:
|
|
|
1848
1848
|
)
|
|
1849
1849
|
|
|
1850
1850
|
|
|
1851
|
-
def exportClassifier(request_id: str, params:
|
|
1851
|
+
def exportClassifier(request_id: str, params: dict[str, Any]) -> Any:
|
|
1852
1852
|
"""Starts a classifier export task.
|
|
1853
1853
|
|
|
1854
1854
|
This is a low-level method. The higher-level ee.batch.Export.classifier
|
|
@@ -1876,7 +1876,7 @@ def exportClassifier(request_id: str, params: Dict[str, Any]) -> Any:
|
|
|
1876
1876
|
|
|
1877
1877
|
|
|
1878
1878
|
def _prepare_and_run_export(
|
|
1879
|
-
request_id: str, params:
|
|
1879
|
+
request_id: str, params: dict[str, Any], export_endpoint: Any
|
|
1880
1880
|
) -> Any:
|
|
1881
1881
|
"""Starts an export task running.
|
|
1882
1882
|
|
|
@@ -1917,10 +1917,10 @@ _EXTERNAL_IMPORT = 'EXTERNAL_IMPORT'
|
|
|
1917
1917
|
|
|
1918
1918
|
def _startIngestion(
|
|
1919
1919
|
request_id: Any,
|
|
1920
|
-
params:
|
|
1920
|
+
params: dict[str, Any],
|
|
1921
1921
|
allow_overwrite: bool = False,
|
|
1922
1922
|
import_mode: Optional[str] = _INTERNAL_IMPORT,
|
|
1923
|
-
) ->
|
|
1923
|
+
) -> dict[str, Any]:
|
|
1924
1924
|
"""Starts an ingestion task or creates an external image."""
|
|
1925
1925
|
request = {
|
|
1926
1926
|
'imageManifest':
|
|
@@ -1964,9 +1964,9 @@ def _startIngestion(
|
|
|
1964
1964
|
|
|
1965
1965
|
def startIngestion(
|
|
1966
1966
|
request_id: Any,
|
|
1967
|
-
params:
|
|
1967
|
+
params: dict[str, Any],
|
|
1968
1968
|
allow_overwrite: bool = False,
|
|
1969
|
-
) ->
|
|
1969
|
+
) -> dict[str, Any]:
|
|
1970
1970
|
"""Creates an image asset import task.
|
|
1971
1971
|
|
|
1972
1972
|
Args:
|
|
@@ -2001,9 +2001,9 @@ def startIngestion(
|
|
|
2001
2001
|
|
|
2002
2002
|
|
|
2003
2003
|
def startExternalImageIngestion(
|
|
2004
|
-
image_manifest:
|
|
2004
|
+
image_manifest: dict[str, Any],
|
|
2005
2005
|
allow_overwrite: bool = False,
|
|
2006
|
-
) ->
|
|
2006
|
+
) -> dict[str, Any]:
|
|
2007
2007
|
"""Creates an external image.
|
|
2008
2008
|
|
|
2009
2009
|
Args:
|
|
@@ -2033,8 +2033,8 @@ def startExternalImageIngestion(
|
|
|
2033
2033
|
|
|
2034
2034
|
|
|
2035
2035
|
def startTableIngestion(
|
|
2036
|
-
request_id: str, params:
|
|
2037
|
-
) ->
|
|
2036
|
+
request_id: str, params: dict[str, Any], allow_overwrite: bool = False
|
|
2037
|
+
) -> dict[str, Any]:
|
|
2038
2038
|
"""Creates a table asset import task.
|
|
2039
2039
|
|
|
2040
2040
|
Args:
|
|
@@ -2103,7 +2103,7 @@ def getAssetRoots() -> Any:
|
|
|
2103
2103
|
listBuckets())
|
|
2104
2104
|
|
|
2105
2105
|
|
|
2106
|
-
def getAssetRootQuota(rootId: str) ->
|
|
2106
|
+
def getAssetRootQuota(rootId: str) -> dict[str, Any]:
|
|
2107
2107
|
"""Returns quota usage details for the asset root with the given ID.
|
|
2108
2108
|
|
|
2109
2109
|
Usage notes:
|
|
@@ -2179,7 +2179,7 @@ def getIamPolicy(asset_id: str) -> Any:
|
|
|
2179
2179
|
|
|
2180
2180
|
|
|
2181
2181
|
@deprecation.Deprecated('Use setIamPolicy')
|
|
2182
|
-
def setAssetAcl(assetId: str, aclUpdate: Union[str,
|
|
2182
|
+
def setAssetAcl(assetId: str, aclUpdate: Union[str, dict[str, Any]]) -> None:
|
|
2183
2183
|
"""Sets the access control list of the asset with the given ID.
|
|
2184
2184
|
|
|
2185
2185
|
The owner ACL cannot be changed, and the final ACL of the asset
|
|
@@ -2215,7 +2215,7 @@ def setIamPolicy(asset_id: str, policy: Any) -> None:
|
|
|
2215
2215
|
)
|
|
2216
2216
|
|
|
2217
2217
|
@deprecation.Deprecated('Use ee.data.updateAsset().')
|
|
2218
|
-
def setAssetProperties(assetId: str, properties:
|
|
2218
|
+
def setAssetProperties(assetId: str, properties: dict[str, Any]) -> None:
|
|
2219
2219
|
"""Sets metadata properties of the asset with the given ID.
|
|
2220
2220
|
|
|
2221
2221
|
To delete a property, set its value to None.
|
|
@@ -2280,7 +2280,7 @@ def _get_config_path() -> str:
|
|
|
2280
2280
|
return f'{_get_projects_path()}/config'
|
|
2281
2281
|
|
|
2282
2282
|
|
|
2283
|
-
def getProjectConfig() ->
|
|
2283
|
+
def getProjectConfig() -> dict[str, Any]:
|
|
2284
2284
|
"""Gets the project config for the current project.
|
|
2285
2285
|
|
|
2286
2286
|
Returns:
|
|
@@ -2292,8 +2292,8 @@ def getProjectConfig() -> Dict[str, Any]:
|
|
|
2292
2292
|
|
|
2293
2293
|
|
|
2294
2294
|
def updateProjectConfig(
|
|
2295
|
-
project_config:
|
|
2296
|
-
) ->
|
|
2295
|
+
project_config: dict[str, Any], update_mask: Optional[Sequence[str]] = None
|
|
2296
|
+
) -> dict[str, Any]:
|
|
2297
2297
|
"""Updates the project config for the current project.
|
|
2298
2298
|
|
|
2299
2299
|
Args:
|
ee/daterange.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""A wrapper for DateRanges."""
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
|
-
from typing import Any,
|
|
4
|
+
from typing import Any, Optional, Union
|
|
5
5
|
|
|
6
6
|
from ee import _arg_types
|
|
7
7
|
from ee import apifunction
|
|
@@ -58,7 +58,7 @@ class DateRange(computedobject.ComputedObject):
|
|
|
58
58
|
super().__init__(start.func, start.args, start.varName)
|
|
59
59
|
return
|
|
60
60
|
|
|
61
|
-
args:
|
|
61
|
+
args: dict[str, Any] = {'start': start}
|
|
62
62
|
if end is not None:
|
|
63
63
|
args['end'] = end
|
|
64
64
|
if timeZone is not None:
|
ee/deprecation.py
CHANGED
|
@@ -7,7 +7,7 @@ import datetime
|
|
|
7
7
|
import functools
|
|
8
8
|
import inspect
|
|
9
9
|
import json
|
|
10
|
-
from typing import Any, Callable,
|
|
10
|
+
from typing import Any, Callable, Optional
|
|
11
11
|
import urllib
|
|
12
12
|
import warnings
|
|
13
13
|
|
|
@@ -15,7 +15,7 @@ _DEPRECATED_OBJECT = 'earthengine-stac/catalog/catalog_deprecated.json'
|
|
|
15
15
|
_DEPRECATED_ASSETS_URL = f'https://storage.googleapis.com/{_DEPRECATED_OBJECT}'
|
|
16
16
|
|
|
17
17
|
# Deprecation warnings are per-asset, per-initialization.
|
|
18
|
-
deprecated_assets:
|
|
18
|
+
deprecated_assets: dict[str, DeprecatedAsset] = None
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
def Deprecated(message: str):
|
|
@@ -83,7 +83,7 @@ class DeprecatedAsset:
|
|
|
83
83
|
return None
|
|
84
84
|
|
|
85
85
|
@classmethod
|
|
86
|
-
def FromStacLink(cls, stac_link:
|
|
86
|
+
def FromStacLink(cls, stac_link: dict[str, Any]) -> DeprecatedAsset:
|
|
87
87
|
removal_date = stac_link.get('gee:removal_date')
|
|
88
88
|
if removal_date is not None:
|
|
89
89
|
removal_date = cls._ParseDateString(removal_date)
|
|
@@ -156,7 +156,7 @@ def Reset() -> None:
|
|
|
156
156
|
deprecated_assets = None
|
|
157
157
|
|
|
158
158
|
|
|
159
|
-
def _FetchDataCatalogStac() ->
|
|
159
|
+
def _FetchDataCatalogStac() -> dict[str, Any]:
|
|
160
160
|
try:
|
|
161
161
|
response = urllib.request.urlopen(_DEPRECATED_ASSETS_URL).read()
|
|
162
162
|
except (urllib.error.HTTPError, urllib.error.URLError):
|
ee/dictionary.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""A wrapper for dictionaries."""
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
|
-
from typing import Any,
|
|
4
|
+
from typing import Any, Optional, Union
|
|
5
5
|
|
|
6
6
|
from ee import _arg_types
|
|
7
7
|
from ee import _utils
|
|
@@ -26,7 +26,7 @@ _StringListType = Union[Any, computedobject.ComputedObject]
|
|
|
26
26
|
class Dictionary(computedobject.ComputedObject):
|
|
27
27
|
"""An object to represent dictionaries."""
|
|
28
28
|
|
|
29
|
-
_dictionary: Optional[
|
|
29
|
+
_dictionary: Optional[dict[Any, Any]]
|
|
30
30
|
|
|
31
31
|
_initialized = False
|
|
32
32
|
|
ee/ee_array.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""A wrapper for Arrays."""
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
|
-
from typing import Any,
|
|
4
|
+
from typing import Any, Optional
|
|
5
5
|
|
|
6
6
|
from ee import _arg_types
|
|
7
7
|
from ee import apifunction
|
|
@@ -60,7 +60,7 @@ class Array(computedobject.ComputedObject):
|
|
|
60
60
|
super().__init__(values.func, values.args, values.varName)
|
|
61
61
|
return
|
|
62
62
|
|
|
63
|
-
args:
|
|
63
|
+
args: dict[str, Any] = {'values': values}
|
|
64
64
|
if pixelType is not None:
|
|
65
65
|
args['pixelType'] = pixelType
|
|
66
66
|
|
ee/ee_date.py
CHANGED
|
@@ -3,7 +3,7 @@ from __future__ import annotations
|
|
|
3
3
|
|
|
4
4
|
import datetime
|
|
5
5
|
import math
|
|
6
|
-
from typing import Any,
|
|
6
|
+
from typing import Any, Optional, Union
|
|
7
7
|
|
|
8
8
|
from ee import _arg_types
|
|
9
9
|
from ee import _utils
|
|
@@ -50,7 +50,7 @@ class Date(computedobject.ComputedObject):
|
|
|
50
50
|
self.initialize()
|
|
51
51
|
|
|
52
52
|
func = apifunction.ApiFunction(self.name())
|
|
53
|
-
args:
|
|
53
|
+
args: dict[str, Any]
|
|
54
54
|
var_name = None
|
|
55
55
|
if isinstance(date, datetime.datetime):
|
|
56
56
|
args = {'value':
|
ee/ee_list.py
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"""A wrapper for lists."""
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
from typing import Any, List as ListType, Optional, Tuple, Union
|
|
4
|
+
from typing import Any, Optional, Union
|
|
6
5
|
|
|
7
6
|
from ee import _arg_types
|
|
8
7
|
from ee import _utils
|
|
@@ -19,7 +18,7 @@ from ee import geometry
|
|
|
19
18
|
class List(computedobject.ComputedObject):
|
|
20
19
|
"""An object to represent lists."""
|
|
21
20
|
_list: Optional[
|
|
22
|
-
Union[
|
|
21
|
+
Union[list[Any], tuple[Any, Any]]
|
|
23
22
|
]
|
|
24
23
|
|
|
25
24
|
_initialized = False
|
ee/element.py
CHANGED
|
@@ -6,7 +6,7 @@ This class is never intended to be instantiated by the user.
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
8
|
import datetime
|
|
9
|
-
from typing import Any,
|
|
9
|
+
from typing import Any, Optional, Union
|
|
10
10
|
|
|
11
11
|
from ee import _arg_types
|
|
12
12
|
from ee import _utils
|
|
@@ -30,7 +30,7 @@ class Element(computedobject.ComputedObject):
|
|
|
30
30
|
def __init__(
|
|
31
31
|
self,
|
|
32
32
|
func: Optional[apifunction.ApiFunction],
|
|
33
|
-
args: Optional[
|
|
33
|
+
args: Optional[dict[str, Any]],
|
|
34
34
|
varName: Optional[str] = None, # pylint: disable=g-bad-name
|
|
35
35
|
):
|
|
36
36
|
"""Constructs a collection by initializing its ComputedObject."""
|
|
@@ -122,7 +122,7 @@ class Element(computedobject.ComputedObject):
|
|
|
122
122
|
def set(
|
|
123
123
|
self,
|
|
124
124
|
*args: Union[
|
|
125
|
-
|
|
125
|
+
dict[str, Any],
|
|
126
126
|
float,
|
|
127
127
|
str,
|
|
128
128
|
datetime.datetime,
|
ee/errormargin.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""A wrapper for ErrorMargins."""
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
|
-
from typing import Any,
|
|
4
|
+
from typing import Any, Optional
|
|
5
5
|
|
|
6
6
|
from ee import _arg_types
|
|
7
7
|
from ee import apifunction
|
|
@@ -64,7 +64,7 @@ class ErrorMargin(computedobject.ComputedObject):
|
|
|
64
64
|
):
|
|
65
65
|
raise TypeError('value must be provided if unit is not infinite')
|
|
66
66
|
|
|
67
|
-
args:
|
|
67
|
+
args: dict[str, Any] = {}
|
|
68
68
|
if value is not None:
|
|
69
69
|
args['value'] = value
|
|
70
70
|
if unit is not None:
|
ee/feature.py
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"""An object representing EE Features."""
|
|
2
2
|
from __future__ import annotations
|
|
3
3
|
|
|
4
|
-
from typing import Any,
|
|
4
|
+
from typing import Any, Optional, Union
|
|
5
5
|
|
|
6
6
|
from ee import _arg_types
|
|
7
7
|
from ee import _utils
|
|
@@ -32,12 +32,12 @@ class Feature(element.Element):
|
|
|
32
32
|
Union[
|
|
33
33
|
Feature,
|
|
34
34
|
geometry.Geometry,
|
|
35
|
-
|
|
35
|
+
dict[str, Any],
|
|
36
36
|
computedobject.ComputedObject,
|
|
37
37
|
]
|
|
38
38
|
],
|
|
39
39
|
properties: Optional[
|
|
40
|
-
Union[
|
|
40
|
+
Union[dict[str, Any], computedobject.ComputedObject]
|
|
41
41
|
] = None,
|
|
42
42
|
):
|
|
43
43
|
"""Creates a feature a geometry or computed object.
|
|
@@ -113,8 +113,8 @@ class Feature(element.Element):
|
|
|
113
113
|
cls._initialized = False
|
|
114
114
|
|
|
115
115
|
def getMapId(
|
|
116
|
-
self, vis_params: Optional[
|
|
117
|
-
) ->
|
|
116
|
+
self, vis_params: Optional[dict[str, Any]] = None
|
|
117
|
+
) -> dict[str, Any]:
|
|
118
118
|
"""Fetch and return a map id and token, suitable for use in a Map overlay.
|
|
119
119
|
|
|
120
120
|
Args:
|
ee/featurecollection.py
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
|
|
6
6
|
from __future__ import annotations
|
|
7
7
|
|
|
8
|
-
from typing import Any,
|
|
8
|
+
from typing import Any, Optional, Type, Union
|
|
9
9
|
|
|
10
10
|
from ee import _arg_types
|
|
11
11
|
from ee import _utils
|
|
@@ -36,8 +36,8 @@ class FeatureCollection(collection.Collection):
|
|
|
36
36
|
self,
|
|
37
37
|
args: Optional[
|
|
38
38
|
Union[
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
dict[str, Any],
|
|
40
|
+
list[Any],
|
|
41
41
|
str,
|
|
42
42
|
feature.Feature,
|
|
43
43
|
geometry.Geometry,
|
|
@@ -116,8 +116,8 @@ class FeatureCollection(collection.Collection):
|
|
|
116
116
|
cls._initialized = False
|
|
117
117
|
|
|
118
118
|
def getMapId(
|
|
119
|
-
self, vis_params: Optional[
|
|
120
|
-
) ->
|
|
119
|
+
self, vis_params: Optional[dict[str, Any]] = None
|
|
120
|
+
) -> dict[str, Any]:
|
|
121
121
|
"""Fetch and return a map id and token, suitable for use in a Map overlay.
|
|
122
122
|
|
|
123
123
|
Args:
|