Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iter_jobs() fails without database #1221

Closed
jan-janssen opened this issue Nov 7, 2023 · 0 comments · Fixed by #1222
Closed

iter_jobs() fails without database #1221

jan-janssen opened this issue Nov 7, 2023 · 0 comments · Fixed by #1222

Comments

@jan-janssen
Copy link
Member

jan-janssen commented Nov 7, 2023

from pyiron_atomistics import Project

pr = Project('test')
pr.state.update({"disable_database": True})

pr_2 = pr.open("sub_1")
job_1 = pr_2.create.job.Lammps("lmp1")
job_1.structure = pr_2.create.structure.ase.bulk("Al")
job_1.run()

pr_3 = pr.open("sub_2")
job_1 = pr_3.create.job.Lammps("lmp2")
job_1.structure = pr_3.create.structure.ase.bulk("Al")
job_1.run()

try:
    for job in pr.iter_jobs(status="finished"):
        print(job.job_name)
finally:
    pr.remove_jobs(recursive=True, silently=True)
    pr.remove(enable=True)

This fails with the following error:

ValueError: The job with ID 2 is not listed in the database anymore.

Work around:

for job in pr.iter_jobs(status="finished", convert_to_object=False):
    print(job.project)
    print(job.project.load(job.job_name))

EDIT @liamhuber: disable database and cleanup in example

@jan-janssen jan-janssen linked a pull request Nov 7, 2023 that will close this issue
This was referenced Nov 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant