pyiron_atomistics icon indicating copy to clipboard operation
pyiron_atomistics copied to clipboard

`TrainingContainer` cannot be pickled

Open samwaseda opened this issue 2 years ago • 1 comments

container = pr.create.job.TrainingContainer('container')
for job in pr.iter_jobs():
    container.include_job(job)
df = container.to_pandas()
df.to_pickle('name_of_the_file.pkl')

This fails, because the Atoms-object contains a mysterious None towards the beginning (i.e. df.drop(columns=['atoms'].to_pickle('blablabla.pkl') works).

samwaseda avatar Oct 20 '22 09:10 samwaseda

Quick fix:

container = pr.create.job.TrainingContainer('container')
for job in pr.iter_jobs():
    container.include_job(job)
df = container.to_pandas()
df.atoms = df.atoms.map(lambda a: a.to_ase())
df.to_pickle('name_of_the_file.pkl')

If I recall correctly it's already not possible to pickle our atoms, see #643

You can pack/unpack projects with the training containers inside, if you need it for the workshop.

pmrv avatar Oct 20 '22 12:10 pmrv