Skip to content

Commit

Permalink
Use fixed number of digits for kpoints
Browse files Browse the repository at this point in the history
Otherwise, the kpoints coordinates can be 0.49999 instead of 0.5
  • Loading branch information
qiaojunfeng committed May 10, 2024
1 parent fb74455 commit f1e2626
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/aiida_wannier90/io/_write_win.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,12 @@ def _format_kpoint_path(kpoint_path):
for point1, point2 in path:
coord1 = point_coords[point1]
coord2 = point_coords[point2]
path_line = f"{point1} {coord1[0]} {coord1[1]} {coord1[2]} "
path_line += f" {point2} {coord2[0]} {coord2[1]} {coord2[2]}"
path_line = (
f"{point1} {coord1[0]:14.10f} {coord1[1]:14.10f} {coord1[2]:14.10f} "
)
path_line += (
f" {point2} {coord2[0]:14.10f} {coord2[1]:14.10f} {coord2[2]:14.10f}"
)
res.append(path_line)
return res

Expand Down

0 comments on commit f1e2626

Please sign in to comment.