Skip to content

Commit

Permalink
release(v0.2.10)
Browse files Browse the repository at this point in the history
release(v0.2.10)
  • Loading branch information
nkarasiak authored Oct 10, 2024
2 parents 4f9b548 + 9821b7f commit dd32219
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 7 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.2.10] - 2024-10-10

### Added

- Add a retry strategy for the EarthDaily client.

### Fixed

- `bbox` for datacube has been fixed.

## [0.2.9] - 2024-09-24

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion earthdaily/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
# to hide warnings from rioxarray or nano seconds conversion
# warnings.filterwarnings("ignore")

__version__ = "0.2.9"
__version__ = "0.2.10"


def EarthDataStore(
Expand Down
13 changes: 10 additions & 3 deletions earthdaily/earthdatastore/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
from pystac.item_collection import ItemCollection
from pystac_client.item_search import ItemSearch
from pystac_client import Client
from pystac_client.stac_api_io import StacApiIO
from urllib3 import Retry
from itertools import chain
from odc import stac
from . import _scales_collections, cube_utils, mask
Expand Down Expand Up @@ -308,10 +310,15 @@ def _get_client(config=None, presign_urls=True, request_payer=False):
if request_payer:
headers["x-amz-request-payer"] = "requester"

return Client.open(
eds_url,
headers=headers,
retry = Retry(
total=5,
backoff_factor=1,
status_forcelist=[502, 503, 504],
allowed_methods=None,
)
stac_api_io = StacApiIO(max_retries=retry)

return Client.open(eds_url, headers=headers, stac_io=stac_api_io)


class StacCollectionExplorer:
Expand Down
2 changes: 1 addition & 1 deletion earthdaily/earthdatastore/mask/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
class Mask:
def __init__(self, dataset: xr.Dataset, intersects=None, bbox=None):
self._obj = dataset
if bbox and intersects is None:
if bbox is not None and intersects is None:
intersects = _bbox_to_intersects(bbox)
if isinstance(intersects, gpd.GeoDataFrame):
intersects = intersects.to_crs(self._obj.rio.crs)
Expand Down
3 changes: 2 additions & 1 deletion requirements.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ dependencies:
- spyndex
- dask-image
- toml
- click
- click
- urllib3
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
"spyndex",
"dask-image",
"numba",
"geocube",
"urllib3",
"click",
"toml",
],
Expand Down

0 comments on commit dd32219

Please sign in to comment.