earthengine-api 1.7.2rc0__py3-none-any.whl → 1.7.3rc0__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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: earthengine-api
3
- Version: 1.7.2rc0
3
+ Version: 1.7.3rc0
4
4
  Summary: Earth Engine Python API
5
5
  Author-email: Google LLC <noreply@google.com>
6
6
  License: Apache-2.0
@@ -1,5 +1,5 @@
1
- earthengine_api-1.7.2rc0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
2
- ee/__init__.py,sha256=qXFqyr1frW_X1pYT3uUOMUT6rvGLGcCNejHvZ_g-VQI,16761
1
+ earthengine_api-1.7.3rc0.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
2
+ ee/__init__.py,sha256=Um0xlT33XUgHUDHUiG5YPWwFww-HAEnwXW3Pb8ZcMFQ,16761
3
3
  ee/_arg_types.py,sha256=nrJrnPFnAS8fzMxAGmG3TbUOi_yFVrnSGW5IP8ATzDQ,2662
4
4
  ee/_cloud_api_utils.py,sha256=5WPzP5bcBIbjA7yYN-Cwmht_HU-XobbTrZvRiOEn0e0,32890
5
5
  ee/_helpers.py,sha256=afDDqoz1WESKE-lzqLtrCbvoQ1yVpfvJIgFcmUjO4L8,4821
@@ -7,7 +7,7 @@ ee/_state.py,sha256=y2hdq_ZEgFkO9a-DbWFSthehlAyTbp--cz4C04XS058,2754
7
7
  ee/_utils.py,sha256=ciocjvlvR73G07IV_iZjLi1IGowpEbT53NzFqqwSbDU,1356
8
8
  ee/apifunction.py,sha256=mCCsLhBs_MofvMW49OFjT5psQGMbXWQSpAlhiqMEc4k,8732
9
9
  ee/apitestcase.py,sha256=8N5y2-Tw7c5GjedbSA_HRpSjVUiVLoyM_FI2g5b9Tpc,13992
10
- ee/batch.py,sha256=dETwEgh2E9bsoKcmo7MrqIKrU9OEOymDHtbifl_hMS4,82400
10
+ ee/batch.py,sha256=pyhSmwH6hApRgdA8x6qbFn-mMEM8G-zf3OHW5PMziQI,82694
11
11
  ee/blob.py,sha256=cnnqmrHl998U2zEmfKcxQglaGk14Ip6pjObk_Ody6Uk,3221
12
12
  ee/classifier.py,sha256=3STLrLT6Ddwzjs2324E02wRWM8VEpeifgOO81geTHJQ,23410
13
13
  ee/clusterer.py,sha256=986D68b2eJ4xiiOiIOTNZ1psF8Ro-MFNQFKed058FS4,12256
@@ -61,7 +61,7 @@ ee/tests/_state_test.py,sha256=AKe5Vopzt24FJPiPcEce_oOT861gOkd6mUOAWZr6C0g,1175
61
61
  ee/tests/_utils_test.py,sha256=bOarVj3U-VFo9Prog8WQN_hAOMwJOiWKJxevUbdFPBQ,2753
62
62
  ee/tests/algorithms.json,sha256=Vx1Kx_MhHv0z0B3WTeVAvchM8xVd3zYE7L-qT3gDGzA,729368
63
63
  ee/tests/apifunction_test.py,sha256=_6xpkJOd7hScYYQxzFR-8flraTQ6xfkm7gyER6JoBog,3779
64
- ee/tests/batch_test.py,sha256=xlzL4syjQ_bqeOfmj7keajTZqZqcKdUlv-X8f30O1Ow,63259
64
+ ee/tests/batch_test.py,sha256=NhR5CsNNSbuMgrmJWoc0grn7gjmlUY37oMIXCwA2T-0,65116
65
65
  ee/tests/blob_test.py,sha256=uCrM-ubRfAmNgHwhmUhWn7MiXqbNQutybcXIKdVsD_Q,3587
66
66
  ee/tests/classifier_test.py,sha256=K6-wNZ2uh9oPYo7BV0vtfU73SBFpeNcFRMRmvEFc6Pg,19087
67
67
  ee/tests/cloud_api_discovery_document.json,sha256=SnOeL8One57YdeHa7XxGZM-ptDPCeDSymBc7-Bo_hkA,41154
@@ -102,8 +102,8 @@ ee/tests/reducer_test.py,sha256=vqXpgLZ7fPyfZ12srpREgMpfrKYLcFQod3Qn1Niv7VM,3197
102
102
  ee/tests/serializer_test.py,sha256=d6IEW_dt-G900IRfQnZftrwjpc1wJ-ouaQQwaLO0FxI,9834
