-
Notifications
You must be signed in to change notification settings - Fork 0
#47 Reduced runtime by 50% by reducing number of downloads when normalizing HREFs #48
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR aims to reduce runtime during STAC catalog normalization/saving by avoiding unnecessary blob downloads and by saving release-specific catalog content.
Changes:
- Updated
IStacService.save_catalog(...)(and call sites) to require areleaseargument and save release-specific output. - Introduced
skip_file_downloadonIStacIOService/StacIOServiceand toggled it during catalog saving. - Added (currently active)
cProfileimport inmain.pywith commented profiling invocation.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/presentation/entrypoints/release_pipeline.py | Passes release to catalog save and toggles skip_file_download during save. |
| src/infra/infrastructure/services/stac_service.py | Reworks catalog save logic to normalize/save a release subtree. |
| src/infra/infrastructure/services/stac_io_service.py | Adds skip_file_download flag plumbing and minor refactor around upload checks. |
| src/application/contracts/stac_service_interface.py | Updates service contract to require release in save_catalog. |
| src/application/contracts/stac_io_service_interface.py | Adds skip_file_download to the STAC IO interface. |
| main.py | Adds cProfile import and leaves a commented profiling line. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This pull request introduces several improvements to the STAC catalog handling and release pipeline, focusing on more precise catalog saving for releases, enhanced control over file download behavior, and interface updates to support these changes. The most significant updates are grouped below.
STAC Catalog Saving and Release Handling:
save_catalogmethod in both theIStacServiceinterface and its implementation now requires areleaseparameter, ensuring that catalog saving is release-specific and that only the appropriate release subtree is saved. [1] [2] [3] [4]save_catalogimplementation now clones the catalog, isolates the relevant release, normalizes hrefs, and updates the catalog structure before saving, improving the integrity and organization of release catalogs.File Download Control in STAC IO Service:
skip_file_downloadproperty (with getter and setter) to theIStacIOServiceinterface and itsStacIOServiceimplementation, allowing the pipeline to temporarily disable file downloads during catalog save operations for efficiency. [1] [2] [3]save_catalogfunction in the pipeline now setsskip_file_downloadtoTruebefore saving and resets it toFalseafterward, preventing unnecessary file downloads during the operation.Interface and Dependency Injection Updates:
releaseparameter and theIStacIOServicedependency, ensuring the correct services and parameters are used. [1] [2] [3]Miscellaneous:
cProfileinmain.pyfor profiling support during development. [1] [2]