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

Update zonal stats function #1854

Merged
merged 2 commits into from
Dec 19, 2023
Merged

Update zonal stats function #1854

merged 2 commits into from
Dec 19, 2023

Conversation

giswqs
Copy link
Member

@giswqs giswqs commented Dec 19, 2023

This PR improves the zonal stats function to support ee.Reducer in addition to string type, renames statistics_type as stat_type, and updates all corresponding notebooks.

Copy link

@github-actions github-actions bot temporarily deployed to pull request December 19, 2023 20:01 Inactive
@giswqs giswqs merged commit efaf466 into master Dec 19, 2023
14 checks passed
@giswqs giswqs deleted the zonal branch December 19, 2023 20:04
@@ -6754,6 +6752,10 @@ def zonal_stats(
if out_file_path is None:
out_file_path = os.path.join(os.getcwd(), "zonal_stats.csv")

if "statistics_type" in kwargs:
stat_type = kwargs["statistics_type"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simplify. Combine the pop with the assignment

stat_type = kwargs.pop("statistics_type")

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good suggestion. Fix in here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants