Skip to content

Commit 8502796

Browse files
nkarasiakgithub-actions[bot]
authored andcommitted
style(ruff) : automatic lint/format
1 parent 82a4b7c commit 8502796

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

earthdaily/accessor/__init__.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -335,10 +335,8 @@ def whittaker(
335335
max_iter=max_iter,
336336
)
337337

338-
def zonal_stats(
339-
self,
340-
geometry,
341-
operations:list=['mean']):
338+
def zonal_stats(self, geometry, operations: list = ["mean"]):
342339
from ..earthdatastore.cube_utils import zonal_stats, GeometryManager
343-
geometry = GeometryManager(geometry).to_geopandas()
344-
return zonal_stats(self._obj, geometry, operations=operations)
340+
341+
geometry = GeometryManager(geometry).to_geopandas()
342+
return zonal_stats(self._obj, geometry, operations=operations)

earthdaily/earthdatastore/cube_utils/_zonal.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -110,18 +110,20 @@ def zonal_stats(
110110
method="geocube",
111111
verbose=False,
112112
):
113-
if method == 'geocube':
113+
if method == "geocube":
114114
from geocube.api.core import make_geocube
115-
gdf['feature'] = list(gdf.index)
115+
116+
gdf["feature"] = list(gdf.index)
116117
out_grid = make_geocube(
117118
gdf,
118119
measurements=["feature"],
119-
like=dataset # ensure the data are on the same grid
120+
like=dataset, # ensure the data are on the same grid
120121
)
121122
cube = dataset.groupby(out_grid.feature)
122-
zonal_stats = xr.concat([
123-
getattr(cube, operation)() for operation in operations], dim='stats')
124-
zonal_stats['stats'] = operations
123+
zonal_stats = xr.concat(
124+
[getattr(cube, operation)() for operation in operations], dim="stats"
125+
)
126+
zonal_stats["stats"] = operations
125127
return zonal_stats
126128
tqdm_bar = tqdm.tqdm(total=gdf.shape[0])
127129

0 commit comments

Comments
 (0)