AttributeError when trying to access freud.locality.NearestNeighbors attributes
Issue #197
resolved
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)
-
-
- changed status to resolved
Use correct box, add tests. Fixes issue 197"
→ <<cset d52f854ec0b4>>
-
Use correct box, add tests. Fixes issue 197"
→ <<cset d52f854ec0b4>>
-
Merged in issue197 (pull request #252)
Use correct box, add tests. Fixes issue 197
Approved-by: Bradley Dice bdice@bradleydice.com Approved-by: Vyas Ramasubramani vramasub@umich.edu Approved-by: Carl Simon Adorf csadorf@umich.edu
→ <<cset c2da314dd13e>>
-
Merged in issue197 (pull request #252)
Use correct box, add tests. Fixes issue 197
Approved-by: Bradley Dice bdice@bradleydice.com Approved-by: Vyas Ramasubramani vramasub@umich.edu Approved-by: Carl Simon Adorf csadorf@umich.edu
→ <<cset c2da314dd13e>>
- Log in to comment
Thanks for reporting, @csadorf! I think I found the problem - I'll add you as a reviewer on a PR soon.