diff --git a/models/mace/json_to_extxyz.py b/models/mace/json_to_extxyz.py index 3be497df..ad726f66 100644 --- a/models/mace/json_to_extxyz.py +++ b/models/mace/json_to_extxyz.py @@ -5,12 +5,11 @@ import numpy as np import wget -from tqdm.auto import tqdm - from ase import units from ase.io import read, write from pymatgen.core import Structure from pymatgen.io.ase import AseAtomsAdaptor +from tqdm.auto import tqdm __author__ = "Yuan Chiang" __date__ = "2023-08-10" @@ -18,7 +17,7 @@ mptrj_path = wget.download("https://figshare.com/ndownloader/files/41619375") # mptrj_path = "./MPtrj_2022.9_full.json" -with open(mptrj_path, "r") as f: +with open(mptrj_path) as f: json_data = json.load(f) pretty_json_string = json.dumps(json_data, indent=4, ensure_ascii=False) @@ -27,7 +26,7 @@ mptrj_extxyz_prefix = osp.join(os.curdir, "mptrj-gga-ggapu") os.makedirs(mptrj_extxyz_prefix, exist_ok=True) -with open(mptrj_pretty_path, "r") as f: +with open(mptrj_pretty_path) as f: json_data = json.load(f) combined = []