diffpy / diffpy.pdfgui

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

check whether `safeCPickleDumps(obj):` is still needed #189

Open sbillinge opened 3 weeks ago

sbillinge commented 3 weeks ago

This may be another py2 compatibility function. Check where it is used and whether it can be removed.

Write tests to make sure the behavior is still handled.

Tieqiong commented 2 weeks ago

@sbillinge this method ensures that an object is serialized even if it contains problematic floating-point values by falling back to a simpler serialization protocol if the default one fails.

In Python 3, the pickle module uses more recent protocols, and the SystemError related to frexp() is less likely to occur. So I think the fallback to ASCII protocol (protocol 0) is not necessary any more.

Yes test would be the right thing to do