You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When attempting to save a DaskContactTrajectory instance or DaskContactTrajectory instance to a pkl file, I receive the following error message:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[13], line 1
----> 1 freq.save_to_file("contacts.p")
File /panfs/jay/groups/21/sarupria/gopal145/software/contact_map/contact_map/contact_map.py:371, in ContactObject.save_to_file(self, filename, mode)
356 """Save this object to the given file.
357
358 Parameters
(...)
368 from_file : load from generated file
369 """
370 with open(filename, mode+"b") as f:
--> 371 pickle.dump(self, f)
AttributeError: Can't pickle local object 'Client.__init__.<locals>.<lambda>'
From an online search, it appears that saving to a pkl file should avoid having lambda functions calls in the pickled data. I am unable to find any lambda function calls in the save_to_file method or in the dask_runner module.
The text was updated successfully, but these errors were encountered:
At a glance, it looks like the issue is that DaskContactTrajectory contains a reference to the Dask Client, which apparently can't be pickled.
Probably the solution here will be to add a method to convert a DaskContactTrajectory to a regular ContactTrajectory (after the computation is done). Then you should be able to pickle the ContactTrajectory as usual (and disable pickling of DaskContactTrajectory). My assumption is that once you're saving it, you're probably not worried about keeping details of the Dask Client, you just want to be able to reload your contacts!
Let me know if that sounds like a solution that would meet your needs -- or especially let me know if there's a reason that solution does not meet your needs. I probably won't have a chance to implement that until at least Monday/Tuesday at the earliest.
When attempting to save a DaskContactTrajectory instance or DaskContactTrajectory instance to a pkl file, I receive the following error message:
From an online search, it appears that saving to a pkl file should avoid having lambda functions calls in the pickled data. I am unable to find any lambda function calls in the
save_to_file
method or in thedask_runner
module.The text was updated successfully, but these errors were encountered: