Skip to content

Commit

Permalink
fix: remove limited grpc support (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbrunato authored Dec 15, 2023
1 parent 3b4a0f8 commit b750334
Show file tree
Hide file tree
Showing 16 changed files with 0 additions and 1,608 deletions.
2 changes: 0 additions & 2 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ The Apache 2.0 License
The following components are provided under the Apache 2.0 License (https://opensource.org/licenses/Apache-2.0).
See project link for details.

https://grpc.io/
https://github.com/pydata/xarray
https://github.com/corteva/rioxarray
https://github.com/CS-SI/eodag
Expand All @@ -31,4 +30,3 @@ See project link for details.

http://www.numpy.org/
https://github.com/mapbox/rasterio
https://github.com/google/protobuf
41 changes: 0 additions & 41 deletions eodag_cube/api/product/_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,44 +205,3 @@ def _get_rio_env(self, dataset_address):
}
else:
return {}

def encode(self, raster, encoding="protobuf"):
"""Encode the subset to a network-compatible format.
:param raster: The raster data to encode
:type raster: xarray.DataArray
:param encoding: The encoding of the export
:type encoding: str
:return: The data encoded in the specified encoding
:rtype: bytes
"""
# If no encoding return an empty byte
if not encoding:
logger.warning("Trying to encode a raster without specifying an encoding")
return b""
strategy = getattr(self, "_{encoding}".format(**locals()), None)
if strategy:
return strategy(raster)
logger.error("Unknown encoding: %s", encoding)
return b""

def _protobuf(self, raster):
"""Google's Protocol buffers encoding strategy.
:param raster: The raster to encode
:type raster: xarray.DataArray
:returns: The raster data represented by this subset in protocol buffers
encoding
:rtype: bytes
"""
from eodag_cube.api.product.protobuf import eo_product_pb2

subdataset = eo_product_pb2.EOProductSubdataset()
subdataset.id = self.properties["id"]
subdataset.producer = self.provider
subdataset.product_type = self.product_type
subdataset.platform = self.properties["platformSerialIdentifier"]
subdataset.sensor = self.properties["instrument"]
data = subdataset.data
data.array.extend(list(raster.values.flatten().astype(int)))
data.shape.extend(list(raster.values.shape))
data.dtype = raster.values.dtype.name
return subdataset.SerializeToString()
26 changes: 0 additions & 26 deletions eodag_cube/api/product/protobuf/__init__.py

This file was deleted.

40 changes: 0 additions & 40 deletions eodag_cube/api/product/protobuf/eo_product.proto

This file was deleted.

Loading

0 comments on commit b750334

Please sign in to comment.