Skip to content

Error in calculate.voronoi_vector() #51

Open
@dragonyanglong

Description

@dragonyanglong

Describe the bug
A clear and concise description of what the bug is.

When running the , it shows the following error.

In [72]: bcc.calculate.voronoi_vector()
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Cell In[72], line 1
----> 1 bcc.calculate.voronoi_vector()

File ~/opt/anaconda3/envs/pyaet/lib/python3.11/site-packages/pyscal3/operations/voronoi.py:93, in calculate_vorovector(system, edge_cutoff, area_cutoff, edge_length)
     90     complete_edge_lengths.append(edge_lengths)
     91     vorovectors.append(vorovector)
---> 93 system.atoms["edge_lengths"] = np.array(complete_edge_lengths)
     94 system.atoms["vorovector"] = np.array(vorovectors)
     96 mapdict = {}

ValueError: setting an array element with a sequence. The requested array has an inhomogeneous shape after 2 dimensions. The detected shape was (1024, 14) + inhomogeneous part.

In [73]: fcc = System.create.lattice.fcc(lattice_constant=4, repetitions=[4,4,4])

In [74]: fcc.calculate.voronoi_vector()
---------------------------------------------------------------------------
KeyError                                  Traceback (most recent call last)
Cell In[74], line 1
----> 1 fcc.calculate.voronoi_vector()

File ~/opt/anaconda3/envs/pyaet/lib/python3.11/site-packages/pyscal3/operations/voronoi.py:49, in calculate_vorovector(system, edge_cutoff, area_cutoff, edge_length)
     47 refined_edges = []
     48 edge_lengths = []
---> 49 for vno in system.atoms['face_vertices'][x]:
     50     vphase = system.atoms['vertex_numbers'][x][st:st+vno]
     51     edgecount = 0

File ~/opt/anaconda3/envs/pyaet/lib/python3.11/site-packages/pyscal3/atoms.py:41, in Atoms.__getitem__(self, key)
     39     return self._get_atoms(key)
     40 else:
---> 41     val = dict.__getitem__(self, key)
     42     return val

KeyError: 'face_vertices'

To Reproduce
See official example code:
https://v3.pyscal.org/en/latest/examples/10_voronoi_tessellation.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions