File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -218,6 +218,23 @@ def make_abacus_scf_stru(
218218 if type_map is None :
219219 type_map = sys_data_copy ["atom_names" ]
220220
221+ missing_atoms = set (sys_data_copy ["atom_names" ]) - set (type_map )
222+ if len (missing_atoms ) > 0 :
223+ raise ValueError (
224+ f"Some atoms in sys_data are not in type_map: { missing_atoms } . "
225+ "Please provide a valid type_map."
226+ )
227+
228+ if len (fp_pp_files ) != len (type_map ):
229+ raise ValueError (
230+ "The length of fp_pp_files should be equal to the length of type_map."
231+ )
232+ if fp_orb_files is not None and len (fp_orb_files ) != len (type_map ):
233+ raise ValueError (
234+ "The length of fp_orb_files should be equal to the length of type_map."
235+ )
236+
237+
221238 fp_pp_files = [
222239 os .path .join (pporb , fp_pp_files [type_map .index (atom_name )])
223240 for atom_name in sys_data_copy ["atom_names" ]
You can’t perform that action at this time.
0 commit comments