airsspy.seed#

Classes for preparing AIRSS seed

Module Contents#

Classes#

SeedAtoms

Subclass of ase.atoms.Atoms object. Template for generating random cells

BoolTag

Descriptor for tag-like properties (boolean flags)

GenericTag

Descriptor for generic properties (any value type)

RangeTag

Descriptor for range properties (number or tuple of two numbers)

NestedRangeTag

Descriptor for nested range properties (tuple/list of two elements)

TagHolder

Container for the tags

BuildcellParam

A class for storing parameters for the Buldcell program

SeedAtomTag

Tags for a single atom

SeedAtom

Element atoms in a AIRSS seed

Functions#

tuple2range

Return the string for a given value. If the value is a tuple make it a range.

get_cell_inp

Get the CellInput holder for a given seed

get_cell_inp_lines

Write the seed to a file handle

API#

class airsspy.seed.SeedAtoms(*args: Any, **kwargs: Any)[source]#

Bases: ase.Atoms

Subclass of ase.atoms.Atoms object. Template for generating random cells

Initialization

Initialise an SeedAtoms for buildcell. Same arguments signature as ase.Atoms object

Special attribute: gentags : BuildcellParam instance for storing parameter of buildcell

You can set the global buildcell tags by setting attributes of the gentags instance.

Per-atom generation tags are saved in an array called ‘atom_gentags’. They can be retrieved using get_atom_tag or set with set_atom_tag. The atom_tags attribute also provide a convient way of accessing.

set_atom_tag(tag: airsspy.seed.SeedAtomTag, index: int) None[source]#

Set buildcell tags for individual atom if the SeedAtomTag object has no tagname, set automatically

get_atom_tag(index: int) Any[source]#

Return the buildcell tag for the atom of the index. Can be used for in-place change

property atom_tags: numpy.ndarray#

Array of tags, each for one Atom

write_seed(fpath: str) None[source]#

Write the seed to file

get_cell_inp() castepinput.CellInput[source]#

Return the python object represent the cell

get_cell_inp_lines() List[str][source]#

Return a list of strings of the seed file

build_random_atoms(timeout: int = 10, also_buildcell: bool = False, fail_ok: bool = True) Optional[Union[ase.atoms.Atoms, Tuple[ase.atoms.Atoms, Any]]][source]#

Returns the randomize Atoms built using buildcell program

__getitem__(i: Union[int, Sequence[int], slice]) Union[airsspy.seed.SeedAtom, airsspy.seed.SeedAtoms][source]#

Return a subset of the atoms.

i – scalar integer, list of integers, or slice object describing which atoms to return.

If i is a scalar, return an Atom object. If i is a list or a slice, return an Atoms object with the same cell, pbc, and other associated info as the original Atoms object. The indices of the constraints will be shuffled so that they match the indexing in the subset returned.

class airsspy.seed.BoolTag(doc: str = '', storage_name: Optional[str] = None)[source]#

Descriptor for tag-like properties (boolean flags)

Initialization

__set_name__(owner: type, name: str) None[source]#
property storage_name: str#

Storage name for the property, guaranteed to be set after set_name

__get__(instance: Optional[airsspy.seed.TagHolder], owner: type) Optional[bool][source]#
__set__(instance: airsspy.seed.TagHolder, value: bool) None[source]#
__delete__(instance: airsspy.seed.TagHolder) None[source]#
class airsspy.seed.GenericTag(doc: str = '', storage_name: Optional[str] = None)[source]#

Descriptor for generic properties (any value type)

Initialization

__set_name__(owner: type, name: str) None[source]#
property storage_name: str#

Storage name for the property, guaranteed to be set after set_name

__get__(instance: Optional[airsspy.seed.TagHolder], owner: type) Any[source]#
__set__(instance: airsspy.seed.TagHolder, value: Any) None[source]#
__delete__(instance: airsspy.seed.TagHolder) None[source]#
class airsspy.seed.RangeTag(doc: str = '', storage_name: Optional[str] = None)[source]#

Descriptor for range properties (number or tuple of two numbers)

Initialization

__set_name__(owner: type, name: str) None[source]#
property storage_name: str#

Storage name for the property, guaranteed to be set after set_name

__get__(instance: Optional[airsspy.seed.TagHolder], owner: type) Any[source]#
__set__(instance: airsspy.seed.TagHolder, value: Union[numbers.Number, Tuple[numbers.Number, numbers.Number], List[numbers.Number], Dict[str, List[int]]]) None[source]#
__delete__(instance: airsspy.seed.TagHolder) None[source]#
class airsspy.seed.NestedRangeTag(doc: str = '', storage_name: Optional[str] = None)[source]#

Descriptor for nested range properties (tuple/list of two elements)

Initialization

__set_name__(owner: type, name: str) None[source]#
property storage_name: str#

Storage name for the property, guaranteed to be set after set_name

__get__(instance: Optional[airsspy.seed.TagHolder], owner: type) Any[source]#
__set__(instance: airsspy.seed.TagHolder, value: Union[Tuple[Any, Any], List[Any]]) None[source]#
__delete__(instance: airsspy.seed.TagHolder) None[source]#
class airsspy.seed.TagHolder(*args: Any, **kwargs: Any)[source]#

Container for the tags

Initialization

A container for tags of a single SeedAtom

get_prop_dict() Dict[str, Any][source]#
clear_all() None[source]#

Set all property to be None

get_prop(value: str) Any[source]#

Get property

set_prop(name: str, value: Any) None[source]#

Set property

set_tag(tag: str) None[source]#

Set a tag-like property

get_tag(tag: str) Optional[bool][source]#

Set a tag-like property

delete_prop(name: str) None[source]#

Deleta a property

delete(name: str) None[source]#

Delete a property by name

abstractmethod to_string() str[source]#
__repr__() str[source]#
class airsspy.seed.BuildcellParam(*args: Any, **kwargs: Any)[source]#

Bases: airsspy.seed.TagHolder

A class for storing parameters for the Buldcell program

Initialization

A container for tags of a single SeedAtom

populate_defaults() airsspy.seed.BuildcellParam[source]#

Apply the active cell-level defaults used by AIRSS gencell.

to_string() str[source]#

Return the string that should go into the .cell file

fix#

‘BoolTag(…)’

abfix#

‘BoolTag(…)’

adjgen#

‘GenericTag(…)’

autoslack#

‘BoolTag(…)’

breakamp#

‘GenericTag(…)’

celladapt#

‘BoolTag(…)’

cellamp#

‘GenericTag(…)’

cellcon#

‘GenericTag(…)’

coord#

‘RangeTag(…)’

cylinder#

‘GenericTag(…)’

flip#

‘BoolTag(…)’

maxbangle#

‘GenericTag(…)’

maxtime#

‘GenericTag(…)’

minbangle#

‘GenericTag(…)’

focus#

‘GenericTag(…)’

molecules#

‘GenericTag(…)’

nocompact#

‘GenericTag(…)’

nopush#

‘GenericTag(…)’

octet#

‘GenericTag(…)’

permfrac#

‘GenericTag(…)’

permute#

‘GenericTag(…)’

rad#

‘GenericTag(…)’

rash#

‘GenericTag(…)’

rash_angamp#

‘GenericTag(…)’

rash_posamp#

‘GenericTag(…)’

remove#

‘GenericTag(…)’

slab#

‘GenericTag(…)’

species#

‘GenericTag(…)’

sphere#

‘GenericTag(…)’

spin#

‘GenericTag(…)’

supercell#

‘GenericTag(…)’

surface#

‘BoolTag(…)’

symm#

‘GenericTag(…)’

symmno#

‘GenericTag(…)’

symmorphic#

‘BoolTag(…)’

system#

‘GenericTag(…)’

targvol#

‘RangeTag(…)’

three#

‘GenericTag(…)’

tight#

‘BoolTag(…)’

vacancies#

‘GenericTag(…)’

vacuum#

‘GenericTag(…)’

width#

‘GenericTag(…)’

cfix#

‘BoolTag(…)’

cluster#

‘BoolTag(…)’

nform#

‘RangeTag(…)’

minsep#

‘NestedRangeTag(…)’

posamp#

‘NestedRangeTag(…)’

symmops#

‘RangeTag(…)’

minamp#

‘RangeTag(…)’

zamp#

‘RangeTag(…)’

xamp#

‘RangeTag(…)’

yamp#

‘RangeTag(…)’

angamp#

‘RangeTag(…)’

sgrank#

‘RangeTag(…)’

varvol#

‘GenericTag(…)’

slack#

‘RangeTag(…)’

overlap#

‘RangeTag(…)’

compact#

‘BoolTag(…)’

cons#

‘GenericTag(…)’

natom#

‘RangeTag(…)’

formula#

‘GenericTag(…)’

seed#

‘GenericTag(…)’

vol#

‘RangeTag(…)’

nfails#

‘GenericTag(…)’

hole#

‘GenericTag(…)’

holepos#

‘GenericTag(…)’

shift#

‘GenericTag(…)’

class airsspy.seed.SeedAtomTag(*args: Any, **kwargs: Any)[source]#

Bases: airsspy.seed.TagHolder

Tags for a single atom

Initialization

A container for tags of a single SeedAtom

tagname#

‘GenericTag(…)’

posamp#

‘RangeTag(…)’

minamp#

‘RangeTag(…)’

zamp#

‘RangeTag(…)’

xamp#

‘RangeTag(…)’

yamp#

‘RangeTag(…)’

num#

‘RangeTag(…)’

adatom#

‘BoolTag(…)’

fix#

‘BoolTag(…)’

nomove#

‘BoolTag(…)’

rad#

‘GenericTag(…)’

occ#

‘GenericTag(…)’

perm#

‘BoolTag(…)’

athole#

‘BoolTag(…)’

coord#

‘RangeTag(…)’

angamp#

‘RangeTag(…)’

vol#

‘GenericTag(…)’

mult#

‘GenericTag(…)’

spin#

‘GenericTag(…)’

to_string() str[source]#

Return the per entry string for this atom to be appended after its line in POSITIONS_FRAC / POSITIONS_ABS block

class airsspy.seed.SeedAtom(*args: Any, **kwargs: Any)[source]#

Bases: ase.Atom, airsspy.seed.SeedAtomTag

Element atoms in a AIRSS seed

Initialization

A container for tags of a single SeedAtom

airsspy.seed.tuple2range(value: Union[numbers.Number, List[numbers.Number], Tuple[numbers.Number, ...]]) str[source]#

Return the string for a given value. If the value is a tuple make it a range.

airsspy.seed.get_cell_inp(atoms: airsspy.seed.SeedAtoms) castepinput.CellInput[source]#

Get the CellInput holder for a given seed

airsspy.seed.get_cell_inp_lines(atoms: airsspy.seed.SeedAtoms) List[str][source]#

Write the seed to a file handle