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

Concurrent downloads #21

Merged
merged 17 commits into from
Apr 13, 2023
Merged

Concurrent downloads #21

merged 17 commits into from
Apr 13, 2023

Conversation

forrestfwilliams
Copy link
Contributor

Waiting on the burst extractor in serial to perform data downloads was taking up a large percentage of the total processing time. This PR refactors the download_bursts function to concurrently download the data we need, significantly decreasing the overall processing time.

@forrestfwilliams forrestfwilliams added the bumpless Changes to documentation, CI/CD pipelines, etc that don't affect the project's version label Apr 11, 2023
@forrestfwilliams forrestfwilliams requested a review from a team as a code owner April 12, 2023 12:39
@forrestfwilliams forrestfwilliams added patch Bump the patch version number of this project and removed bumpless Changes to documentation, CI/CD pipelines, etc that don't affect the project's version labels Apr 12, 2023
Comment on lines +329 to +333
with ThreadPoolExecutor(max_workers=10) as executor:
xml_futures = [executor.submit(download_metadata, asf_session, params) for params in param_list]
tiff_futures = [executor.submit(download_burst, asf_session, params) for params in param_list]
metadata_xmls = [future.result() for future in xml_futures]
burst_paths = [future.result() for future in tiff_futures]
Copy link
Contributor

Choose a reason for hiding this comment

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

Cool! Be nice to add this to the SDK too: ASFHyP3/hyp3-sdk#113

@forrestfwilliams forrestfwilliams merged commit 3b29ace into develop Apr 13, 2023
@forrestfwilliams forrestfwilliams deleted the concurrent_download branch April 13, 2023 13:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Bump the patch version number of this project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants