Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in calculate.voronoi_vector() #51

Open
dragonyanglong opened this issue Dec 6, 2024 · 0 comments
Open

Error in calculate.voronoi_vector() #51

dragonyanglong opened this issue Dec 6, 2024 · 0 comments

Comments

@dragonyanglong
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant