Skip to content

Commit

Permalink
fix linter json E0s
Browse files Browse the repository at this point in the history
  • Loading branch information
ilyes319 committed Aug 12, 2024
1 parent 562f760 commit 81c02b4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mace/tools/scripts_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,8 @@ def get_atomic_energies(E0s, train_collection, z_table) -> dict:
else:
if E0s.endswith(".json"):
logging.info(f"Loading atomic energies from {E0s}")
atomic_energies_dict = json.load(open(E0s, "r"))
with open(E0s, "r", encoding="utf-8") as f:
atomic_energies_dict = json.load(f)
else:
try:
atomic_energies_dict = ast.literal_eval(E0s)
Expand Down

0 comments on commit 81c02b4

Please sign in to comment.