Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
for ss in system_index :
sys_output = glob.glob(os.path.join(work_path, "task.%s.*/output"%ss))
sys_input = glob.glob(os.path.join(work_path, "task.%s.*/input"%ss))
sys_output.sort()
sys_input.sort()
for idx, oo in enumerate(sys_output):
_sys = dpdata.LabeledSystem()
_sys.data['atom_names'], \
_sys.data['atom_numbs'], \
_sys.data['atom_types'], \
_sys.data['cells'], \
_sys.data['coords'], \
_sys.data['energies'], \
_sys.data['forces'], \
_sys.data['virials'] \
= dpdata.siesta.output.obtain_frame(oo)
if idx == 0:
all_sys = _sys
else:
all_sys.append(_sys)
sys_data_path = os.path.join(work_path, 'data.%s'%ss)
all_sys.to_deepmd_raw(sys_data_path)
all_sys.to_deepmd_npy(sys_data_path, set_size = len(sys_output))