@@ -309,7 +309,7 @@ def _zonal_stats_exactextract(
309309 y_coords : Hashable ,
310310 stats : str | Callable | Sequence [str | Callable | tuple ] = "mean" ,
311311 name : str = "geometry" ,
312- strategy : str = "feature-sequential"
312+ strategy : str = "feature-sequential" ,
313313) -> xr .DataArray | xr .Dataset :
314314 """Extract the values from a dataset indexed by a set of geometries
315315
@@ -367,7 +367,15 @@ def _zonal_stats_exactextract(
367367 raise ValueError (f"{ stat } is not a valid aggregation." )
368368
369369 results , original_shape , coords_info , locs = _agg_exactextract (
370- acc , geometry , crs , x_coords , y_coords , stats , name , original_is_ds , strategy
370+ acc ,
371+ geometry ,
372+ crs ,
373+ x_coords ,
374+ y_coords ,
375+ stats ,
376+ name ,
377+ original_is_ds ,
378+ strategy ,
371379 )
372380 i = 0
373381 for stat in stats : # type: ignore
@@ -397,7 +405,15 @@ def _zonal_stats_exactextract(
397405 )
398406 elif isinstance (stats , str ):
399407 results , original_shape , coords_info , _ = _agg_exactextract (
400- acc , geometry , crs , x_coords , y_coords , stats , name , original_is_ds , strategy
408+ acc ,
409+ geometry ,
410+ crs ,
411+ x_coords ,
412+ y_coords ,
413+ stats ,
414+ name ,
415+ original_is_ds ,
416+ strategy ,
401417 )
402418 # Unstack the result
403419 arr = results .values .reshape (original_shape )
@@ -433,7 +449,7 @@ def _agg_exactextract(
433449 stats : str | Callable | Iterable [str | Callable | tuple ] = "mean" ,
434450 name : str = "geometry" ,
435451 original_is_ds : bool = False ,
436- strategy : str = "feature-sequential"
452+ strategy : str = "feature-sequential" ,
437453):
438454 """Extract the values from a dataset indexed by a set of geometries
439455
@@ -500,7 +516,9 @@ def _agg_exactextract(
500516
501517 # Aggregation result
502518 gdf = gpd .GeoDataFrame (geometry = geometry , crs = crs )
503- results = exactextract .exact_extract (rast = data , vec = gdf , ops = stats , output = "pandas" , strategy = strategy )
519+ results = exactextract .exact_extract (
520+ rast = data , vec = gdf , ops = stats , output = "pandas" , strategy = strategy
521+ )
504522 # Get all the dimensions execpt x_coords, y_coords, they will be used to stack the
505523 # dataarray later
506524 if original_is_ds is True :
0 commit comments