Skip to content

Commit

Permalink
release(v0.5.0)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasK committed Feb 11, 2025
1 parent 1a1de70 commit 3df6ade
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
15 changes: 15 additions & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion earthdaily/accessor/whittaker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
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 @@ -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

Expand Down
11 changes: 6 additions & 5 deletions examples/field_evolution.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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")

##############################################################################
Expand Down

0 comments on commit 3df6ade

Please sign in to comment.