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

Optimize create_timeseries for memory #1781

Merged
merged 2 commits into from Oct 16, 2023
Merged

Optimize create_timeseries for memory #1781

merged 2 commits into from Oct 16, 2023

Conversation

jdbcode
Copy link
Collaborator

@jdbcode jdbcode commented Oct 16, 2023

Potentially helps issues with "User memory limit exceeded" errors like that described in this discussion post.

  • Adds parallelScale argument to ee.ImageCollection.reduce
  • Uses clipToFeatures when region is a feature collection
  • reduces the list of images in a collection to 1 for check if size is 0 (size calls toList, which can be memory intensive with large collection)

I wasn't sure whether to use **kwargs for the new parallel_scale parameter for the function that call on create_timeseries - I went with named parameter to make it more obvious that it is an option.

@giswqs
Copy link
Member

giswqs commented Oct 16, 2023

Great improvement! Adding the new parameter parallel_scale is more user-friendly than using **kwargs

@github-actions
Copy link

github-actions bot commented Oct 16, 2023

@github-actions github-actions bot temporarily deployed to pull request October 16, 2023 19:09 Inactive
@giswqs giswqs merged commit 599c506 into master Oct 16, 2023
14 checks passed
@giswqs giswqs deleted the timeseries branch October 16, 2023 19:10
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