xee 0.0.3__tar.gz → 0.0.4__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.
- {xee-0.0.3 → xee-0.0.4}/PKG-INFO +1 -1
- {xee-0.0.3 → xee-0.0.4}/xee/ext.py +8 -6
- {xee-0.0.3 → xee-0.0.4}/xee/ext_integration_test.py +5 -5
- {xee-0.0.3 → xee-0.0.4}/xee.egg-info/PKG-INFO +1 -1
- {xee-0.0.3 → xee-0.0.4}/.github/workflows/ci-build.yml +0 -0
- {xee-0.0.3 → xee-0.0.4}/.github/workflows/lint.yml +0 -0
- {xee-0.0.3 → xee-0.0.4}/.github/workflows/publish.yml +0 -0
- {xee-0.0.3 → xee-0.0.4}/.gitignore +0 -0
- {xee-0.0.3 → xee-0.0.4}/LICENSE +0 -0
- {xee-0.0.3 → xee-0.0.4}/README.md +0 -0
- {xee-0.0.3 → xee-0.0.4}/conftest.py +0 -0
- {xee-0.0.3 → xee-0.0.4}/docs/Makefile +0 -0
- {xee-0.0.3 → xee-0.0.4}/docs/README.md +0 -0
- {xee-0.0.3 → xee-0.0.4}/docs/api.md +0 -0
- {xee-0.0.3 → xee-0.0.4}/docs/code-of-conduct.md +0 -0
- {xee-0.0.3 → xee-0.0.4}/docs/conf.py +0 -0
- {xee-0.0.3 → xee-0.0.4}/docs/contributing.md +0 -0
- {xee-0.0.3 → xee-0.0.4}/docs/index.md +0 -0
- {xee-0.0.3 → xee-0.0.4}/docs/make.bat +0 -0
- {xee-0.0.3 → xee-0.0.4}/docs/requirements.txt +0 -0
- {xee-0.0.3 → xee-0.0.4}/docs/why-xee.md +0 -0
- {xee-0.0.3 → xee-0.0.4}/docs/xee-logo.png +0 -0
- {xee-0.0.3 → xee-0.0.4}/examples/README.md +0 -0
- {xee-0.0.3 → xee-0.0.4}/examples/ee_to_zarr.py +0 -0
- {xee-0.0.3 → xee-0.0.4}/examples/ee_to_zarr_reqs.txt +0 -0
- {xee-0.0.3 → xee-0.0.4}/pyproject.toml +0 -0
- {xee-0.0.3 → xee-0.0.4}/setup.cfg +0 -0
- {xee-0.0.3 → xee-0.0.4}/xee/__init__.py +0 -0
- {xee-0.0.3 → xee-0.0.4}/xee/ext_test.py +0 -0
- {xee-0.0.3 → xee-0.0.4}/xee/micro_benchmarks.py +0 -0
- {xee-0.0.3 → xee-0.0.4}/xee/types.py +0 -0
- {xee-0.0.3 → xee-0.0.4}/xee.egg-info/SOURCES.txt +0 -0
- {xee-0.0.3 → xee-0.0.4}/xee.egg-info/dependency_links.txt +0 -0
- {xee-0.0.3 → xee-0.0.4}/xee.egg-info/entry_points.txt +0 -0
- {xee-0.0.3 → xee-0.0.4}/xee.egg-info/requires.txt +0 -0
- {xee-0.0.3 → xee-0.0.4}/xee.egg-info/top_level.txt +0 -0
{xee-0.0.3 → xee-0.0.4}/PKG-INFO
RENAMED
|
@@ -105,12 +105,14 @@ class EarthEngineStore(common.AbstractDataStore):
|
|
|
105
105
|
'degree': 1,
|
|
106
106
|
'metre': 10_000,
|
|
107
107
|
'meter': 10_000,
|
|
108
|
+
'm': 10_000,
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
DIMENSION_NAMES: Dict[str, Tuple[str, str]] = {
|
|
111
112
|
'degree': ('lon', 'lat'),
|
|
112
113
|
'metre': ('X', 'Y'),
|
|
113
114
|
'meter': ('X', 'Y'),
|
|
115
|
+
'm': ('X', 'Y'),
|
|
114
116
|
}
|
|
115
117
|
|
|
116
118
|
DEFAULT_MASK_VALUE = np.iinfo(np.int32).max
|
|
@@ -465,9 +467,9 @@ class EarthEngineStore(common.AbstractDataStore):
|
|
|
465
467
|
# `raw` is a structured array of all the same dtype (i.e. number of images).
|
|
466
468
|
arr = np.array(raw.tolist(), dtype=dtype)
|
|
467
469
|
data = arr.T
|
|
468
|
-
|
|
470
|
+
current_mask_value = np.array(self.mask_value, dtype=data.dtype)
|
|
469
471
|
# Sets EE nodata masked value to NaNs.
|
|
470
|
-
data = np.where(data ==
|
|
472
|
+
data = np.where(data == current_mask_value, np.nan, data)
|
|
471
473
|
return data
|
|
472
474
|
|
|
473
475
|
@functools.lru_cache()
|
|
@@ -637,8 +639,8 @@ class EarthEngineBackendArray(backends.BackendArray):
|
|
|
637
639
|
|
|
638
640
|
x_min, y_min, x_max, y_max = self.bounds
|
|
639
641
|
|
|
640
|
-
x_size = int(np.
|
|
641
|
-
y_size = int(np.
|
|
642
|
+
x_size = int(np.round((x_max - x_min) / np.abs(self.store.scale_x)))
|
|
643
|
+
y_size = int(np.round((y_max - y_min) / np.abs(self.store.scale_y)))
|
|
642
644
|
|
|
643
645
|
self.shape = (ee_store.n_images, x_size, y_size)
|
|
644
646
|
self._apparent_chunks = {k: 1 for k in self.store.PREFERRED_CHUNKS.keys()}
|
|
@@ -821,7 +823,7 @@ class EarthEngineBackendEntrypoint(backends.BackendEntrypoint):
|
|
|
821
823
|
|
|
822
824
|
def guess_can_open(
|
|
823
825
|
self, filename_or_obj: Union[str, os.PathLike[Any], ee.ImageCollection]
|
|
824
|
-
) -> bool:
|
|
826
|
+
) -> bool: # type: ignore
|
|
825
827
|
"""Returns True if the candidate is a valid ImageCollection."""
|
|
826
828
|
if isinstance(filename_or_obj, ee.ImageCollection):
|
|
827
829
|
return True
|
|
@@ -853,7 +855,7 @@ class EarthEngineBackendEntrypoint(backends.BackendEntrypoint):
|
|
|
853
855
|
primary_dim_property: Optional[str] = None,
|
|
854
856
|
ee_mask_value: Optional[float] = None,
|
|
855
857
|
request_byte_limit: int = REQUEST_BYTE_LIMIT,
|
|
856
|
-
) -> xarray.Dataset:
|
|
858
|
+
) -> xarray.Dataset: # type: ignore
|
|
857
859
|
"""Open an Earth Engine ImageCollection as an Xarray Dataset.
|
|
858
860
|
|
|
859
861
|
Args:
|
|
@@ -281,7 +281,7 @@ class EEBackendEntrypointTest(absltest.TestCase):
|
|
|
281
281
|
scale=25.0, # in degrees
|
|
282
282
|
n_images=3,
|
|
283
283
|
)
|
|
284
|
-
self.assertEqual(dict(ds.dims), {'time': 3, 'lon':
|
|
284
|
+
self.assertEqual(dict(ds.dims), {'time': 3, 'lon': 14, 'lat': 7})
|
|
285
285
|
self.assertNotEmpty(dict(ds.coords))
|
|
286
286
|
self.assertEqual(
|
|
287
287
|
list(ds.data_vars.keys()),
|
|
@@ -290,7 +290,7 @@ class EEBackendEntrypointTest(absltest.TestCase):
|
|
|
290
290
|
for v in ds.values():
|
|
291
291
|
self.assertIsNotNone(v.data)
|
|
292
292
|
self.assertFalse(v.isnull().all(), 'All values are null!')
|
|
293
|
-
self.assertEqual(v.shape, (3,
|
|
293
|
+
self.assertEqual(v.shape, (3, 14, 7))
|
|
294
294
|
|
|
295
295
|
def test_open_dataset__n_images(self):
|
|
296
296
|
ds = self.entry.open_dataset(
|
|
@@ -330,7 +330,7 @@ class EEBackendEntrypointTest(absltest.TestCase):
|
|
|
330
330
|
engine=xee.EarthEngineBackendEntrypoint,
|
|
331
331
|
)
|
|
332
332
|
|
|
333
|
-
self.assertEqual(ds.dims, {'time': 4248, 'lon':
|
|
333
|
+
self.assertEqual(ds.dims, {'time': 4248, 'lon': 40, 'lat': 35})
|
|
334
334
|
self.assertNotEqual(ds.dims, standard_ds.dims)
|
|
335
335
|
|
|
336
336
|
def test_honors_projection(self):
|
|
@@ -357,14 +357,14 @@ class EEBackendEntrypointTest(absltest.TestCase):
|
|
|
357
357
|
scale=25.0, # in degrees
|
|
358
358
|
n_images=3,
|
|
359
359
|
)
|
|
360
|
-
self.assertEqual(dict(ds.dims), {'time': 3, 'lon':
|
|
360
|
+
self.assertEqual(dict(ds.dims), {'time': 3, 'lon': 14, 'lat': 7})
|
|
361
361
|
ds = self.entry.open_dataset(
|
|
362
362
|
'ee:LANDSAT/LC08/C01/T1',
|
|
363
363
|
drop_variables=tuple(f'B{i}' for i in range(3, 12)),
|
|
364
364
|
scale=25.0, # in degrees
|
|
365
365
|
n_images=3,
|
|
366
366
|
)
|
|
367
|
-
self.assertEqual(dict(ds.dims), {'time': 3, 'lon':
|
|
367
|
+
self.assertEqual(dict(ds.dims), {'time': 3, 'lon': 14, 'lat': 7})
|
|
368
368
|
|
|
369
369
|
def test_data_sanity_check(self):
|
|
370
370
|
# This simple test uncovered a bug with the default definition of `scale`.
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{xee-0.0.3 → xee-0.0.4}/LICENSE
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|