At the moment it is not possible to modify shared jobs, but you can copy the HDF5 file and then modify your copy.
Here is an example:
import os
import shutil
from pyiron_base import state, ProjectHDFio
from pyiron_atomistics import Project
# Create an example job
pr = Project("test")
job = pr.create.job.Lammps("lmp")
job.structure = pr.create.structure.ase.bulk("Al", cubic=True)
job.run()
# Create a copy of the example job
pr_new = Project("test2")
new_file_name = os.path.join(pr_new.path, os.path.basename(job.project_hdf5.file_name))
shutil.copy(job.project_hdf5.file_name, new_file_name)
file_obj = ProjectHDFio(project=pr_new, file_name=new_file_name)
new_db_entry = {
'projectpath': file_obj.root_path,
'project': file_obj.project_path,
}
for k, v in job.db_entry().items():
if k not in new_db_entry.keys():
new_db_entry[k] = v
new_job_id = state.database._database.add_item_dict(new_db_entry)
# Load the copy
job_new = pr_new.load(new_job_id)
job_new.output.energy_tot
At the moment it is not possible to modify shared jobs, but you can copy the HDF5 file and then modify your copy.
Here is an example: