Skip to content

Commit

Permalink
remove unnecessary seek
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielYang59 committed Dec 6, 2024
1 parent b8d3b75 commit 448ec77
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions tests/phonon/test_thermal_displacements.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,8 +199,7 @@ def test_beta(self):
def test_write_file(self):
printed = False
self.thermal.write_cif(f"{self.tmp_path}/U.cif")
with open(f"{self.tmp_path}/U.cif") as file:
file.seek(0) # set position to start of file
with open(f"{self.tmp_path}/U.cif", encoding="utf-8") as file:
lines = file.read().splitlines() # now we won't have those newlines
if "_atom_site_aniso_U_12" in lines:
printed = True
Expand Down Expand Up @@ -335,7 +334,7 @@ def test_visualization_directionality_criterion(self):
self.thermal.visualize_directionality_quality_criterion(
filename=f"{self.tmp_path}/U.vesta", other=self.thermal, which_structure=0
)
with open(f"{self.tmp_path}/U.vesta") as file:
with open(f"{self.tmp_path}/U.vesta", encoding="utf-8") as file:
file.seek(0) # set position to start of file
lines = file.read().splitlines() # now we won't have those newlines
if "VECTR" in lines:
Expand Down

0 comments on commit 448ec77

Please sign in to comment.