site_analysis.voronoi_site

Voronoi site representation for crystal structure analysis.

This module provides the VoronoiSite class, which represents a site defined by a Voronoi cell centered at a fixed position.

class VoronoiSite(frac_coords: ndarray, label: str | None = None)[source]

Bases: Site

Site subclass corresponding to Voronoi cells centered on fixed positions.

Voronoi sites divide space into regions where each point in a region is closer to its site center than to any other site center.

Unlike other site types, a single VoronoiSite cannot determine whether an atom is contained within it, as this calculation depends on the positions of all other Voronoi sites in the structure. Therefore, the contains_point method is not implemented directly in this class.

frac_coords

Fractional coordinates of the site centre.

Type:

np.ndarray

See also

Site: Parent class documenting inherited attributes

(index, label, contains_atoms, trajectory, points, transitions, average_occupation).

Important

Do not use VoronoiSite.contains_point() directly. Instead, use VoronoiSiteCollection and its assign_site_occupations() method to determine which atoms belong to which Voronoi sites.

as_dict() dict[source]

Json-serializable dict representation of this VoronoiSite.

Parameters:

None

Returns:

(dict)

property centre: ndarray

Returns the centre position of this site.

Parameters:

None

Returns:

np.ndarray

contains_point(x: ndarray) bool[source]

A single Voronoi site cannot determine whether it contains a given point, because the site boundaries are defined by the set of all Voronoi sites.

Use VoronoiSiteCollection.assign_site_occupations() instead.

classmethod from_dict(d)[source]

Create a VoronoiSite object from a dict representation.

Parameters:

d (dict) – The dict representation of this Site.

Returns:

(VoronoiSite)