amd.utils module
General utility functions and classes.
- amd.utils.cellpar_to_cell(a, b, c, alpha, beta, gamma)
Simplified version of function from ase.geometry.
Unit cell params a,b,c,α,β,γ –> cell as 3x3 ndarray.
- amd.utils.cellpar_to_cell_2D(a, b, alpha)
- amd.utils.random_cell(length_bounds=(1, 2), angle_bounds=(60, 120), dims=3)
- class amd.utils.ETA(to_do, update_rate=100)
Bases:
object
Pass total amount to do on construction, then call .update() on every loop. ETA will estimate an ETA and print it to the terminal.
- update()
Call when one item is finished.
- amd.utils.extract_tags(periodic_sets) dict
Return
dict
with scalar data in the tags of PeriodicSets in the passed list.Dict is in format passable to
pandas.DataFrame
, as in:periodic_sets = list(amd.SetReader('periodic_sets.hdf5')) names = [s.name for s in periodic_sets] data = amd.utils.extract_tags(periodic_sets) df = pd.DataFrame(data, index=names, columns=data.keys())
Format of returned dict is for example:
{ 'density': [1.231, 2.532, ...], 'family': ['CBMZPN', 'SEMFAU', ...], ... }
where the inner lists have the same order as the items in
periodic_sets
.