Skip to content

Commit 1cc8aa6

Browse files
authored
Conditional loading of POTCAR and MAGMOM dictionaries
Load POTCAR and MAGMOM dictionaries conditionally based on the READTHEDOCS environment variable.
1 parent 13e99e1 commit 1cc8aa6

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

dfttk/vasp_input.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,16 @@
1717
yaml_dir = os.path.dirname(__file__)
1818
potcar_dict_path = os.path.join(yaml_dir, "settings/potcar_dict.yaml")
1919
magmom_dict_path = os.path.join(yaml_dir, "settings/magmom_dict.yaml")
20-
with open(potcar_dict_path, "r") as file:
21-
POTCAR_DICT = yaml.safe_load(file)
2220

23-
with open(magmom_dict_path, "r") as file:
24-
MAGMOM_DICT = yaml.safe_load(file)
21+
if not os.environ.get("READTHEDOCS"):
22+
with open(potcar_dict_path, "r") as file:
23+
POTCAR_DICT = yaml.safe_load(file)
24+
25+
with open(magmom_dict_path, "r") as file:
26+
MAGMOM_DICT = yaml.safe_load(file)
27+
else:
28+
POTCAR_DICT = {}
29+
MAGMOM_DICT = {}
2530

2631

2732
def base_set(

0 commit comments

Comments
 (0)