Skip to content

Smarter file generation - #21

Merged
orlandoisepic merged 3 commits into
mainfrom
file-generation
Sep 21, 2026
Merged

orlandoisepic merged 3 commits into
mainfrom
file-generation

Conversation

@orlandoisepic

Copy link
Copy Markdown
Contributor

This resolves #5

Changes

  • A new class "StateTracker" has been added in precicecasegenerate/state_tracker. It maintains a dictionary storing hashes of created files.
  • Remove rmtree from the participant-solver directories, i.e., they are not deleted anymore in order for manually created files to survive 🏄‍♀️

Details

  • The state tracker tracks each generated file with its hash. If a user manually edits a generated file, the hash changes. Upon rerunning the case-generate, files with non-matching hashes are backed up to backups/current_time and a warning is displayed.
  • Previously, participant-solver directories were removed completely before being generated anew. This leads to loss of manually created files. This is now changed, i.e., the directory is not removed anymore. Manually created files will thus survive a re-run.

Add a new state tracker to prevent silent overwriting of files.
Use new file tacker and stop removing old directories. I think had added it to ensure that all present files are always new, but it also overwrites any manually created files, which is not so nice
@orlandoisepic
orlandoisepic merged commit 9465ae9 into main Sep 21, 2026
1 check passed
@orlandoisepic
orlandoisepic deleted the file-generation branch September 21, 2026 05:03
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.

Change overwriting of files during generation

1 participant