Repository navigation
fix: unique log names when rerunning dcnum within the same second - #83
Merged
paulmueller merged 1 commit intoNov 23, 2026
Merged
Conversation
The logs of the input file are copied to the output file. When dcnum was run on its own output within the same second, the new "dcnum-job-<time>" and "dcnum-log-<time>" logs had the same names as the copied ones, and `store_log` raised a `ValueError`. A counter is now appended to the time string (e.g. "dcnum-job-<time>-1") if necessary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
paulmueller
approved these changes
Nov 23, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #83 +/- ##
==========================================
+ Coverage 88.19% 88.25% +0.05%
==========================================
Files 63 63
Lines 4524 4530 +6
==========================================
+ Hits 3990 3998 +8
+ Misses 534 532 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
When dcnum runs on its own output file, the logs of the input file are copied to the output file, including its "dcnum-job-" and "dcnum-log-". The new logs are named with a timestamp at second resolution. If the second run started within the same second as the first,
HDF5Writer.store_lograised:This shows up in scripts and tests that process small files back to back. It was found while verifying the bug hunt, where it made re-runs fail at random.
Fix
Before the job log is written,
run_pipelinechecks the logs already in the output file. If "dcnum-job-" or "dcnum-log-" exists, a counter is appended to the time string (<time>-1,<time>-2, …), and both new logs use the same suffix so they stay paired. Names do not change when there is no collision.Tests
test_duplicate_pipeline_same_secondfixestime.gmtime, runs the pipeline and then runs it again on its output. It fails on main with theValueErrorabove. Here it passes, and the output contains bothdcnum-job-<time>anddcnum-job-<time>-1(likewise for "dcnum-log").tests/test_logic_pipeline.pypass, run one per process locally.🤖 Generated with Claude Code