From f0b12d546b421bd6f14926ec8d86851f2432e798 Mon Sep 17 00:00:00 2001 From: samwaseda Date: Wed, 29 May 2024 08:26:53 +0000 Subject: [PATCH 1/3] restore forbidding duplicate imports --- pyiron_base/project/archiving/import_archive.py | 2 ++ tests/archiving/test_import.py | 1 + 2 files changed, 3 insertions(+) diff --git a/pyiron_base/project/archiving/import_archive.py b/pyiron_base/project/archiving/import_archive.py index 5d1a0d3aa..1a1aa7ecf 100644 --- a/pyiron_base/project/archiving/import_archive.py +++ b/pyiron_base/project/archiving/import_archive.py @@ -27,6 +27,8 @@ def extract_archive(archive_directory): def import_jobs(project_instance, archive_directory, df, compressed=True): + if len(set(df["job"]) & set(project_instance.job_table().job)) > 0: + raise ValueError("Overlapping", df["job"], project_instance.job_table().job) # Copy HDF5 files # if the archive_directory is a path(string)/name of the compressed file if static_isinstance( diff --git a/tests/archiving/test_import.py b/tests/archiving/test_import.py index f2faba72b..92399da44 100644 --- a/tests/archiving/test_import.py +++ b/tests/archiving/test_import.py @@ -72,6 +72,7 @@ def test_import_compressed(self): compare_obj = dircmp(path_original, path_import) self.assertEqual(len(compare_obj.diff_files), 0) + @unittest.skip("Imports the same name fails") def test_unpack_to_nested_project(self): pr = self.pr.open("nested") pr_imp = pr.open("imported") From 6bc57ad00996a967055e9f1ca4abc3bcb4c1f9bb Mon Sep 17 00:00:00 2001 From: samwaseda Date: Wed, 19 Jun 2024 20:13:18 +0000 Subject: [PATCH 2/3] add remove --- tests/archiving/test_import.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/archiving/test_import.py b/tests/archiving/test_import.py index 92399da44..46b62a134 100644 --- a/tests/archiving/test_import.py +++ b/tests/archiving/test_import.py @@ -72,7 +72,6 @@ def test_import_compressed(self): compare_obj = dircmp(path_original, path_import) self.assertEqual(len(compare_obj.diff_files), 0) - @unittest.skip("Imports the same name fails") def test_unpack_to_nested_project(self): pr = self.pr.open("nested") pr_imp = pr.open("imported") @@ -105,6 +104,7 @@ def test_unpack_from_other_dir_uncompress(self): rmtree(pack_path) except Exception as err_msg: print(f"deleting unsuccessful: {err_msg}") + pr.remove(enable=True) def test_import_uncompress(self): self.pr.pack(destination_path=self.arch_dir, compress=False) From d8afc303a515839896e03d95a8288f0dde314938 Mon Sep 17 00:00:00 2001 From: samwaseda Date: Wed, 19 Jun 2024 20:19:44 +0000 Subject: [PATCH 3/3] remove the value error --- pyiron_base/project/archiving/import_archive.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/pyiron_base/project/archiving/import_archive.py b/pyiron_base/project/archiving/import_archive.py index 1a1aa7ecf..5d1a0d3aa 100644 --- a/pyiron_base/project/archiving/import_archive.py +++ b/pyiron_base/project/archiving/import_archive.py @@ -27,8 +27,6 @@ def extract_archive(archive_directory): def import_jobs(project_instance, archive_directory, df, compressed=True): - if len(set(df["job"]) & set(project_instance.job_table().job)) > 0: - raise ValueError("Overlapping", df["job"], project_instance.job_table().job) # Copy HDF5 files # if the archive_directory is a path(string)/name of the compressed file if static_isinstance(