pepkit / peppy

Project metadata manager for PEPs in Python
https://pep.databio.org/peppy
BSD 2-Clause "Simplified" License
37 stars 12 forks source link

Add pickling (serializing an object) to Project #455

Closed khoroshevskyi closed 7 months ago

khoroshevskyi commented 11 months ago

While upgrading looper and ensuring its compatibility with the new version of peppy, I encountered several issues. One of these issues pertained to the use of the __reduce__ method in `peppy.Sample for object serialization. I successfully addressed this problem in the Samples class (unfortunately without inherited Project - Sample is independent).

Now, a question arises: Given that we have implemented the__reduce__ method in the Sample class, should we also consider adding serialization capabilities to the Project class? However, the current challenge is that the __init__ method of the Project class currently only accepts paths to physical files. To enable serialization, we would need to introduce an additional argument in the __init__ method to accommodate a dictionary. This approach was discussed a few months ago, and decided not to add this argument, but instead make separate method from_dict

khoroshevskyi commented 7 months ago

Fixed in 0.40.0 release