diffpy / diffpy.pdfgui

graphical user interface for real space structure refinement to PDF
Other
18 stars 27 forks source link

ddp project files compatible problem between py2 and py3 #46

Open dragonyanglong opened 3 years ago

dragonyanglong commented 3 years ago
dragonyanglong commented 3 years ago

Hi @aPeter1, I will provide the pickel .ddp files for you in the email. I did a few tests before in the PR review #42 and it seems like the first condition works if I remember correctly (ie. use the py2 pdfgui to open the py3 saved ddp file)

dragonyanglong commented 3 years ago

But the second case doesn't work properly (use the py3 pdfgui to open the py2 saved ddp file). You can find more detailed information about the pickel propotols in the PR commits #42 .

dragonyanglong commented 2 years ago

I tried some py2 ddp files. And it seems like some can be opened successfully by py3, but some still couldn't, and raise error as

Traceback (most recent call last):
  File "/Users/Dragon/Documents/Billinge/dev/diffpy.pdfgui/src/diffpy/pdfgui/gui/errorwrapper.py", line 59, in _f
    return func(*args, **kwargs)
  File "/Users/Dragon/Documents/Billinge/dev/diffpy.pdfgui/src/diffpy/pdfgui/gui/mainframe.py", line 2132, in onOpen
    treelist = self.control.load(fullpath)
  File "/Users/Dragon/Documents/Billinge/dev/diffpy.pdfgui/src/diffpy/pdfgui/control/pdfguicontrol.py", line 404, in load
    org = fit.load(z, projName + '/' + rdname + '/')
  File "/Users/Dragon/Documents/Billinge/dev/diffpy.pdfgui/src/diffpy/pdfgui/control/fitting.py", line 206, in load
    return Organizer.load(self, z, subpath)
  File "/Users/Dragon/Documents/Billinge/dev/diffpy.pdfgui/src/diffpy/pdfgui/control/organizer.py", line 157, in load
    struc.load(z, subpath + 'structure/' + strucName + '/')
  File "/Users/Dragon/Documents/Billinge/dev/diffpy.pdfgui/src/diffpy/pdfgui/control/fitstructure.py", line 776, in load
    self.custom_spacegroup = CtrlUnpickler.loads(spkl)
  File "/Users/Dragon/Documents/Billinge/dev/diffpy.pdfgui/src/diffpy/pdfgui/control/pdfguicontrol.py", line 564, in loads
    return pickle.loads(s)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xf0 in position 22: ordinal not in range(128)
dragonyanglong commented 2 years ago

ref: https://rebeccabilbro.github.io/convert-py2-pickles-to-py3/