This issue is a result of a Codex global code scan of deepmodeling/fpop at commit b05b337590c31a5237b2dcbd9c0833b841c08cd4.
Relevant code:
|
inputs = op_in['inputs'] |
|
confs = op_in['confs'] |
|
type_map = op_in['type_map'] |
|
prepare_image_config = op_in["prep_image_config"] |
|
optional_artifact = op_in["optional_artifact"] |
|
optional_input = op_in["optional_input"] |
|
try: |
|
conf_format = optional_input["conf_format"] |
|
except: |
|
conf_format = "deepmd/npy" |
|
|
|
task_names = [] |
|
task_paths = [] |
|
|
|
#System |
|
counter = 0 |
|
# loop over list of System |
|
for system in confs: |
|
ss = dpdata.System(system, fmt=conf_format, labeled=False) |
|
for ff in range(ss.get_nframes()): |
|
nn, pp = self._exec_one_frame(counter, inputs, ss[ff], prepare_image_config, optional_input, optional_artifact) |
|
for nn in atom_names: |
|
potcar_contents.append(self._potcars[nn]) |
|
return "".join(potcar_contents) |
|
|
|
def make_kpoints( |
|
self, |
|
box : np.ndarray, |
|
) -> str: |
|
return make_kspacing_kpoints(box, self.kspacing, self.kgamma) |
Problem:
PrepFp.execute() reads type_map from op_in, but the value is never passed to dpdata.System(...). For deepmd/npy inputs that contain type.raw but do not contain type_map.raw, dpdata loads atom names as synthetic names such as Type_0 and Type_1.
That breaks downstream preparation. For example, VASP POTCAR generation indexes the pseudopotential map by atom_names, so VaspInputs.make_potcar() can raise KeyError: 'Type_0' even though the workflow input provided type_map=["H", "O"].
Minimal reproduction:
s1 = dpdata.System(root, fmt="deepmd/npy", labeled=False)
print(s1["atom_names"])
# ['Type_0', 'Type_1']
s2 = dpdata.System(root, fmt="deepmd/npy", labeled=False, type_map=["H", "O"])
print(s2["atom_names"])
# ['H', 'O']
Expected behavior:
PrepFp.execute() should preserve the workflow-provided type_map when loading configurations, or otherwise map dpdata's synthetic names before calling backend-specific prep_task() implementations.
This issue is a result of a Codex global code scan of
deepmodeling/fpopat commitb05b337590c31a5237b2dcbd9c0833b841c08cd4.Relevant code:
fpop/fpop/prep_fp.py
Lines 121 to 141 in b05b337
fpop/fpop/vasp.py
Lines 90 to 98 in b05b337
Problem:
PrepFp.execute()readstype_mapfromop_in, but the value is never passed todpdata.System(...). Fordeepmd/npyinputs that containtype.rawbut do not containtype_map.raw, dpdata loads atom names as synthetic names such asType_0andType_1.That breaks downstream preparation. For example, VASP POTCAR generation indexes the pseudopotential map by
atom_names, soVaspInputs.make_potcar()can raiseKeyError: 'Type_0'even though the workflow input providedtype_map=["H", "O"].Minimal reproduction:
Expected behavior:
PrepFp.execute()should preserve the workflow-providedtype_mapwhen loading configurations, or otherwise map dpdata's synthetic names before calling backend-specificprep_task()implementations.