Bug summary
With model_devi_f_avg_relative=True, DP-GEN writes an additional model_devi_avgf.out file into every model-deviation task directory. On the next selection step, _read_model_devi_file() currently uses glob("model_devi*.out") and assumes every match has the form model_devi<digits>.out. The generated normalization file does not match that pattern, so selection crashes with:
AttributeError: 'NoneType' object has no attribute 'group'
Absolute model deviation does not trigger this because only model_devi.out exists.
Environment
- DP-GEN
0.13.4.dev17+gd481bfb8b
- DeePMD-kit 3.2.0
- PyTorch-exportable PT2 models
model_devi_f_avg_relative=True
model_devi_f_trust_lo=0.5, model_devi_f_trust_hi=1.0
Reproduction
- Run a LAMMPS model-deviation task with
model_devi_f_avg_relative=True and model_devi_merge_traj=True.
- Let DP-GEN write both
model_devi.out and model_devi_avgf.out.
- Resume or reach
make_fp, which calls _select_by_model_devi_standard().
_read_model_devi_file() matches both files and the numeric-suffix regex fails.
Suggested fix
Match the base file separately and only match numbered bead outputs, e.g. model_devi.out plus model_devi[0-9]*.out, or make the sort key accept the base filename. Add a regression test where model_devi.out and model_devi_avgf.out coexist.
I reproduced this in a real Neo DP-GEN run and applied the minimal file-match fix locally; the relative selection then completed successfully.
Bug summary
With
model_devi_f_avg_relative=True, DP-GEN writes an additionalmodel_devi_avgf.outfile into every model-deviation task directory. On the next selection step,_read_model_devi_file()currently usesglob("model_devi*.out")and assumes every match has the formmodel_devi<digits>.out. The generated normalization file does not match that pattern, so selection crashes with:Absolute model deviation does not trigger this because only
model_devi.outexists.Environment
0.13.4.dev17+gd481bfb8bmodel_devi_f_avg_relative=Truemodel_devi_f_trust_lo=0.5,model_devi_f_trust_hi=1.0Reproduction
model_devi_f_avg_relative=Trueandmodel_devi_merge_traj=True.model_devi.outandmodel_devi_avgf.out.make_fp, which calls_select_by_model_devi_standard()._read_model_devi_file()matches both files and the numeric-suffix regex fails.Suggested fix
Match the base file separately and only match numbered bead outputs, e.g.
model_devi.outplusmodel_devi[0-9]*.out, or make the sort key accept the base filename. Add a regression test wheremodel_devi.outandmodel_devi_avgf.outcoexist.I reproduced this in a real Neo DP-GEN run and applied the minimal file-match fix locally; the relative selection then completed successfully.