Unable to save a previous project

38 views
Skip to first unread message

Roberto de Avillez

unread,
Dec 23, 2024, 4:50:23 PM12/23/24
to diffpy-users
I had to reinstall pdfgui after a problema with my operational system (Ubuntu 24.04.1, 64bits). Now I can not save the projects. The following error log appears:

```
Traceback (most recent call last):
  File "/home/roberto/miniconda3/envs/pdfgui/lib/python3.11/site-packages/diffpy/pdfgui/gui/errorwrapper.py", line 62, in _f
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/roberto/miniconda3/envs/pdfgui/lib/python3.11/site-packages/diffpy/pdfgui/gui/mainframe.py", line 2186, in onSaveAs
    self.control.save(self.fullpath)
  File "/home/roberto/miniconda3/envs/pdfgui/lib/python3.11/site-packages/diffpy/pdfgui/control/pdfguicontrol.py", line 454, in save
    fit.save(z, projName + '/' + quote_plain(fit.name) + '/')
  File "/home/roberto/miniconda3/envs/pdfgui/lib/python3.11/site-packages/diffpy/pdfgui/control/fitting.py", line 224, in save
    Organizer.save(self, z, subpath)
  File "/home/roberto/miniconda3/envs/pdfgui/lib/python3.11/site-packages/diffpy/pdfgui/control/organizer.py", line 187, in save
    dataset.save(z, subpath + 'dataset/' + quote_plain(dataset.name) + '/')
  File "/home/roberto/miniconda3/envs/pdfgui/lib/python3.11/site-packages/diffpy/pdfgui/control/fitdataset.py", line 500, in save
    content[item] = getattr(self, item, None)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/roberto/miniconda3/envs/pdfgui/lib/python3.11/site-packages/diffpy/pdfgui/control/fitdataset.py", line 652, in _get_rcalc
    self._updateRcalcSampling()
  File "/home/roberto/miniconda3/envs/pdfgui/lib/python3.11/site-packages/diffpy/pdfgui/control/fitdataset.py", line 595, in _updateRcalcSampling
    newGcalc = grid_interpolation(self._rcalc, self._Gcalc, newrcalc)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/roberto/miniconda3/envs/pdfgui/lib/python3.11/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.
```

I would appreciate any help. The above installation was with Python 3.11, but I had similar problem with Python 3.9.

Roberto de Avillez

Simon Billinge

unread,
Dec 26, 2024, 8:08:38 AM12/26/24
to diffpy...@googlegroups.com, Sangjoon Bob Lee, Tieqiong Zhang
Thanks for reporting this Roberto.  This looks like it might be a numpy 2 issue. We are about to roll out new versions of pdffit2 and PDFgui shortly, but you may be able to get it going in the meantime by installing numpy <2 version in your environment.

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 visit https://groups.google.com/d/msgid/diffpy-users/27014b95-2149-47cb-89f0-03b75cc62205n%40googlegroups.com.

Roberto de Avillez

unread,
Dec 27, 2024, 12:51:34 PM12/27/24
to diffpy-users
Thanks Simon.

You were right. I deleted my conda environment and started a new one with Python 3.9, installed numpy 1.26.4 (last version before 2.0), and installed diffpy.pdfgui. The program is running.

Roberto

Simon Billinge

unread,
Dec 28, 2024, 11:25:49 AM12/28/24
to diffpy...@googlegroups.com
Great. Thanks for reporting Roberto and for the followup that it is working.

Everyone, Look out for an updated pdfgui in the new year that works with numpy 2 and Python 3.12 (possibly 3.13 but we are having some problems with that)!

S

On Fri, Dec 27, 2024 at 12:51 PM Roberto de Avillez <roberto...@gmail.com> wrote:
Thanks Simon. You were right. I deleted my conda environment and started a new one with Python 3. 9, installed numpy 1. 26. 4 (last version before 2. 0), and installed diffpy. pdfgui. The program is running. Roberto Em quinta-feira, 26 de dezembro
ZjQcmQRYFpfptBannerStart
This Message Is From an External Sender
This message came from outside your organization.
 
ZjQcmQRYFpfptBannerEnd


--
Simon Billinge
Professor, 
Department of Applied Physics and Applied Mathematics
Columbia University
Reply all
Reply to author
Forward
0 new messages