ai2_kit.tool.model_devi module

ai2_kit.tool.model_devi module#

class ai2_kit.tool.model_devi.ModelDevi(atoms_arr: List[Atoms], md_arr: List[Tuple[DataFrame, str]])[source]#

Bases: object

A tool to analyze the deviation of model from model deviation file of deepmd-kit

dump_stats(out_file: str = '', fmt='tsv')[source]#

Dump the statistics of grading

grade(lo: float, hi: float, col: str = 'max_devi_f')[source]#

Grade atoms based on the deviation of model: the good, the bad and the ugly the grade is based on the column of max_devi_f by default, if the value is below lo, the level is good, if the value is above hi, the level is ugly, otherwise, the level is bad

Parameters:
  • lo – the lower bound of good level

  • hi – the upper bound of ugly level

  • col – the column of model deviation to grade, default is max_devi_f

static md_arr_load(*files: str) List[Tuple[DataFrame, str]][source]#

Load model deviation files

to_ase(level)[source]#

Hand over the atoms to ase tool

Parameters:

level – the grade level to hand over, valid values are good, bad, ugly