ectoolkits.utils.utils module#

this script put misc function here.

ectoolkits.utils.utils.create_path(path, bk=False)[source]#
create ‘path’ directory. If ‘path’ already exists, then check ‘bk’:

if ‘bk’ is True, backup original directory and create new directory naming ‘path’; if ‘bk’ is False, do nothing.

Parameters:
  • path ('str' or 'os.path') – The direcotry you are making.

  • bk (bool, optional) – If . Defaults to False.

ectoolkits.utils.utils.file_content(file, num)[source]#
ectoolkits.utils.utils.get_cum_mean(array)[source]#
ectoolkits.utils.utils.get_rdf(pos, r, nbin, frames, elements)[source]#
ectoolkits.utils.utils.get_rdf_list(pos, r, nbin, frames, elements)[source]#

pos: a list of atoms object r: the radial length nbin: the bin number in the radial range frames: how much pos number will you consider elements: the atom pair

ectoolkits.utils.utils.insert_water(atoms, z1, z2, water_num, model='random', space_x=0.3, space_y=0.3, space_z=0.3)[source]#
ectoolkits.utils.utils.mic_1d(array: ndarray[Any, dtype[float64]], cell: float)[source]#

always refer to the first element of the array

ectoolkits.utils.utils.random() x in the interval [0, 1).#
ectoolkits.utils.utils.set_pbc(pos, cell)[source]#

set pbc for a list of Atoms object