Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
# ==============================================================================
"""Configure FLAGS with default values for absltest."""

from absl import app

try:
Expand Down
1,126 changes: 557 additions & 569 deletions docs/client-vs-server.ipynb

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
print('python exec:', sys.executable)
print('sys.path:', sys.path)
if importlib.util.find_spec('pip') is not None:
print('pip environment:')
subprocess.run([sys.executable, '-m', 'pip', 'list']) # pylint: disable=subprocess-run-check
print('pip environment:')
subprocess.run([sys.executable, '-m', 'pip', 'list']) # pylint: disable=subprocess-run-check
else:
print('pip environment: unavailable')
print('pip environment: unavailable')

print(f'xee: {xee.__file__}')

Expand Down
3 changes: 1 addition & 2 deletions examples/dataflow/ee_to_zarr_dataflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@
# ==============================================================================
r"""Exports EE ImageCollections to Zarr using Xarray-Beam."""


import logging

from absl import app
from absl import flags
import apache_beam as beam
import shapely
import xarray as xr
import xarray_beam as xbeam
import xee
from xee import helpers
import shapely

import ee

Expand Down
3 changes: 1 addition & 2 deletions examples/ee_to_zarr.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,14 @@
from absl import app
from absl import flags
import apache_beam as beam
import shapely
import xarray as xr
import xarray_beam as xbeam
import xee
from xee import helpers
import shapely

import ee


logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)

Expand Down
5 changes: 4 additions & 1 deletion xee/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@

from .ext import * # noqa: F401,F403 (backend classes)
from .ext import __version__ # noqa: F401
from .helpers import fit_geometry, extract_grid_params, set_scale, PixelGridParams # noqa: F401
from .helpers import extract_grid_params # noqa: F401
from .helpers import fit_geometry # noqa: F401
from .helpers import PixelGridParams # noqa: F401
from .helpers import set_scale # noqa: F401

__all__ = [
# Version.
Expand Down
23 changes: 11 additions & 12 deletions xee/ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@

import ee


assert sys.version_info >= (3, 10)
try:
__version__ = importlib.metadata.version('xee') or 'unknown'
Expand Down Expand Up @@ -956,9 +955,8 @@ def open_dataset(
Args:
filename_or_obj: An asset ID for an ImageCollection, or an
``ee.ImageCollection`` object.
crs: The coordinate reference system (a CRS code or WKT
string). This defines the frame of reference to coalesce all variables
upon opening.
crs: The coordinate reference system (a CRS code or WKT string). This
defines the frame of reference to coalesce all variables upon opening.
crs_transform: Transform matrix describing the grid origin and scale
relative to the CRS.
shape_2d: Dimensions of the pixel grid in the form (width, height).
Expand All @@ -977,8 +975,8 @@ def open_dataset(
decode_timedelta (optional): If True, decode variables and coordinates
with time units in {"days", "hours", "minutes", "seconds",
"milliseconds", "microseconds"} into timedelta objects. If False, leave
them encoded as numbers. If ``None`` (default), assume the same value
of ``decode_times``.
them encoded as numbers. If ``None`` (default), assume the same value of
``decode_times``.
use_cftime (optional): Only relevant if encoded dates come from a standard
calendar (e.g. "gregorian", "proleptic_gregorian", "standard", or not
specified). If None (default), attempt to decode times to
Expand All @@ -991,12 +989,12 @@ def open_dataset(
concat_characters (optional): Should character arrays be concatenated to
strings, for example: ``["h", "e", "l", "l", "o"] -> "hello"``.
decode_coords (optional): ``bool`` or ``{"coordinates", "all"}``. Controls
which variables are set as coordinate variables. Use
``"coordinates"`` (or ``True``) to set variables referenced by the
``'coordinates'`` attribute of datasets or individual variables as
coordinate variables. Use ``"all"`` to additionally set variables
referenced by ``'grid_mapping'``, ``'bounds'``, and related attributes
as coordinate variables.
which variables are set as coordinate variables. Use ``"coordinates"``
(or ``True``) to set variables referenced by the ``'coordinates'``
attribute of datasets or individual variables as coordinate variables.
Use ``"all"`` to additionally set variables referenced by
``'grid_mapping'``, ``'bounds'``, and related attributes as coordinate
variables.
primary_dim_name (optional): Override the name of the primary dimension of
the output Dataset. By default, the name is ``'time'``.
primary_dim_property (optional): Override the ``ee.Image`` property for
Expand All @@ -1023,6 +1021,7 @@ def open_dataset(
makes slicing an ImageCollection across time faster. This optimization
loads EE images in a slice by ID, so any modifications to images in a
computed ImageCollection will not be reflected.

Returns:
An xarray.Dataset that streams in remote data from Earth Engine.
"""
Expand Down
1 change: 1 addition & 0 deletions xee/ext_integration_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
# ==============================================================================
r"""Integration tests for the Google Earth Engine backend for Xarray."""

import json
import os
import pathlib
Expand Down
4 changes: 2 additions & 2 deletions xee/ext_test.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""Xee Unit Tests."""

from unittest import mock
from absl.testing import absltest
from absl.testing import parameterized
import numpy as np
import affine
import numpy as np
import shapely
from unittest import mock
import xee
from xee import ext
from xee import helpers
Expand Down
1 change: 0 additions & 1 deletion xee/micro_benchmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

import ee


REPEAT = 10
LOOPS = 1
PROFILE = False
Expand Down
1 change: 1 addition & 0 deletions xee/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# limitations under the License.
# ==============================================================================
"""Type definitions for Earth Engine concepts (and others)."""

from typing import TypedDict, Union

TileIndex = tuple[int, int, int]
Expand Down