Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

release(v0.5.0) #155

Merged
merged 14 commits into from
Feb 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
4 changes: 3 additions & 1 deletion earthdaily/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
from pathlib import Path
from . import earthdatastore, datasets
from .accessor import __EarthDailyAccessorDataArray, __EarthDailyAccessorDataset
from earthdaily.core import options

__all__ = ["options"]
# import warnings
# to hide warnings from rioxarray or nano seconds conversion
# warnings.filterwarnings("ignore")

__version__ = "0.4.2"
__version__ = "0.5.0"


def EarthDataStore(
Expand Down
10 changes: 6 additions & 4 deletions earthdaily/accessor/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def zonal_stats(
self,
geometry,
reducers: list = ["mean"],
label: str = None,
preserve_columns: bool = True,
lazy_load=True,
**kwargs,
):
Expand All @@ -146,6 +146,8 @@ def zonal_stats(
A geometry (wkt, geopandas...)
stats : list, optional
The default is ["mean"].
preserve_columns : bool, optional
The default is True.
raise_missing_geometry : bool, optional
DESCRIPTION. The default is False.
**kwargs : dict
Expand All @@ -164,8 +166,8 @@ def zonal_stats(
self._obj,
geometry,
reducers=reducers,
smart_load=not lazy_load,
label=label,
lazy_load=lazy_load,
preserve_columns=preserve_columns,
**kwargs,
)

Expand Down Expand Up @@ -200,7 +202,7 @@ def drop_unfrozen_coords(self, keep_spatial_ref=True):
]
if keep_spatial_ref and "spatial_ref" in unfrozen_coords:
unfrozen_coords.pop(
np.argwhere(np.in1d(unfrozen_coords, "spatial_ref"))[0][0]
np.argwhere(np.isin(unfrozen_coords, "spatial_ref"))[0][0]
)
return self._obj.drop(unfrozen_coords)

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
3 changes: 3 additions & 0 deletions earthdaily/core/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
from .options import options

__all__ = ["options"]
Loading