diff --git a/PQAnalysis/io/traj_file/frame_reader.py b/PQAnalysis/io/traj_file/frame_reader.py index 1a615ce..ebdb00d 100644 --- a/PQAnalysis/io/traj_file/frame_reader.py +++ b/PQAnalysis/io/traj_file/frame_reader.py @@ -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. diff --git a/PQAnalysis/io/traj_file/trajectory_reader.py b/PQAnalysis/io/traj_file/trajectory_reader.py index 2829aa8..e1fa84b 100644 --- a/PQAnalysis/io/traj_file/trajectory_reader.py +++ b/PQAnalysis/io/traj_file/trajectory_reader.py @@ -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] @@ -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