Skip to content

Commit 2e24778

Browse files
authored
Fix FutureWarning in vasp_utils.py
When parsing VASP directories using `parse_vasp_dir`, a FutureWarning appears: `FutureWarning: We strongly discourage using a default `mode`, it would be set to `r` now but would not be allowed after 2025-06-01` Suggested fix: Add explicit `mode='rt'` parameter to `zopen()` call in vasp_utils.py
1 parent d55f185 commit 2e24778

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

chgnet/utils/vasp_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def parse_vasp_dir(
6060

6161
charge, mag_x, mag_y, mag_z, header = [], [], [], [], []
6262

63-
with zopen(outcar_path, encoding="utf-8") as file:
63+
with zopen(outcar_path, mode="rt", encoding="utf-8") as file:
6464
all_lines = [line.strip() for line in file.readlines()]
6565

6666
# For single atom systems, VASP doesn't print a total line, so

0 commit comments

Comments
 (0)