fix: keep the constructor topology in TrajectoryReader.read - #187
Open
galjos wants to merge 1 commit into
Open
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #187 +/- ##
=======================================
Coverage 93.94% 93.94%
=======================================
Files 177 177
Lines 9227 9228 +1
=======================================
+ Hits 8668 8669 +1
Misses 559 559
🚀 New features to boost your workflow:
|
TrajectoryReader.read() unconditionally assigned its optional topology argument to self.topology, so calling read() without an argument reset the topology passed to the constructor back to None. As a consequence, read_trajectory(file, topology=...) silently ignored the given topology and rebuilt a guessed one from the file, replacing user-supplied atom types and residue ids. read() now only overrides the stored topology when one is explicitly given.
galjos
force-pushed
the
fix/reader-topology-override
branch
from
August 24, 2026 07:36
a65b7df to
b0524e9
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.
read()overwrote the constructor-supplied topology with its own defaultNone, soread_trajectorywith a topology silently ignored it. The parameter is now only assigned when given.The added test asserts atoms and residue ids from the constructor topology survive both
reader.read()andread_trajectory(file, topology=...).Fixes #186.