24 implement better way to avoid overwriting h5 files#83
Merged
jwaiton merged 14 commits intoMay 11, 2026
Merged
Conversation
increase threshold and add warning to counter
Use timestamp naming in file creation when overwrite is false. Have user input to double check overwriting.
overwrite specifically
jwaiton
requested changes
May 8, 2026
Member
jwaiton
left a comment
There was a problem hiding this comment.
Good work! Just a few minor tweaks :)
Comment on lines
+160
to
+163
| assert found_path != data_path | ||
| assert found_path.endswith('.h5') | ||
| assert re.search(r'_\d{8}_\d{6}', found_path), "Expected datetime stamp in filename" | ||
| assert not os.path.exists(found_path), "Path should not already exist" |
Member
There was a problem hiding this comment.
This is no longer direct testing, which is fine but it should be noted.
instead of a local variable
mock fixed datetime for module
jwaiton
reviewed
May 11, 2026
Comment on lines
-71
to
80
| # run processing pack decode | ||
| run_pack = [sys.executable, MULE_dir + "/bin/mule", "proc", config_path] | ||
| subprocess.run(run_pack) | ||
| # check that the resulting dataframe is as expected | ||
|
|
||
| assert load_evt_info(save_path).equals(load_evt_info(comparison_path)) | ||
| assert load_rwf_info(save_path, samples).equals(load_rwf_info(comparison_path, samples)) | ||
|
|
||
| finally: | ||
| # rewrite config file to original state | ||
| with open(config_path, "w") as f: | ||
| f.write(original_content) |
Member
There was a problem hiding this comment.
put these comments back naughty naughty
jwaiton
reviewed
May 11, 2026
73bc0b9 to
e0bbdbf
Compare
jwaiton
approved these changes
May 11, 2026
Member
jwaiton
left a comment
There was a problem hiding this comment.
This PR implements a nicer way yo avoid overwriting h5 files, and includes datetime nomenclature for the created files, good work!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changed h5 file overwriting to append datetime to saved filenames. Appends '_YYYYMMDD_HHMMSS' to file names plus '_N' in the unlikely case of duplicates.