ai2_kit.tool.model_devi module#
- class ai2_kit.tool.model_devi.ModelDevi[source]#
Bases:
objectA 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
- Parameters:
out_file – the file path to write the statistics
fmt – the format of table, default is tsv
- grade(lo: float, hi: float, col: str = 'max_devi_f', outlier: Optional[float] = None)[source]#
Grade atoms based on the deviation of model into 3 levels: good, decent, poor
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 poor, otherwise, the level is decent. outlier is an independent indicator, default is 2 * hi if not provided.
- Parameters:
lo – the lower bound of decent level, below this value is good
hi – the upper bound of decent level, above this value is poor
col – the column of model deviation to grade, default is max_devi_f
outlier – the threshold of outlier, default is 2 * hi
- read(*dir_or_glob: str, traj_file: str, md_file='model_devi.out', ignore_error=False, **kwargs)[source]#
read model deviation from file, support multiple files and glob pattern
- Parameters:
dir_or_glob – path or glob pattern to locate data path
traj_file – trajectory file name to read, relative to data path, e.g dump.lammpstrj
md_file – model deviation file name to read, default is model_devi.out
ignore_error – ignore error when reading files
kwargs – other arguments for ase.io.read
- slice(expr: str)[source]#
Slice the atoms based on the expression
- Parameters:
expr – the expression to slice the atoms, e.g. ‘0:10’
- write(file_path: str, inplace=False, level='decent', ignore_error=False, **kwargs)[source]#
Write atoms to file based on the level of grading
- Parameters:
file_path – the file path to write
inplace – if True, write to the original data directory
level – the level of grading to write, default is decent
ignore_error – ignore error when writing files
kwargs – other arguments for ase.io.write