AttributeError when trying to access freud.locality.NearestNeighbors attributes

Issue #197 resolved
Carl Simon Adorf created an issue

Description

I am trying to access any of the attributes wrapped_vectors, r_sq_list and I get an AttributeError.

Minimal example

nn = NearestNeighbors(1.2, k)
box = freud.box.Box.from_box(frame.configuration.box)
nn.compute(frame.configuration.box, frame.particles.position, frame.particles.position)
print(nn.r_sq_list)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/usr/lib/python3.7/site-packages/ipywidgets/widgets/interaction.py in update(self, *args)
    249                     value = widget.get_interact_value()
    250                     self.kwargs[widget._kwarg] = value
--> 251                 self.result = self.f(**self.kwargs)
    252                 show_inline_matplotlib_plots()
    253                 if self.auto_display and self.result is not None:

<ipython-input-67-d367a2bdf919> in show(frame_index, env, select, k, zoom, alpha, beta, gamma)
     17         box = freud.box.Box.from_box(frame.configuration.box)
     18         nn.compute(frame.configuration.box, frame.particles.position, frame.particles.position)
---> 19         print(nn.r_sq_list)
     20 
     21         labels = gmm.predict(compute(frame))

freud/locality.pyx in freud.locality.NearestNeighbors.r_sq_list.__get__()

freud/locality.pyx in freud.locality.NearestNeighbors._getWrappedVectors()

AttributeError: 'numpy.ndarray' object has no attribute 'wrap'

Version

freud.__version__
'0.11.4'

Comments (5)

  1. Bradley Dice

    Thanks for reporting, @csadorf! I think I found the problem - I'll add you as a reviewer on a PR soon.

  2. Log in to comment