From a5f1831596cdad2397666ee862a0b07337743e0f Mon Sep 17 00:00:00 2001 From: nicolasK Date: Thu, 11 Apr 2024 12:14:37 +0200 Subject: [PATCH 1/3] chore(version) : 0.0.15 --- CHANGELOG.md | 4 ++++ earthdaily/__init__.py | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b2ab5aee..cf24ad02 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ 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.0.15] - Unreleased + + + ## [0.0.14] - 2024-04-11 ### Fixed diff --git a/earthdaily/__init__.py b/earthdaily/__init__.py index 6ceb0056..6014879e 100644 --- a/earthdaily/__init__.py +++ b/earthdaily/__init__.py @@ -5,4 +5,4 @@ # to hide warnings from rioxarray or nano seconds conversion warnings.filterwarnings("ignore") -__version__ = "0.0.14" +__version__ = "0.0.15" From 3642dc5633fa0f934c58d5ef67f57f21da7f56a0 Mon Sep 17 00:00:00 2001 From: nicolasK Date: Thu, 11 Apr 2024 13:53:40 +0200 Subject: [PATCH 2/3] chore(version) --- CHANGELOG.md | 5 ++++- earthdaily/earthdatastore/__init__.py | 10 ++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cf24ad02..9bfce3c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,11 @@ 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.0.15] - Unreleased +## [0.0.15] - 2024-04-11 +### Fixed + +- `ag_cloud_mask_items` queries items per batch. ## [0.0.14] - 2024-04-11 diff --git a/earthdaily/earthdatastore/__init__.py b/earthdaily/earthdatastore/__init__.py index b93e27a3..ca12cc8f 100644 --- a/earthdaily/earthdatastore/__init__.py +++ b/earthdaily/earthdatastore/__init__.py @@ -650,6 +650,7 @@ def datacube( if intersects is not None: intersects = cube_utils.GeometryManager(intersects).to_geopandas() + self.intersects = intersects items = self.search( collections=collections, bbox=bbox, @@ -941,8 +942,13 @@ def ag_cloud_mask_from_items(items): if len(items_id) == 0: raise ValueError("Sorry, no ag_cloud_mask available.") collections = list(items_id.keys()) - ids = [x for n in (items_id.values()) for x in n] - return self.search(collections=collections, ids=ids) + ids_ = [x for n in (items_id.values()) for x in n] + items_list = [] + step = 100 + for items_start_idx in range(0,len(ids_),step): + items = self.search(collections=collections, intersects=self.intersects, ids=ids_[items_start_idx:items_start_idx+step]) + items_list.extend(items) + return ItemCollection(items) def item_property_to_df( From 99217d641ab1654aa9e739d03906e580be10ada8 Mon Sep 17 00:00:00 2001 From: nkarasiak Date: Thu, 11 Apr 2024 11:54:11 +0000 Subject: [PATCH 3/3] style(ruff) : automatic lint/format --- earthdaily/earthdatastore/__init__.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/earthdaily/earthdatastore/__init__.py b/earthdaily/earthdatastore/__init__.py index ca12cc8f..008a89ab 100644 --- a/earthdaily/earthdatastore/__init__.py +++ b/earthdaily/earthdatastore/__init__.py @@ -650,7 +650,7 @@ def datacube( if intersects is not None: intersects = cube_utils.GeometryManager(intersects).to_geopandas() - self.intersects = intersects + self.intersects = intersects items = self.search( collections=collections, bbox=bbox, @@ -945,8 +945,12 @@ def ag_cloud_mask_from_items(items): ids_ = [x for n in (items_id.values()) for x in n] items_list = [] step = 100 - for items_start_idx in range(0,len(ids_),step): - items = self.search(collections=collections, intersects=self.intersects, ids=ids_[items_start_idx:items_start_idx+step]) + for items_start_idx in range(0, len(ids_), step): + items = self.search( + collections=collections, + intersects=self.intersects, + ids=ids_[items_start_idx : items_start_idx + step], + ) items_list.extend(items) return ItemCollection(items)