Skip to content

CSRO doesn't work #57

@dragonyanglong

Description

@dragonyanglong

Describe the bug
A clear and concise description of what the bug is.
I run through the example code at https://v3.pyscal.org/en/latest/examples/13_short_range_order.html, but it does not work.

To Reproduce
Steps to reproduce the behavior:

sys.find.neighbors(method='cutoff', cutoff=3)
sys.chemical.short_range_order()

Expected behavior
A clear and concise description of what you expected to happen.
It shows:

In [154]: sys.find.neighbors(method='cutoff', cutoff=cutoff)

In [155]: sys.chemical.short_range_order()
--------------------------------------------------------------------------
IndexError                               Traceback (most recent call last)
Cell In[155], line 1
----> 1 sys.chemical.short_range_order()

File ~/opt/anaconda3/envs/pyaet/lib/python3.11/site-packages/pyscal3/operations/chemical.py:67, in calculate_sro(system, reference_type, compare_type, average)
     63 system._check_neighbors()
     65 cdict = system.atoms.composition_ints
---> 67 neighbortypes = system.atoms["types"][system.atoms['neighbors']]
     68 comp_dicts = [_get_dict(neighbortype, cdict) for neighbortype in neighbortypes]
     69 local_comp = np.array([d[reference_type] for d in comp_dicts])

IndexError: arrays used as indices must be of integer (or boolean) type

In [156]:

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • MacOS
  • pyscal3 3.2.7 pypi_0 pypi

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