serializing FitRecipe or FitResults object?

18 views
Skip to first unread message

cl3...@columbia.edu

unread,
Mar 21, 2017, 12:14:02 PM3/21/17
to diffpy-dev
I was hoping to store my refinement results and it comes to my mind if I can serialize FitRecipe objects then all the necessary information is recoverable, like G_gal and parameter values.

I tried to pickle the FitRecipe/FitResults objects. The ``pickle.dump`` step is possible, but when I wanted to ``pickle.load``, it gives me following error when recovering both FitRecipe/FitResults

````
/Users/timothyliu/miniconda3/envs/diffpy/lib/python2.7/site-packages/diffpy.srfit-1.2-py2.7.egg/diffpy/srfit/util/weakrefcallable.pyc in __hash__(self)
86
87 def __hash__(self):
---> 88 return hash((self.function, self._wref))
89
90

AttributeError: function
````

Here is my diffpy-cmi version (conda install from diffpy channel)

````
diffpy-cmi 2.0.2 0 diffpy
````

Is there any way I can serialize FitRecipe objects? Thanks.



Pavol Juhas

unread,
Mar 21, 2017, 12:34:47 PM3/21/17
to DiffPy developers
Hi Tim,

It is a bug, serialization of FitRecipe objects should work.

Can you isolate a minimum example that reproduces the bug and post it 

I suspect it is some constraint function in your recipe that exposes the bug.

Thank you,

Pavol





--
You received this message because you are subscribed to the Google Groups "diffpy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to diffpy-dev+unsubscribe@googlegroups.com.
To post to this group, send email to diffp...@googlegroups.com.
Visit this group at https://groups.google.com/group/diffpy-dev.
For more options, visit https://groups.google.com/d/optout.

cl3...@columbia.edu

unread,
Mar 22, 2017, 9:06:30 PM3/22/17
to diffpy-dev
Hi Pavol,

Thanks for the reply and I will post the issue along with my error message on srfit repo.

On Tuesday, March 21, 2017 at 12:34:47 PM UTC-4, Pavol Juhas wrote:
Hi Tim,

It is a bug, serialization of FitRecipe objects should work.

Can you isolate a minimum example that reproduces the bug and post it 

I suspect it is some constraint function in your recipe that exposes the bug.

Thank you,

Pavol

On Sun, Mar 19, 2017 at 3:53 PM, <cl3...@columbia.edu> wrote:
I was hoping to store my refinement results and it comes to my mind if I can serialize FitRecipe objects then all the necessary information is recoverable, like G_gal and parameter values.

I tried to pickle the FitRecipe/FitResults objects. The ``pickle.dump`` step is possible, but when I wanted to ``pickle.load``, it gives me following error when recovering both FitRecipe/FitResults

````
/Users/timothyliu/miniconda3/envs/diffpy/lib/python2.7/site-packages/diffpy.srfit-1.2-py2.7.egg/diffpy/srfit/util/weakrefcallable.pyc in __hash__(self)
     86
     87     def __hash__(self):
---> 88         return hash((self.function, self._wref))
     89
     90

AttributeError: function
````

Here is my diffpy-cmi version (conda install from diffpy channel)

````
diffpy-cmi                2.0.2                         0    diffpy
````

Is there any way I can serialize FitRecipe objects? Thanks.



--
You received this message because you are subscribed to the Google Groups "diffpy-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to diffpy-dev+...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages