Skip to content

Commit

Permalink
Merge pull request #98 from MolarVerse/feature/xyzReader_performance
Browse files Browse the repository at this point in the history
Feature/xyz reader performance
  • Loading branch information
galjos authored Jun 5, 2024
2 parents 8070f51 + 254e3df commit 1630aca
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion PQAnalysis/io/traj_file/frame_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@ def _check_qmcfc(
return value, atoms

def _get_topology(
self, atoms: List[str], topology: Topology | None
self,
atoms: List[str],
topology: Topology | None,
) -> Topology:
"""
Returns the topology of the frame.
Expand Down
4 changes: 2 additions & 2 deletions PQAnalysis/io/traj_file/trajectory_reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ def frame_generator(
# then increment the frame index
frame_index += 1

if self.constant_topology and self.topology is not None:
if self.constant_topology and self.topology is None:
self.topology = frame.topology

frame_lines = [line]
Expand All @@ -277,7 +277,7 @@ def frame_generator(
# then increment the frame index
frame_index += 1

if self.constant_topology and self.topology is not None:
if self.constant_topology and self.topology is None:
self.topology = frame.topology

@runtime_type_checking
Expand Down

0 comments on commit 1630aca

Please sign in to comment.