Skip to content

Add skip logic if products already exist and generate only WTR water gain maps#43

Merged
ehavazli merged 3 commits intoOPERA-Cal-Val:mainfrom
cmspeed:add-skip
Apr 1, 2026
Merged

Add skip logic if products already exist and generate only WTR water gain maps#43
ehavazli merged 3 commits intoOPERA-Cal-Val:mainfrom
cmspeed:add-skip

Conversation

@cmspeed
Copy link
Copy Markdown
Collaborator

@cmspeed cmspeed commented Mar 25, 2026

This PR adds simple logic to check if a mosaic, difference map, or flood extent map exists in the directory prior to generating it. This is helpful if the processing was interrupted previously, as it allows the processing to resume where it left off. Also added here is a step to ensure water_gain maps are only generated for WTR layers.

Changes

  • Added path.exists() checks in pipeline.py and layout.py to determine if products by that name already exist. If so, skip product generation.
  • Added logic to ensure water_gain maps are only generated from the WTR layer (and not BWTR).

@cmspeed cmspeed requested a review from ehavazli March 25, 2026 03:20
@cmspeed cmspeed changed the title Add logic to skip if products already exist Add logic to skip if products already exist and generate only WTR water gain maps Mar 25, 2026
@cmspeed cmspeed changed the title Add logic to skip if products already exist and generate only WTR water gain maps Add skip logic if products already exist and generate only WTR water gain maps Mar 25, 2026
@ehavazli
Copy link
Copy Markdown
Collaborator

adding option to overwrite (or not) would be better. Implemented behavior in this PR can cause confusion and doesn't offer a solution to rewrite files.

@cmspeed
Copy link
Copy Markdown
Collaborator Author

cmspeed commented Mar 31, 2026

adding option to overwrite (or not) would be better. Implemented behavior in this PR can cause confusion and doesn't offer a solution to rewrite files.

Thanks for pointing this out @ehavazli. A new flag, --skip-exisiting has been added to let the user decide if they would rather skip or overwrite existing files.

Copy link
Copy Markdown
Collaborator

@ehavazli ehavazli left a comment

Choose a reason for hiding this comment

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

looks good

@ehavazli ehavazli merged commit 8dfd2ea into OPERA-Cal-Val:main Apr 1, 2026
@cmspeed cmspeed deleted the add-skip branch April 2, 2026 17:00
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.

2 participants