mxene.organize package

Submodules

mxene.organize.disk module

mxene.organize.disk.make_disk(disk, terminal, base, carbide_nitride, n_base, doping, site_name, absorb=None, equ_name=None, add_atoms=None, base_num_cls=None, super_cell=None, terminal_site=None, ts_name='all', old_type=True) Path

Organize the name to one path.

mxene.organize.grid module

mxene.organize.mx_org module

** This script is used to reorganize the MXenes folder **

  1. This code can be used as a script alone, need to install python3, if you need to obtain the recommended path, need to install pymatgen,ase,mxene and other packages.

  2. This code does not change the file content, but only adjusts the directory (pay attention to the data backup first, ensure that everything is correct, and then delete the original folder).

  3. If the code fails to pass after analysis, add the un_mark.txt file to the path to output the necessary information.

  4. If both the optimization structure folder and the static computing folder exist, only the static computing (not added, under development) is saved by default.

  5. After sorting out the data, the data cannot appear in the same folder, that is, the calculation file and the sub-folder, (except for auxiliary files).

  6. All un-calculated or un_mark data is not recommended to be uploaded to the database.

  7. This script can be distributed freely and can be used freely. The version in the mxene package is the source version. If you need to change the source version of any bug or important content, please Contact me.

The final unified folder format.

** (1) does not adsorb **

MXenes -> Basal number classification -> Base name -> Load content -> Dopant -> pure/pure_static

Examples

MXenes -> M2C -> Ti2NO2 -> no_add -> no_doping -> pure/pure_static

MXenes -> M2N -> Ti2NO2 -> no_add -> Mo -> pure/pure_static

Examples (New):

MXenes -> M2C -> Ti2NO2 -> no_add -> no_doping -> no_absorb -> fcc(O-site) -> pure/pure_static

** (2) adsorption **

MXenes -> Basal number classification -> Base name -> Load content -> Dopant -> Adsorb -> site -> label

Examples

MXenes -> M2N -> Ti2NO2 -> no_add -> no_dopin -> H/add_H -> top -> opt

MXenes -> M3N2 -> TiNCrNTi-O2 -> Hf -> C -> Li -> S0 -> opt

** (3)NEB **

MXenes -> Basal number classification -> Base name -> Load content -> Dopant -> Adsorb -> Equivalent site -> Path name

Examples

MXenes -> M2N -> Ti2NO2 -> no_add -> no_doping -> H -> S0-S1 -> 00/01/01/03/04/ini/fin/…

‘->’ represents the ‘next level’. ‘/’ means ‘or’.

mxene.organize.mx_org.check_convergence(pt: Union[str, Path, PathLike, Path], msg=None)

Check final energy. Check the structure for convergence.

Parameters:
  • pt – (str, path.Path, os.PathLike,pathlib.Path), path

  • msg – (list of str), message.

Returns:

(tuple), bool and msg list

Return type:

res

mxene.organize.mx_org.check_mx_data(pt, ck_pt=True, ck_conver=True, ck_st=True, get_rcmd_pt=True, check_vasp=True, out_file='un_mark.txt')

Check MXene data in total.

Parameters:
  • pt – pt: (str, path.Path, os.PathLike,pathlib.Path), path.

  • ck_pt – (bool), check path.

  • ck_conver – (bool),check convergence.

  • ck_st – (bool), check structure.

  • get_rcmd_pt – (bool), check recommend path.

  • out_file – (str), out file name.

  • check_vasp – (bool), vasprun.xml.

mxene.organize.mx_org.check_pt(pt: Union[str, Path, PathLike, Path], msg=None)

Check the path is in standard.

Parameters:
  • msg – (list), message.

  • pt – (str, path.Path, os.PathLike,pathlib.Path), path of leaf node.

Returns:

(tuple), bool and msg list.

Return type:

res

mxene.organize.mx_org.check_structure_contcar(pt: Union[str, Path, PathLike, Path], msg=None)

Check that the POSCAR, CONTCAR constructs correspond.

