pyiron_base icon indicating copy to clipboard operation
pyiron_base copied to clipboard

Warning: Could not remove job with ID X - when deleting master

Open jan-janssen opened this issue 10 months ago • 0 comments

Example code:

from pyiron_atomistics import Project

pr = Project("ev_curve")
job_lmp = pr.create.job.Lammps("lmp")
job_lmp.structure = pr.create.structure.ase.bulk("Al", cubic=True)
job_elastic = pr.create.job.Murnaghan("murn")
job_elastic.ref_job = job_lmp
job_elastic.run()

pr.remove_jobs(recursive=True, silently=True)

The child jobs of the Murnaghan job (ID 1) are already deleted when the Murnaghan job is deleted. So we see a series of warnings when the corresponding child jobs (ID 2 - 12) are deleted:

2024-04-09 10:54:00,429 - pyiron_log - WARNING - Could not remove job with ID 2
2024-04-09 10:54:00,429 - pyiron_log - WARNING - Could not remove job with ID 3 
2024-04-09 10:54:00,429 - pyiron_log - WARNING - Could not remove job with ID 4 
2024-04-09 10:54:00,429 - pyiron_log - WARNING - Could not remove job with ID 5 
2024-04-09 10:54:00,430 - pyiron_log - WARNING - Could not remove job with ID 6 
2024-04-09 10:54:00,430 - pyiron_log - WARNING - Could not remove job with ID 7 
2024-04-09 10:54:00,431 - pyiron_log - WARNING - Could not remove job with ID 8 
2024-04-09 10:54:00,431 - pyiron_log - WARNING - Could not remove job with ID 9 
2024-04-09 10:54:00,431 - pyiron_log - WARNING - Could not remove job with ID 10 
2024-04-09 10:54:00,432 - pyiron_log - WARNING - Could not remove job with ID 11 
2024-04-09 10:54:00,432 - pyiron_log - WARNING - Could not remove job with ID 12 

jan-janssen avatar Apr 09 '24 15:04 jan-janssen

I would love to see this. My naively preferred implementation would be Atoms(ASEAtoms, PyironObject) and to give PyironObject.storage a metadata field (and probably with the helper property metadata that exposes storage.metadata easier. Then I guess we would want some sort of decorator to wrap all the generators with like

def structure_metadata(structure_producing_method):
    def wrapper(*args, **kwargs):
        structure = structure_producing_method(*args, **kwargs)
        structure.metadata.source_code.method = structure_producing_method.__name__
        structure.metadata.source_code.args = args
        structure.metadata.source_code.kwargs = kwargs
        return structure
    return wrapper

(I'm just pulling that out of thin air, so no guarantee it works as written or has everything we want, but you get the idea).

liamhuber avatar Oct 04 '22 16:10 liamhuber

To have structure also on the same DataContainer footings sounds good to me :)

niklassiemer avatar Oct 05 '22 18:10 niklassiemer

I would just use the info dictionary that's already on every atoms, together with some small API to append and retrieve this data. That way we can also easily swap out the underlying storage, but we'd have the functionality straight way. Dual inheritance with PyironObject could be problematic due to the conflicting HDF impl's.

pmrv avatar Oct 07 '22 18:10 pmrv