fix: repair test_ratio splitting and trajectory writing in NEPWriter - #197
Open
galjos wants to merge 1 commit into
Open
fix: repair test_ratio splitting and trajectory writing in NEPWriter#197galjos wants to merge 1 commit into
galjos wants to merge 1 commit into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #197 +/- ##
==========================================
+ Coverage 93.94% 96.08% +2.14%
==========================================
Files 177 177
Lines 9227 9230 +3
==========================================
+ Hits 8668 8869 +201
+ Misses 559 361 -198
🚀 New features to boost your workflow:
|
_setup_frame_splitting_for_training derived the split ratios only from total_ratios, so passing test_ratio alone divided by a zero frame sum and crashed with ZeroDivisionError while the requested ratio was ignored. The ratios are now taken directly from test_ratio when total_ratios is not given. write_from_trajectory also omitted the file argument when calling write_from_atomic_system, shifting the boolean flags into the file slot so every call raised a type error; the writer's own file handle is now passed explicitly.
galjos
force-pushed
the
fix/build-nep-traj
branch
from
August 24, 2026 07:36
4109811 to
6322198
Compare
Contributor
|
PYLINT REPORT Your code has been rated at 9.78/10 Full reportRaw metrics
Duplication
Messages by category
% errors / warnings by module
Messages
|
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.
_setup_frame_splitting_for_trainingnever used a plaintest_ratio, so the later division by the derived sum was zero over zero; andwrite_from_trajectoryomitted the file argument, shiftinguse_forcesinto the file slot and raising on every call. The ratio is now taken directly whentotal_ratiosis not given, and the file is passed through.Added one regression test per bug; a 4-frame trajectory with
test_ratio=0.25now yields 3 train and 1 test frames.Fixes #196.