raamana / pyradigm

Research data management in biomedical and machine learning applications
http://raamana.github.io/pyradigm/
MIT License
28 stars 13 forks source link

Pass additional kwargs to pickle.load (in __load) #5

Open stsievert opened 7 years ago

raamana commented 6 years ago

Thanks Scott for the PR - could you elaborate on the use cases for this? Perhaps give me an example.

stsievert commented 6 years ago

Any of the use cases supported by the keyword args for pickle.load.

I seem to remember some headache with saving under Python 2 and loading under Python 3 (or something like that). pickle.load did not have any kwargs under Python 2 (source) but does under Python 3 (source).

raamana commented 6 years ago

I see, good idea. MLDataset.load must also go hand in hand with MLDataset.save to be complete and useful!

Would you have time to add that that too and add a few tests to ensure they work well together?

If possible try to make it work python 2.7 as well, but if its not possible, its not critical.

stsievert commented 6 years ago

If possible try to make it work python 2.7 as well, but if its not possible, its not critical.

Does this not work under Python 2.7?

Would you have time to add that that too and add a few tests to ensure they work well together?

I've added passing kwargs on in MLDataset.save, but don't have time to write tests. If you're constrained and can't write files in your tests, I'd look into using a StringIO object.