103
103
  ee/tests/table_converter_test.py,sha256=t4yIfy40R3U17I_2nVtKm_Q2Tae-UifwZLz8qOmoC9A,5091
104
104
  ee/tests/terrain_test.py,sha256=inZ2sy807nDG_HMutzGHaqcTUaLnZQOMdWyf0NrQzV0,4561
105
- earthengine_api-1.7.2rc0.dist-info/METADATA,sha256=-fSFJkm8cxCurqIIWXyR5FNsmKOb8LaI72q9K7fqf2k,2147
106
- earthengine_api-1.7.2rc0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
107
- earthengine_api-1.7.2rc0.dist-info/entry_points.txt,sha256=-Ax4SCU-S474r8OD2LIxata6PRmkZoDrppQ4fP_exNc,50
108
- earthengine_api-1.7.2rc0.dist-info/top_level.txt,sha256=go5zOwCgm5lIS3yTR-Vsxp1gNI4qdS-MP5eY-7zMxVY,3
109
- earthengine_api-1.7.2rc0.dist-info/RECORD,,
105
+ earthengine_api-1.7.3rc0.dist-info/METADATA,sha256=ajolxFsEsMUjl5icjA50VuORFKFgA0VY1O5TVDwBeGY,2147
106
+ earthengine_api-1.7.3rc0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
107
+ earthengine_api-1.7.3rc0.dist-info/entry_points.txt,sha256=-Ax4SCU-S474r8OD2LIxata6PRmkZoDrppQ4fP_exNc,50
108
+ earthengine_api-1.7.3rc0.dist-info/top_level.txt,sha256=go5zOwCgm5lIS3yTR-Vsxp1gNI4qdS-MP5eY-7zMxVY,3
109
+ earthengine_api-1.7.3rc0.dist-info/RECORD,,
ee/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """The EE Python library."""
2
2
 
3
- __version__ = '1.7.2rc0'
3
+ __version__ = '1.7.3rc0'
4
4
 
5
5
  # Using lowercase function naming to match the JavaScript names.
6
6
  # pylint: disable=g-bad-name
ee/batch.py CHANGED
@@ -308,6 +308,7 @@ class Export:
308
308
  crsTransform=None,
309
309
  maxPixels=None,
310
310
  priority=None,
311
+ overwrite=False,
311
312
  **kwargs,
312
313
  ) -> Task:
313
314
  """Creates a task to export an EE Image to an EE Asset.
@@ -344,6 +345,7 @@ class Export:
344
345
  priority: The priority of the task within the project. Higher priority
345
346
  tasks are scheduled sooner. Must be an integer between 0 and 9999.
346
347
  Defaults to 100.
348
+ overwrite: If an existing asset can be overwritten by this export.
347
349
  **kwargs: Holds other keyword arguments that may have been deprecated
348
350
  such as 'crs_transform'.
349
351
 
@@ -739,6 +741,7 @@ class Export:
739
741
  assetId=None,
740
742
  maxVertices=None,
741
743
  priority=None,
744
+ overwrite=False,
742
745
  **kwargs,
743
746
  ) -> Task:
744
747
  """Creates a task to export a FeatureCollection to an EE table asset.
@@ -753,6 +756,7 @@ class Export:
753
756
  priority: The priority of the task within the project. Higher priority
754
757
  tasks are scheduled sooner. Must be an integer between 0 and 9999.
755
758
  Defaults to 100.
759
+ overwrite: If an existing asset can be overwritten by this export.
756
760
  **kwargs: Holds other keyword arguments that may have been deprecated.
757
761
 
758
762
  Returns:
@@ -763,6 +767,7 @@ class Export:
763
767
  'assetId': assetId,
764
768
  'maxVertices': maxVertices,
765
769
  'priority': priority,
770
+ 'overwrite': overwrite,
766
771
  }
767
772
  config = {k: v for k, v, in config.items() if v is not None}
768
773
  config = _prepare_table_export_config(collection, config,
@@ -1738,6 +1743,8 @@ def _build_earth_engine_destination(config: dict[str, Any]) -> dict[str, Any]:
1738
1743
  'name':
1739
1744
  _cloud_api_utils.convert_asset_id_to_asset_name(
1740
1745
  config.pop('assetId')),
1746
+ 'overwrite':
1747
+ config.pop('overwrite', False)
1741
1748
  }
1742
1749
 
1743
1750
 
ee/tests/batch_test.py CHANGED
@@ -274,6 +274,7 @@ class BatchTestCase(apitestcase.ApiTestCase):
274
274
  'name': (
275
275
  'projects/earthengine-legacy/assets/users/foo/bar'
276
276
  ),
277
+ 'overwrite': False,
277
278
  }
278
279
  },
279
280
  'description': 'myExportImageTask',
@@ -425,6 +426,7 @@ class BatchTestCase(apitestcase.ApiTestCase):
425
426
  'name': (
426
427
  'projects/earthengine-legacy/assets/users/foo/bar'
427
428
  ),
429
+ 'overwrite': False,
428
430
  },
429
431
  'pyramidingPolicyOverrides': {'B1': 'MIN'},
430
432
  },
@@ -451,6 +453,7 @@ class BatchTestCase(apitestcase.ApiTestCase):
451
453
  'name': (
452
454
  'projects/earthengine-legacy/assets/users/foo/bar'
453
455
  ),
456
+ 'overwrite': False,
454
457
  },
455
458
  'tileSize': {'value': 4},
456
459
  },
@@ -460,6 +463,43 @@ class BatchTestCase(apitestcase.ApiTestCase):
460
463
  task_ordered.config,
461
464
  )
462
465
 
466
+ task_with_overwrite = ee.batch.Export.image.toAsset(
467
+ image=config['image'],
468
+ assetId=config['assetId'],
469
+ overwrite=True,
470
+ )
471
+ self.assertTrue(
472
+ task_with_overwrite.config['assetExportOptions'][
473
+ 'earthEngineDestination'
474
+ ]['overwrite']
475
+ )
476
+
477
+ task_with_priority = ee.batch.Export.image.toAsset(
478
+ image=config['image'],
479
+ assetId=config['assetId'],
480
+ priority=999,
481
+ )
482
+ self.assertIsNone(task_with_priority.id)
483
+ self.assertIsNone(task_with_priority.name)
484
+ self.assertEqual('EXPORT_IMAGE', task_with_priority.task_type)
485
+ self.assertEqual('UNSUBMITTED', task_with_priority.state)
486
+ self.assertEqual(
487
+ {
488
+ 'expression': expected_expression,
489
+ 'description': 'myExportImageTask',
490
+ 'assetExportOptions': {
491
+ 'earthEngineDestination': {
492
+ 'name': (
493
+ 'projects/earthengine-legacy/assets/users/foo/bar'
494
+ ),
495
+ 'overwrite': False,
496
+ }
497
+ },
498
+ 'priority': {'value': 999},
499
+ },
500
+ task_with_priority.config,
501
+ )
502
+
463
503
  def test_export_image_to_asset_cloud_api_with_tile_size(self):
464
504
  """Verifies the Asset export task created by Export.image.toAsset()."""
465
505
  with apitestcase.UsingCloudApi():
@@ -489,6 +529,7 @@ class BatchTestCase(apitestcase.ApiTestCase):
489
529
  'name': (
490
530
  'projects/earthengine-legacy/assets/users/foo/bar'
491
531
  ),
532
+ 'overwrite': False,
492
533
  },
493
534
  'tileSize': {'value': 4},
494
535
  },
@@ -1133,11 +1174,25 @@ class BatchTestCase(apitestcase.ApiTestCase):
1133
1174
  'name': (
1134
1175
  'projects/earthengine-legacy/assets/users/foo/bar'
1135
1176
  ),
1177
+ 'overwrite': False,
1136
1178
  }
1137
1179
  },
1138
1180
  },
1139
1181
  task.config,
1140
1182
  )
1183
+
1184
+ task_with_overwrite = ee.batch.Export.table.toAsset(
1185
+ collection=ee.FeatureCollection('foo'),
1186
+ description='foo',
1187
+ assetId='users/foo/bar',
1188
+ overwrite=True,
1189
+ )
1190
+ self.assertTrue(
1191
+ task_with_overwrite.config['assetExportOptions'][
1192
+ 'earthEngineDestination'
1193
+ ]['overwrite']
1194
+ )
1195
+
1141
1196
  task_with_priority = ee.batch.Export.table.toAsset(
1142
1197
  collection=ee.FeatureCollection('foo'),
1143
1198
  description='foo',
@@ -1153,6 +1208,7 @@ class BatchTestCase(apitestcase.ApiTestCase):
1153
1208
  'name': (
1154
1209
  'projects/earthengine-legacy/assets/users/foo/bar'
1155
1210
  ),
1211
+ 'overwrite': False,
1156
1212
  }
1157
1213
  },
1158
1214
  'priority': {'value': 999},