Skip to content

Comments

Add early atlas output check with overwrite option#733

Merged
adamltyson merged 9 commits intobrainglobe:mainfrom
AlgoFoe:error-catch
Jan 12, 2026
Merged

Add early atlas output check with overwrite option#733
adamltyson merged 9 commits intobrainglobe:mainfrom
AlgoFoe:error-catch

Conversation

@AlgoFoe
Copy link
Contributor

@AlgoFoe AlgoFoe commented Jan 1, 2026

Description

What is this PR

  • Bug fix
  • Addition of a new feature
  • Other

Why is this PR needed?

  • Atlas generation could fail only at the very end if an atlas output directory already existed, this PR ensures such cases are detected early.

What does this PR do?

  • Adds an early check for existing atlas output directories in wrapup_atlas_from_data and introduces an overwrite option to explicitly replace them when needed.

References

How has this PR been tested?

  • Tested locally by simulating existing atlas output directories.

Is this a breaking change?

  • No, default behavior remains unchanged and the new overwrite flag is optional

Does this PR require an update to the documentation?

  • No

Checklist:

  • The code has been tested locally
  • Tests have been added to cover all new functionality (unit & integration)
  • The documentation has been updated to reflect any changes
  • The code has been formatted with pre-commit

@adamltyson
Copy link
Member

Hey @AlgoFoe, thanks for this. While this is useful, it doesn't entirely fix the issue. Most of the time consuming steps take place before this wrap up script is run.

@PolarBean's original issue mentions adding a check to the start of the template script so the issue can be caught earlier. Would you mind adding something there too?

@adamltyson adamltyson self-requested a review January 7, 2026 17:06
@AlgoFoe
Copy link
Contributor Author

AlgoFoe commented Jan 7, 2026

Hey @AlgoFoe, thanks for this. While this is useful, it doesn't entirely fix the issue. Most of the time consuming steps take place before this wrap up script is run.

@PolarBean's original issue mentions adding a check to the start of the template script so the issue can be caught earlier. Would you mind adding something there too?

Hey @adamltyson, thanks for the review!
I will add an early existence check to the template script as well and push an update shortly.

@AlgoFoe
Copy link
Contributor Author

AlgoFoe commented Jan 7, 2026

Just pushed the requested updates and also added minimal tests to cover the wrapup output-check logic.

Copy link
Member

@adamltyson adamltyson left a comment

Choose a reason for hiding this comment

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

Great, once again, thank you @AlgoFoe!

@adamltyson adamltyson merged commit 0987863 into brainglobe:main Jan 12, 2026
13 checks passed
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.

[Feature] catch existing atlas files early in atlas generation script rather than at the end

2 participants