Skip to content

Commit

Permalink
Add missing count stat
Browse files Browse the repository at this point in the history
  • Loading branch information
fbunt committed Oct 18, 2023
1 parent 3cbaf65 commit b9aff66
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
13 changes: 12 additions & 1 deletion raster_tools/zonal.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,18 @@ def _asm_entropy_fin(s, func):


_DASK_STAT_NAMES = frozenset(
("max", "mean", "median", "min", "prod", "size", "std", "sum", "var")
(
"count",
"max",
"mean",
"median",
"min",
"prod",
"size",
"std",
"sum",
"var",
)
)
_CUSTOM_STAT_NAMES = frozenset(("asm", "entropy", "mode", "nunique"))
_CUSTOM_STAT_AGGS = {
Expand Down
2 changes: 1 addition & 1 deletion tests/test_zonal.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def rasters_to_zonal_df(feat_raster, data_raster):
"stats",
[
["max", "mean", "median", "min", "size", "std", "sum", "var"],
["asm", "entropy", "mode", "nunique", "mean", "var"],
["asm", "entropy", "mode", "nunique", "mean", "var", "count"],
["asm", "median"],
"median",
["mean", "median"],
Expand Down

0 comments on commit b9aff66

Please sign in to comment.