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

Job.copy_to fails in non-database mode #1742

Open
niklassiemer opened this issue Jan 27, 2025 · 0 comments
Open

Job.copy_to fails in non-database mode #1742

niklassiemer opened this issue Jan 27, 2025 · 0 comments
Labels
bug Something isn't working

Comments

@niklassiemer
Copy link
Member

niklassiemer commented Jan 27, 2025

I just tried to copy a job without having a database

from pyiron_base import Project

pr = Project('.')
pr2 = Project('test')
pr['job1'].copy_to(pr2)

and it failed with

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/n.siemer/anaconda/envs/pyiron/lib/python3.12/site-packages/pyiron_base/jobs/job/generic.py", line 710, in copy_to
    new_job_core, file_project, hdf5_project, reloaded = self._internal_copy_to(
                                                         ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/n.siemer/anaconda/envs/pyiron/lib/python3.12/site-packages/pyiron_base/jobs/job/generic.py", line 655, in _internal_copy_to
    )._internal_copy_to(
      ^^^^^^^^^^^^^^^^^^
  File "/home/n.siemer/anaconda/envs/pyiron/lib/python3.12/site-packages/pyiron_base/jobs/job/core.py", line 876, in _internal_copy_to
    _copy_database_entry(
  File "/home/n.siemer/anaconda/envs/pyiron/lib/python3.12/site-packages/pyiron_base/jobs/job/util.py", line 54, in _copy_database_entry
    db_entry = new_job_core.project.db.get_item_by_id(job_copied_id)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/n.siemer/anaconda/envs/pyiron/lib/python3.12/site-packages/pyiron_base/database/filetable.py", line 248, in get_item_by_id
    k: list(v.values())[0]
       ~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
@niklassiemer niklassiemer added the bug Something isn't working label Jan 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant