diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 4de1a81c..06a92777 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -4,6 +4,21 @@ 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.5.0] - 2025-02-11 + +### Added + +- `zonal_stats` now preserves GeoDataFrame columns (`preserve_columns=True`). + +### Changed + +- `label` arg has been deprecated from `zonal_stats`. +- `zonal_stats` has same output between `xvec` and `numpy` method. +- `smart_load` is becoming `lazy_load` (`smart_load=True` is `lazy_load=False`) +- Required `pystac-client>=0.7`. +- `groupby_date` engine is fixed to `numpy`. Change is available via +`earthdaily.option.set_option('groupby_date_engine','numba')` for example. + ## [0.4.2] - 2025-02-05 ### Fixed diff --git a/earthdaily/accessor/whittaker/__init__.py b/earthdaily/accessor/whittaker/__init__.py index 0092e85a..df0c4064 100644 --- a/earthdaily/accessor/whittaker/__init__.py +++ b/earthdaily/accessor/whittaker/__init__.py @@ -34,7 +34,7 @@ def whittaker(dataset, beta=10000.0, weights=None, time="time"): """ resampled = dataset.resample({time: "1D"}).interpolate("linear") - weights_binary = np.in1d(resampled[time].dt.date, dataset[time].dt.date) + weights_binary = np.isin(resampled[time].dt.date, dataset[time].dt.date) if weights is not None: weights_advanced = np.copy(weights_binary.astype(float)) weights_advanced[weights_advanced == 1.0] = weights diff --git a/earthdaily/earthdatastore/mask/__init__.py b/earthdaily/earthdatastore/mask/__init__.py index 932d2dab..8107f77a 100644 --- a/earthdaily/earthdatastore/mask/__init__.py +++ b/earthdaily/earthdatastore/mask/__init__.py @@ -170,7 +170,7 @@ def compute_available_pixels(self): all_touched=False, ) self.clip_mask_arr = clip_mask_arr - usable_pixels = np.sum(np.in1d(clip_mask_arr, False)) + usable_pixels = np.sum(np.isin(clip_mask_arr, False)) self._obj.attrs["usable_pixels"] = usable_pixels return self._obj diff --git a/examples/field_evolution.py b/examples/field_evolution.py index 0da8fe65..9339d817 100644 --- a/examples/field_evolution.py +++ b/examples/field_evolution.py @@ -11,20 +11,21 @@ import geopandas as gpd from matplotlib import pyplot as plt -from earthdaily import datasets, EarthDataStore +import earthdaily as ed +import xarray as xr ############################################################################## # Load plot # ------------------------------------------- # load geojson -pivot = datasets.load_pivot() +pivot = ed.datasets.load_pivot() ############################################################################## # Init earthdatastore with environment variables or default credentials # ---------------------------------------------------------------------------- -eds = EarthDataStore() +eds = ed.EarthDataStore() ############################################################################## # Search for collection items for June 2022. @@ -36,8 +37,8 @@ datetime=["2022-06"], assets=["red", "green", "blue", "nir"], mask_with="native", - clear_cover=50, -) + clear_cover=50 + ) pivot_cube.clear_percent.plot.scatter(x="time") ##############################################################################