Voronoi volumes of all atoms in structure

Hi,

Can someone provide me a minimal working example of a script that calculates the voronoi volumes of all sites in a structure?

Thanks in advance!

Regards, Han.

For future reference -

from pymatgen.analysis.local_env import VoronoiNN
from pymatgen import Structure
v_list = []
a = VoronoiNN()
s = Structure.from_file(“structure.vasp”)
for i, site in enumerate(s):
b = a.get_voronoi_polyhedra(s,i)
v_i = 0
for j in b:
v_i += b[j][“volume”]
v_list.append(v_i)
print(np.round(v_list,2))