Replies: 1 comment 3 replies
-
Able to convert raw format to quip/gap/xyz Thank you |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Convert deepmd/npy or deepmd/raw format to quip/gap/xyz format
Help will be really appreciated :)
import dpdata
dp_multi_systems = dpdata.MultiSystems.from_dir(
dir_name="./dp/", file_name="./Al*", fmt="deepmd/raw"
)
print(dp_multi_systems)
import os
from dpdata import LabeledSystem
output_dir = "./xyz"
os.makedirs(output_dir, exist_ok=True)
for idx, system in enumerate(dp_multi_systems.systems.values()):
output_path = os.path.join(output_dir, f"system_{idx}.xyz")
try:
system.to(fmt="xyz", file_name=output_path)
print(f"Saved {output_path}")
except Exception as e:
print(f"Failed to save {output_path}: {e}")
it is able to convert only the coordinates. can it convert all?
Beta Was this translation helpful? Give feedback.
All reactions