one question of pdf

100 views
Skip to first unread message

lipeng yao

unread,
Oct 9, 2024, 10:12:56 AM10/9/24
to diffpy-users
Dear all,

When I want to plot in pdf, The following problem appeared. How should I do to solve this? Thank you for your professional suggestions.

Kind regards,
 

Traceback (most recent call last):
  File "C:\Users\yaoly\AppData\Local\anaconda3\envs\pdfgui2\lib\site-packages\diffpy\pdfgui\gui\errorwrapper.py", line 62, in _f
    return func(*args, **kwargs)
  File "C:\Users\yaoly\AppData\Local\anaconda3\envs\pdfgui2\lib\site-packages\diffpy\pdfgui\gui\mainframe.py", line 2064, in onQuickPlot
    self.control.plot(xval, yvals, refs, shift=offset)
  File "C:\Users\yaoly\AppData\Local\anaconda3\envs\pdfgui2\lib\site-packages\diffpy\pdfgui\control\pdfguicontrol.py", line 487, in plot
    plotter.plot(xItem, yItems, Ids, shift, dry)
  File "C:\Users\yaoly\AppData\Local\anaconda3\envs\pdfgui2\lib\site-packages\diffpy\pdfgui\control\plotter.py", line 514, in plot
    curve.notify(plotwnd=self.window)
  File "C:\Users\yaoly\AppData\Local\anaconda3\envs\pdfgui2\lib\site-packages\diffpy\pdfgui\control\plotter.py", line 264, in notify
    self.yData = affectedIds[0].getData(self.yStr, steps)
  File "C:\Users\yaoly\AppData\Local\anaconda3\envs\pdfgui2\lib\site-packages\diffpy\pdfgui\control\fitdataset.py", line 136, in getData
    d = getattr(self, name)
  File "C:\Users\yaoly\AppData\Local\anaconda3\envs\pdfgui2\lib\site-packages\diffpy\pdfgui\control\fitdataset.py", line 694, in _get_Gtrunc
    newGtrunc = grid_interpolation(self.robs, self.Gobs, self.rcalc)
  File "C:\Users\yaoly\AppData\Local\anaconda3\envs\pdfgui2\lib\site-packages\diffpy\pdfgui\control\fitdataset.py", line 772, in grid_interpolation
    x0 = numpy.array(x0, copy=False, dtype=float)
ValueError: Unable to avoid copy while creating an array as requested.
If using `np.array(obj, copy=False)` replace it with `np.asarray(obj)` to allow a copy when needed (no behavior change in NumPy 1.x).
For more details, see https://numpy.org/devdocs/numpy_2_0_migration_guide.html#adapting-to-changes-in-the-copy-keyword.

Simon Billinge

unread,
Oct 9, 2024, 3:21:33 PM10/9/24
to diffpy...@googlegroups.com
Dear Yaolipeng,

This looks like an issue with numpy 2.  We are almost ready with a new release, but for now you may be able to fix it by typing (in your activated conda environment)

`conda install numpy=1.26`

And then trying again. 

S

--
You received this message because you are subscribed to the Google Groups "diffpy-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to diffpy-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/diffpy-users/d4ce07d0-270b-4289-8ef9-ca0aaf4ca4a2n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages