Skip to content

Error while saving DaskContactFrequency & DaskContactTrajectory instances to pkl file #134

Description

@varun-go

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions