earthengine-api 1.6.15rc0__tar.gz → 1.7.0rc0__tar.gz

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.

Files changed (115) hide show
  1. {earthengine_api-1.6.15rc0/earthengine_api.egg-info → earthengine_api-1.7.0rc0}/PKG-INFO +2 -3
  2. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0/earthengine_api.egg-info}/PKG-INFO +2 -3
  3. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/__init__.py +13 -13
  4. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/_cloud_api_utils.py +29 -28
  5. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/_helpers.py +6 -6
  6. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/_utils.py +2 -1
  7. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/apitestcase.py +10 -10
  8. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/cli/commands.py +2 -2
  9. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/cli/utils.py +2 -2
  10. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/collection.py +3 -2
  11. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/computedobject.py +4 -1
  12. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/customfunction.py +2 -1
  13. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/data.py +31 -31
  14. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/deprecation.py +3 -2
  15. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/deserializer.py +4 -4
  16. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/ee_number.py +6 -16
  17. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/encodable.py +2 -1
  18. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/image_converter.py +3 -3
  19. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/imagecollection.py +2 -2
  20. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/model.py +29 -31
  21. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/oauth.py +35 -35
  22. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/serializer.py +6 -6
  23. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/table_converter.py +3 -3
  24. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/batch_test.py +3 -3
  25. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/collection_test.py +35 -0
  26. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/data_test.py +5 -3
  27. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/ee_number_test.py +40 -1
  28. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/image_converter_test.py +1 -3
  29. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/serializer_test.py +3 -2
  30. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/table_converter_test.py +2 -2
  31. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/pyproject.toml +2 -3
  32. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/LICENSE +0 -0
  33. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/MANIFEST.in +0 -0
  34. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/README.md +0 -0
  35. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/earthengine_api.egg-info/SOURCES.txt +0 -0
  36. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/earthengine_api.egg-info/dependency_links.txt +0 -0
  37. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/earthengine_api.egg-info/entry_points.txt +0 -0
  38. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/earthengine_api.egg-info/requires.txt +0 -0
  39. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/earthengine_api.egg-info/top_level.txt +0 -0
  40. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/_arg_types.py +0 -0
  41. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/_state.py +0 -0
  42. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/apifunction.py +0 -0
  43. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/batch.py +0 -0
  44. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/blob.py +0 -0
  45. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/classifier.py +0 -0
  46. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/cli/__init__.py +0 -0
  47. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/cli/eecli.py +0 -0
  48. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/cli/eecli_wrapper.py +0 -0
  49. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/clusterer.py +0 -0
  50. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/confusionmatrix.py +0 -0
  51. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/daterange.py +0 -0
  52. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/dictionary.py +0 -0
  53. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/ee_array.py +0 -0
  54. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/ee_date.py +0 -0
  55. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/ee_exception.py +0 -0
  56. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/ee_list.py +0 -0
  57. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/ee_string.py +0 -0
  58. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/ee_types.py +0 -0
  59. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/element.py +0 -0
  60. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/errormargin.py +0 -0
  61. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/feature.py +0 -0
  62. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/featurecollection.py +0 -0
  63. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/filter.py +0 -0
  64. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/function.py +0 -0
  65. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/geometry.py +0 -0
  66. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/image.py +0 -0
  67. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/join.py +0 -0
  68. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/kernel.py +0 -0
  69. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/mapclient.py +0 -0
  70. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/pixeltype.py +0 -0
  71. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/projection.py +0 -0
  72. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/py.typed +0 -0
  73. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/reducer.py +0 -0
  74. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/terrain.py +0 -0
  75. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/_cloud_api_utils_test.py +0 -0
  76. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/_helpers_test.py +0 -0
  77. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/_state_test.py +0 -0
  78. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/_utils_test.py +0 -0
  79. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/algorithms.json +0 -0
  80. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/apifunction_test.py +0 -0
  81. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/blob_test.py +0 -0
  82. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/classifier_test.py +0 -0
  83. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/cloud_api_discovery_document.json +0 -0
  84. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/clusterer_test.py +0 -0
  85. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/computedobject_test.py +0 -0
  86. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/confusionmatrix_test.py +0 -0
  87. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/daterange_test.py +0 -0
  88. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/deprecation_test.py +0 -0
  89. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/deserializer_test.py +0 -0
  90. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/dictionary_test.py +0 -0
  91. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/ee_array_test.py +0 -0
  92. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/ee_date_test.py +0 -0
  93. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/ee_list_test.py +0 -0
  94. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/ee_string_test.py +0 -0
  95. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/ee_test.py +0 -0
  96. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/ee_types_test.py +0 -0
  97. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/element_test.py +0 -0
  98. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/errormargin_test.py +0 -0
  99. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/feature_test.py +0 -0
  100. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/featurecollection_test.py +0 -0
  101. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/filter_test.py +0 -0
  102. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/function_test.py +0 -0
  103. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/geometry_point_test.py +0 -0
  104. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/geometry_test.py +0 -0
  105. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/image_test.py +0 -0
  106. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/imagecollection_test.py +0 -0
  107. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/join_test.py +0 -0
  108. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/kernel_test.py +0 -0
  109. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/model_test.py +0 -0
  110. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/oauth_test.py +0 -0
  111. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/pixeltype_test.py +0 -0
  112. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/projection_test.py +0 -0
  113. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/reducer_test.py +0 -0
  114. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/ee/tests/terrain_test.py +0 -0
  115. {earthengine_api-1.6.15rc0 → earthengine_api-1.7.0rc0}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: earthengine-api
3
- Version: 1.6.15rc0
3
+ Version: 1.7.0rc0
4
4
  Summary: Earth Engine Python API
5
5
  Author-email: Google LLC <noreply@google.com>
6
6
  License: Apache-2.0
@@ -13,7 +13,6 @@ Classifier: License :: OSI Approved :: Apache Software License
13
13
  Classifier: Operating System :: OS Independent
14
14
  Classifier: Programming Language :: Python :: 3 :: Only
15
15
  Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.9
17
16
  Classifier: Programming Language :: Python :: 3.10
18
17
  Classifier: Programming Language :: Python :: 3.11
19
18
  Classifier: Programming Language :: Python :: 3.12
@@ -24,7 +23,7 @@ Classifier: Topic :: Scientific/Engineering :: GIS
24
23
  Classifier: Topic :: Scientific/Engineering :: Image Processing
25
24
  Classifier: Topic :: Scientific/Engineering :: Visualization
26
25
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
27
- Requires-Python: >=3.9
26
+ Requires-Python: >=3.10
28
27
  Description-Content-Type: text/markdown
29
28
  License-File: LICENSE
30
29
  Requires-Dist: google-cloud-storage
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: earthengine-api
3
- Version: 1.6.15rc0
3
+ Version: 1.7.0rc0
4
4
  Summary: Earth Engine Python API
5
5
  Author-email: Google LLC <noreply@google.com>
6
6
  License: Apache-2.0
@@ -13,7 +13,6 @@ Classifier: License :: OSI Approved :: Apache Software License
13
13
  Classifier: Operating System :: OS Independent
14
14
  Classifier: Programming Language :: Python :: 3 :: Only
15
15
  Classifier: Programming Language :: Python :: 3
16
- Classifier: Programming Language :: Python :: 3.9
17
16
  Classifier: Programming Language :: Python :: 3.10
18
17
  Classifier: Programming Language :: Python :: 3.11
19
18
  Classifier: Programming Language :: Python :: 3.12
@@ -24,7 +23,7 @@ Classifier: Topic :: Scientific/Engineering :: GIS
24
23
  Classifier: Topic :: Scientific/Engineering :: Image Processing
25
24
  Classifier: Topic :: Scientific/Engineering :: Visualization
26
25
  Classifier: Topic :: Software Development :: Libraries :: Python Modules
27
- Requires-Python: >=3.9
26
+ Requires-Python: >=3.10
28
27
  Description-Content-Type: text/markdown
29
28
  License-File: LICENSE
30
29
  Requires-Dist: google-cloud-storage
@@ -1,6 +1,6 @@
1
1
  """The EE Python library."""
2
2
 
3
- __version__ = '1.6.15rc0'
3
+ __version__ = '1.7.0rc0'
4
4
 
5
5
  # Using lowercase function naming to match the JavaScript names.
6
6
  # pylint: disable=g-bad-name
@@ -126,13 +126,13 @@ _DYNAMIC_CLASSES = [
126
126
 
127
127
 
128
128
  def Authenticate(
129
- authorization_code: Optional[str] = None,
130
- quiet: Optional[bool] = None,
131
- code_verifier: Optional[str] = None,
132
- auth_mode: Optional[str] = None,
133
- scopes: Optional[Sequence[str]] = None,
129
+ authorization_code: str | None = None,
130
+ quiet: bool | None = None,
131
+ code_verifier: str | None = None,
132
+ auth_mode: str | None = None,
133
+ scopes: Sequence[str] | None = None,
134
134
  force: bool = False,
135
- ) -> Optional[bool]:
135
+ ) -> bool | None:
136
136
  """Prompts the user to authorize access to Earth Engine via OAuth2.
137
137
 
138
138
  Args:
@@ -162,11 +162,11 @@ def Authenticate(
162
162
 
163
163
  @_utils.accept_opt_prefix('opt_url')
164
164
  def Initialize(
165
- credentials: Optional[Any] = 'persistent',
166
- url: Optional[str] = None,
167
- cloud_api_key: Optional[str] = None,
168
- http_transport: Optional[Any] = None,
169
- project: Optional[Union[str, int]] = None,
165
+ credentials: Any | None = 'persistent',
166
+ url: str | None = None,
167
+ cloud_api_key: str | None = None,
168
+ http_transport: Any | None = None,
169
+ project: str | int | None = None,
170
170
  ) -> None:
171
171
  """Initialize the EE library.
172
172
 
@@ -274,7 +274,7 @@ def _ResetGeneratedClasses() -> None:
274
274
  types._registerClasses(globals()) # pylint: disable=protected-access
275
275
 
276
276
 
277
- def _Promote(arg: Optional[Any], a_class: str) -> Optional[Any]:
277
+ def _Promote(arg: Any | None, a_class: str) -> Any | None:
278
278
  """Wrap an argument in an object of the specified class.
279
279
 
280
280
  This is used to, e.g., promote numbers or strings to Images and arrays
@@ -6,13 +6,13 @@ parameters and result values.
6
6
  """
7
7
 
8
8
  import calendar
9
- from collections.abc import Sequence
9
+ from collections.abc import Callable, Sequence
10
10
  import copy
11
11
  import datetime
12
12
  import json
13
13
  import os
14
14
  import re
15
- from typing import Any, Callable, Optional, Type, Union
15
+ from typing import Any
16
16
  import warnings
17
17
 
18
18
  import google_auth_httplib2
@@ -24,6 +24,7 @@ import requests
24
24
 
25
25
  from ee import ee_exception
26
26
 
27
+
27
28
  # The Cloud API version.
28
29
  VERSION = os.environ.get('EE_CLOUD_API_VERSION', 'v1')
29
30
 
@@ -49,10 +50,10 @@ TASK_TO_OPERATION_STATE = {
49
50
  class _Http:
50
51
  """A httplib2.Http-like object based on requests."""
51
52
  _session: requests.Session
52
- _timeout: Optional[float]
53
+ _timeout: float | None
53
54
 
54
55
  def __init__(
55
- self, session: requests.Session, timeout: Optional[float] = None
56
+ self, session: requests.Session, timeout: float | None = None
56
57
  ):
57
58
  self._timeout = timeout
58
59
  self._session = session
@@ -61,10 +62,10 @@ class _Http:
61
62
  self,
62
63
  uri: str,
63
64
  method: str = 'GET',
64
- body: Optional[str] = None,
65
- headers: Optional[dict[str, str]] = None,
66
- redirections: Optional[int] = None,
67
- connection_type: Optional[type[Any]] = None,
65
+ body: str | None = None,
66
+ headers: dict[str, str] | None = None,
67
+ redirections: int | None = None,
68
+ connection_type: type[Any] | None = None,
68
69
  ) -> tuple[httplib2.Response, Any]:
69
70
  """Makes an HTTP request using httplib2 semantics."""
70
71
  del connection_type # Ignored
@@ -117,10 +118,10 @@ def _wrap_request(
117
118
  postproc: Callable[..., Any],
118
119
  uri: str,
119
120
  method: str = 'GET',
120
- body: Optional[Any] = None,
121
- headers: Optional[Any] = None,
122
- methodId: Optional[Any] = None,
123
- resumable: Optional[Any] = None,
121
+ body: Any | None = None,
122
+ headers: Any | None = None,
123
+ methodId: Any | None = None,
124
+ resumable: Any | None = None,
124
125
  ) -> http.HttpRequest:
125
126
  """Builds an HttpRequest, adding headers and response inspection."""
126
127
  additional_headers = headers_supplier()
@@ -146,14 +147,14 @@ def _wrap_request(
146
147
  def build_cloud_resource(
147
148
  api_base_url: str,
148
149
  session: requests.Session,
149
- api_key: Optional[str] = None,
150
- credentials: Optional[Any] = None,
151
- timeout: Optional[float] = None,
150
+ api_key: str | None = None,
151
+ credentials: Any | None = None,
152
+ timeout: float | None = None,
152
153
  num_retries: int = 1,
153
- headers_supplier: Optional[Callable[[], dict[str, Any]]] = None,
154
- response_inspector: Optional[Callable[[Any], None]] = None,
155
- http_transport: Optional[Any] = None,
156
- raw: Optional[bool] = False,
154
+ headers_supplier: Callable[[], dict[str, Any]] | None = None,
155
+ response_inspector: Callable[[Any], None] | None = None,
156
+ http_transport: Any | None = None,
157
+ raw: bool | None = False,
157
158
  ) -> Any:
158
159
  """Builds an Earth Engine Cloud API resource.
159
160
 
@@ -225,9 +226,9 @@ def build_cloud_resource(
225
226
 
226
227
  def build_cloud_resource_from_document(
227
228
  discovery_document: Any,
228
- http_transport: Optional[httplib2.Http] = None,
229
- headers_supplier: Optional[Callable[..., Any]] = None,
230
- response_inspector: Optional[Callable[..., Any]] = None,
229
+ http_transport: httplib2.Http | None = None,
230
+ headers_supplier: Callable[..., Any] | None = None,
231
+ response_inspector: Callable[..., Any] | None = None,
231
232
  raw: bool = False,
232
233
  ) -> discovery.Resource:
233
234
  """Builds an Earth Engine Cloud API resource from a description of the API.
@@ -261,7 +262,7 @@ def build_cloud_resource_from_document(
261
262
  def _convert_dict(
262
263
  to_convert: dict[str, Any],
263
264
  conversions: dict[str, Any],
264
- defaults: Optional[dict[str, Any]] = None,
265
+ defaults: dict[str, Any] | None = None,
265
266
  key_warnings: bool = False,
266
267
  retain_keys: bool = False,
267
268
  ) -> dict[str, Any]:
@@ -618,7 +619,7 @@ def convert_sources_to_one_platform_sources(sources: list[Any]) -> list[Any]:
618
619
  return converted_sources
619
620
 
620
621
 
621
- def encode_number_as_cloud_value(number: float) -> dict[str, Union[float, str]]:
622
+ def encode_number_as_cloud_value(number: float) -> dict[str, float | str]:
622
623
  # Numeric values in constantValue-style nodes end up stored in doubles. If the
623
624
  # input is an integer that loses precision as a double, use the int64 slot
624
625
  # ("integerValue") in ValueNode.
@@ -699,7 +700,7 @@ def _convert_algorithm_argument(arg: dict[str, Any]) -> dict[str, Any]:
699
700
  })
700
701
 
701
702
 
702
- def convert_to_image_file_format(format_str: Optional[str]) -> str:
703
+ def convert_to_image_file_format(format_str: str | None) -> str:
703
704
  """Converts a legacy file format string to an ImageFileFormat enum value.
704
705
 
705
706
  Args:
@@ -726,7 +727,7 @@ def convert_to_image_file_format(format_str: Optional[str]) -> str:
726
727
  return format_str
727
728
 
728
729
 
729
- def convert_to_table_file_format(format_str: Optional[str]) -> str:
730
+ def convert_to_table_file_format(format_str: str | None) -> str:
730
731
  """Converts a legacy file format string to a TableFileFormat enum value.
731
732
 
732
733
  Args:
@@ -749,7 +750,7 @@ def convert_to_table_file_format(format_str: Optional[str]) -> str:
749
750
  return format_str
750
751
 
751
752
 
752
- def convert_to_band_list(bands: Union[list[str], None, str]) -> list[str]:
753
+ def convert_to_band_list(bands: list[str] | None | str) -> list[str]:
753
754
  """Converts a band list, possibly as CSV, to a real list of bands.
754
755
 
755
756
  Args:
@@ -926,7 +927,7 @@ def convert_acl_to_iam_policy(acl: dict[str, Any]) -> dict[str, Any]:
926
927
 
927
928
 
928
929
  def convert_to_grid_dimensions(
929
- dimensions: Union[float, Sequence[float]]
930
+ dimensions: float | Sequence[float]
930
931
  ) -> dict[str, float]:
931
932
  """Converts an input value to GridDimensions.
932
933
 
@@ -11,7 +11,7 @@ from collections.abc import Iterator
11
11
  import contextlib
12
12
  import json
13
13
  import sys
14
- from typing import Any, Optional, TextIO, Union
14
+ from typing import Any, TextIO
15
15
 
16
16
  from google.auth import crypt
17
17
  from google.oauth2 import service_account
@@ -27,9 +27,9 @@ _PROFILE_RETRIES = 5
27
27
 
28
28
 
29
29
  def ServiceAccountCredentials(
30
- email: Optional[str] = None,
31
- key_file: Optional[str] = None,
32
- key_data: Optional[str] = None,
30
+ email: str | None = None,
31
+ key_file: str | None = None,
32
+ key_data: str | None = None,
33
33
  ) -> service_account.Credentials:
34
34
  """Configure OAuth2 credentials for a Google Service Account.
35
35
 
@@ -75,7 +75,7 @@ def ServiceAccountCredentials(
75
75
 
76
76
 
77
77
  def call(
78
- func: Union[str, apifunction.ApiFunction], *args, **kwargs
78
+ func: str | apifunction.ApiFunction, *args, **kwargs
79
79
  ) -> computedobject.ComputedObject:
80
80
  """Invoke the given algorithm with the specified args.
81
81
 
@@ -97,7 +97,7 @@ def call(
97
97
 
98
98
  # pylint: disable-next=redefined-builtin
99
99
  def apply(
100
- func: Union[str, apifunction.ApiFunction], named_args: dict[str, Any]
100
+ func: str | apifunction.ApiFunction, named_args: dict[str, Any]
101
101
  ) -> computedobject.ComputedObject:
102
102
  """Call a function with a dictionary of named arguments.
103
103
 
@@ -1,7 +1,8 @@
1
1
  """General decorators and helper methods which should not import ee."""
2
2
 
3
3
  import functools
4
- from typing import Any, Callable
4
+ from typing import Any
5
+ from collections.abc import Callable
5
6
 
6
7
 
7
8
  def accept_opt_prefix(*opt_args) -> Callable[..., Any]:
@@ -5,7 +5,7 @@ import contextlib
5
5
  import copy
6
6
  import json
7
7
  import os
8
- from typing import Any, Optional
8
+ from typing import Any
9
9
 
10
10
  from googleapiclient import discovery
11
11
 
@@ -16,7 +16,7 @@ from ee import _state
16
16
 
17
17
 
18
18
  # Cached algorithms list
19
- _algorithms_cache: Optional[dict[str, Any]] = None
19
+ _algorithms_cache: dict[str, Any] | None = None
20
20
 
21
21
 
22
22
  def GetAlgorithms() -> dict[str, Any]:
@@ -40,10 +40,10 @@ def GetAlgorithms() -> dict[str, Any]:
40
40
 
41
41
  class ApiTestCase(unittest.TestCase):
42
42
  """A TestCase that initializes the library with standard API methods."""
43
- last_download_call: Optional[Any]
44
- last_thumb_call: Optional[Any]
45
- last_table_call: Optional[Any]
46
- last_mapid_call: Optional[Any]
43
+ last_download_call: Any | None
44
+ last_thumb_call: Any | None
45
+ last_table_call: Any | None
46
+ last_mapid_call: Any | None
47
47
 
48
48
  def setUp(self):
49
49
  super().setUp()
@@ -108,7 +108,7 @@ class ApiTestCase(unittest.TestCase):
108
108
  self,
109
109
  params: dict[str, Any],
110
110
  # pylint: disable-next=invalid-name
111
- thumbType: Optional[str] = None,
111
+ thumbType: str | None = None,
112
112
  ) -> dict[str, str]:
113
113
  del thumbType # Unused.
114
114
  # Hang on to the call arguments.
@@ -141,9 +141,9 @@ def _GenerateCloudApiResource(mock_http: Any, raw: Any) -> discovery.Resource:
141
141
 
142
142
  @contextlib.contextmanager # pytype: disable=wrong-arg-types
143
143
  def UsingCloudApi(
144
- cloud_api_resource: Optional[Any] = None,
145
- cloud_api_resource_raw: Optional[Any] = None,
146
- mock_http: Optional[Any] = None,
144
+ cloud_api_resource: Any | None = None,
145
+ cloud_api_resource_raw: Any | None = None,
146
+ mock_http: Any | None = None,
147
147
  ) -> Iterable[Any]: # pytype: disable=wrong-arg-types
148
148
  """Returns a context manager under which the Cloud API is enabled."""
149
149
  # pylint: disable=protected-access
@@ -226,7 +226,7 @@ def _format_cloud_timestamp(timestamp: str | None) -> str:
226
226
  return _datetime_from_cloud_timestamp(timestamp).strftime('%Y-%m-%d %H:%M:%S')
227
227
 
228
228
 
229
- def _decode_date(string: str) -> Union[float, str]:
229
+ def _decode_date(string: str) -> float | str:
230
230
  """Decodes a date from a command line argument, returning msec since epoch".
231
231
 
232
232
  Args:
@@ -598,7 +598,7 @@ class AclChCommand:
598
598
  return permissions
599
599
 
600
600
  def _apply_permissions(
601
- self, acl: dict[str, Union[bool, list[str]]], permissions: dict[str, str]
601
+ self, acl: dict[str, bool | list[str]], permissions: dict[str, str]
602
602
  ) -> None:
603
603
  """Applies the given permission edits to the given acl."""
604
604
  for user, role in permissions.items():
@@ -14,7 +14,7 @@ import re
14
14
  import tempfile
15
15
  import threading
16
16
  import time
17
- from typing import Any, AnyStr, Optional, Union
17
+ from typing import Any, AnyStr
18
18
  import urllib.parse
19
19
 
20
20
  from google.cloud import storage
@@ -32,7 +32,7 @@ DEFAULT_EE_CONFIG_FILE_RELATIVE = os.path.join(
32
32
  DEFAULT_EE_CONFIG_FILE = os.path.join(
33
33
  HOMEDIR, DEFAULT_EE_CONFIG_FILE_RELATIVE)
34
34
 
35
- CONFIG_PARAMS: dict[str, Union[str, list[str], None]] = {
35
+ CONFIG_PARAMS: dict[str, str | list[str] | None] = {
36
36
  'account': None,
37
37
  'cloud_api_key': None,
38
38
  'private_key': None,
@@ -5,8 +5,9 @@ This class is never intended to be instantiated by the user.
5
5
 
6
6
  from __future__ import annotations
7
7
 
8
+ from collections.abc import Callable
8
9
  import datetime
9
- from typing import Any, Callable, Generic, TypeVar
10
+ from typing import Any, Generic, TypeVar
10
11
 
11
12
  from ee import _arg_types
12
13
  from ee import _utils
@@ -204,7 +205,7 @@ class Collection(Generic[ElementType], element.Element):
204
205
 
205
206
  # pylint: disable-next=redefined-builtin
206
207
  def aggregate_product(self, property: _arg_types.String) -> ee_number.Number:
207
- """Returns the product of the values ofthe selected property.
208
+ """Returns the product of the values of the selected property.
208
209
 
209
210
  Aggregates over a given property of the objects in a collection, calculating
210
211
  the product of the values of the selected property.
@@ -2,7 +2,8 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Any, Callable
5
+ from collections.abc import Callable
6
+ from typing import Any
6
7
 
7
8
  from ee import _utils
8
9
  from ee import data
@@ -233,9 +234,11 @@ class ComputedObject(encodable.Encodable, metaclass=ComputedObjectMetaclass):
233
234
  return obj
234
235
  else:
235
236
  result = cls.__new__(cls) # pylint: disable=no-value-for-parameter
237
+ # pylint: disable=attribute-error
236
238
  result.func = obj.func
237
239
  result.args = obj.args
238
240
  result.varName = obj.varName
241
+ # pylint: enable=attribute-error
239
242
  return result
240
243
 
241
244
  @staticmethod
@@ -2,7 +2,8 @@
2
2
 
3
3
  from __future__ import annotations
4
4
 
5
- from typing import Any, Callable
5
+ from collections.abc import Callable
6
+ from typing import Any
6
7
 
7
8
  from ee import computedobject
8
9
  from ee import ee_exception