Parameters:
  • pt – (str, path.Path, os.PathLike,pathlib.Path), path

  • msg – (list of str), message.

Returns:

(tuple), bool and msg list

Return type:

res

mxene.organize.mx_org.check_vasprun(pt: Union[str, Path, PathLike, Path], msg=None)

Check final energy with vasprun.xml.

Parameters:
  • pt – (str, path.Path, os.PathLike,pathlib.Path), path

  • msg – (list of str), message.

Returns:

(tuple), bool and msg list

Return type:

res

mxene.organize.mx_org.comparison(pt)

print if path is not standard.

mxene.organize.mx_org.copy_disk(old_pt: Union[str, Path], new_pt: Union[str, Path], file=True, disk=False, cover=False, remove=False)

Copy files,disks of old path to new path. Copy the subfiles in the old path and the sub-folders in the new path.

Parameters:
  • old_pt – (str, path.Path, os.PathLike,pathlib.Path), old path

  • new_pt – (str, path.Path, os.PathLike,pathlib.Path), new path

  • file – (bool), copy file.

  • disk – (bool), copy sub-disk.

  • cover – (bool), cover the exist data.

  • remove – (bool), remove the old path.

mxene.organize.mx_org.get_recommend_path(pt: Union[str, Path, PathLike, Path], **kwargs)

Get recommend path.

Based on the structure, get the recommended path (not necessarily correct, need to check).

The mxene package is required:

pip install mxene

Parameters:
  • pt – (str, path.Path, os.PathLike,pathlib.Path), path

  • msg – (list of str), message.

Returns:

(tuple), bool and msg list

Return type:

res

mxene.organize.mx_org.path_regroup(pt: Union[str, Path, PathLike, Path], base_name: Union[tuple, int, None, str] = 1, add: Union[tuple, int, None, str] = 2, doping: Union[tuple, int, None, str] = 3, absorb: Union[tuple, int, None, str] = 4, site: Union[tuple, int, None, str] = 5, label: Union[tuple, int, None, str] = 6, base_num_class: Union[tuple, int, None, str] = None, prefix=None, **kwargs) Path

Re-group the disk.

重新组织文件夹,使用序号标记文件层,使得最终为:

MXenes -> 0 -> 1 -> 2 -> 3 -> 4 -> 5 -> 6 MXenes -> 基底层数分类 -> 基底名称 -> 负载物 -> 搀杂物 -> 吸附物/pure_* -> 等效位点/路径 -> 标签 例如: MXenes -> base_num_class -> base_name -> add -> doping -> absorb -> site -> label MXenes -> base_num_class -> base_name -> add -> doping -> pure

1.若输入序号n,则代表使用旧文件夹的第n层作为名称. 2.若输入None,则代表跳过,将使用(掺杂no_doping,负载no_add,吸附no_absorb). 3.若输入字符串,则该层直接使用该名称.

Examples:

>>> path_regroup(pt=r"E:/x/MXenes/M2C/M2XO2-TM/Hf/C/Au/2",
...             base_name=1, add=2,doping=3,absorb=4,site=5,label="00")
>>> path_regroup(pt=r"E:/x/MXenes/M2XO2-TM/Hf/C/Au/2",base_num_class="M2C",
...             base_name=0, add=1,doping=2,absorb=3,site=4,label="00")
Parameters:
  • pt – (str, path.Path, os.PathLike,pathlib.Path), path of leaf node.

  • base_name – (tuple,int,None,str), layer of base structure name.

  • add – (tuple,int,None,str), layer of add atom.

  • doping – (tuple,int,None,str), layer of doping atom.

  • absorb – (tuple,int,None,str), layer of absorb atom.

  • site – (tuple,int,None,str), layer of site name.

  • label – (tuple,int,None,str), layer of label name.

  • base_num_class – (tuple,int,None,str), label of MXenes system.

  • prefix – (str,None), Move to other path.

  • **kwargs – keywords are formed “func_*”, such as “fun_base_name”, and the value are one function.

Returns:

(path.Path), new path

Return type:

new_pt