fix: track written frames for traj2box step indices - #195
Open
galjos wants to merge 1 commit into
Open
Conversation
BoxWriter.write_box_file derived the step offset from the call count multiplied by the current trajectory length, assuming all previously written trajectories had the same number of frames. When traj2box was given input files of unequal length, the box file silently contained duplicated and skipped step indices. The writer now accumulates the number of frames actually written and uses that as the offset.
Contributor
|
PYLINT REPORT Your code has been rated at 9.78/10 Full reportRaw metrics
Duplication
Messages by category
% errors / warnings by module
Messages
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #195 +/- ##
=======================================
Coverage 93.94% 93.94%
=======================================
Files 177 177
Lines 9227 9230 +3
=======================================
+ Hits 8668 8671 +3
Misses 559 559
🚀 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.
The box writer derived the step offset from the current trajectory's length times the file counter, which is only correct when every input file has the same frame count. It now counts the frames actually written and uses that as the offset;
reset_counter=Trueresets it.The added test writes unequal trajectories and asserts the step sequence with and without the reset.
Fixes #194.