From 05f189cf93269b1ae44ae2d9370c371deb13f860 Mon Sep 17 00:00:00 2001 From: Hillel Arnold Date: Thu, 24 Oct 2024 09:23:54 -0400 Subject: [PATCH 1/2] look in master_edited dir --- create_derivatives/routines.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/create_derivatives/routines.py b/create_derivatives/routines.py index ebfc842..4e87193 100644 --- a/create_derivatives/routines.py +++ b/create_derivatives/routines.py @@ -76,8 +76,8 @@ def get_tiff_file_paths(self, bag_path): tiff_files (list of pathlib.Paths): absolute filepaths for TIFF files. """ service_dir = Path(bag_path, "data", "service") - master_dir = Path(bag_path, "data", "master") - for tiff_dir in service_dir, master_dir: + master_edited_dir = Path(bag_path, "data", "master_edited") + for tiff_dir in service_dir, master_edited_dir: if tiff_dir.is_dir() and any(tiff_dir.iterdir()): tiff_files_dir = tiff_dir break From d5925c668af63c112988b73871f4d96d4c8559a2 Mon Sep 17 00:00:00 2001 From: Hillel Arnold Date: Thu, 24 Oct 2024 09:24:08 -0400 Subject: [PATCH 2/2] update tests --- .../3aai9usY3AZzCSFkB3RSQ9/bag-info.txt | 0 .../3aai9usY3AZzCSFkB3RSQ9/bagit.txt | 0 .../master_edited}/file_example_TIFF_10MB_001.tif | Bin .../master_edited}/file_example_TIFF_1MB_001.tif | Bin .../master_edited}/file_example_TIFF_5MB_001.tif | Bin .../3aai9usY3AZzCSFkB3RSQ9/manifest-md5.txt | 0 .../3aai9usY3AZzCSFkB3RSQ9/tagmanifest-md5.txt | 0 create_derivatives/tests.py | 4 ++-- 8 files changed, 2 insertions(+), 2 deletions(-) rename create_derivatives/fixtures/{unpacked_bag_with_tiff_master => unpacked_bag_with_tiff_master_edited}/3aai9usY3AZzCSFkB3RSQ9/bag-info.txt (100%) rename create_derivatives/fixtures/{unpacked_bag_with_tiff_master => unpacked_bag_with_tiff_master_edited}/3aai9usY3AZzCSFkB3RSQ9/bagit.txt (100%) rename create_derivatives/fixtures/{unpacked_bag_with_tiff_master/3aai9usY3AZzCSFkB3RSQ9/data/master => unpacked_bag_with_tiff_master_edited/3aai9usY3AZzCSFkB3RSQ9/data/master_edited}/file_example_TIFF_10MB_001.tif (100%) rename create_derivatives/fixtures/{unpacked_bag_with_tiff_master/3aai9usY3AZzCSFkB3RSQ9/data/master => unpacked_bag_with_tiff_master_edited/3aai9usY3AZzCSFkB3RSQ9/data/master_edited}/file_example_TIFF_1MB_001.tif (100%) rename create_derivatives/fixtures/{unpacked_bag_with_tiff_master/3aai9usY3AZzCSFkB3RSQ9/data/master => unpacked_bag_with_tiff_master_edited/3aai9usY3AZzCSFkB3RSQ9/data/master_edited}/file_example_TIFF_5MB_001.tif (100%) rename create_derivatives/fixtures/{unpacked_bag_with_tiff_master => unpacked_bag_with_tiff_master_edited}/3aai9usY3AZzCSFkB3RSQ9/manifest-md5.txt (100%) rename create_derivatives/fixtures/{unpacked_bag_with_tiff_master => unpacked_bag_with_tiff_master_edited}/3aai9usY3AZzCSFkB3RSQ9/tagmanifest-md5.txt (100%) diff --git a/create_derivatives/fixtures/unpacked_bag_with_tiff_master/3aai9usY3AZzCSFkB3RSQ9/bag-info.txt b/create_derivatives/fixtures/unpacked_bag_with_tiff_master_edited/3aai9usY3AZzCSFkB3RSQ9/bag-info.txt similarity index 100% rename from create_derivatives/fixtures/unpacked_bag_with_tiff_master/3aai9usY3AZzCSFkB3RSQ9/bag-info.txt rename to create_derivatives/fixtures/unpacked_bag_with_tiff_master_edited/3aai9usY3AZzCSFkB3RSQ9/bag-info.txt diff --git a/create_derivatives/fixtures/unpacked_bag_with_tiff_master/3aai9usY3AZzCSFkB3RSQ9/bagit.txt b/create_derivatives/fixtures/unpacked_bag_with_tiff_master_edited/3aai9usY3AZzCSFkB3RSQ9/bagit.txt similarity index 100% rename from create_derivatives/fixtures/unpacked_bag_with_tiff_master/3aai9usY3AZzCSFkB3RSQ9/bagit.txt rename to create_derivatives/fixtures/unpacked_bag_with_tiff_master_edited/3aai9usY3AZzCSFkB3RSQ9/bagit.txt diff --git a/create_derivatives/fixtures/unpacked_bag_with_tiff_master/3aai9usY3AZzCSFkB3RSQ9/data/master/file_example_TIFF_10MB_001.tif b/create_derivatives/fixtures/unpacked_bag_with_tiff_master_edited/3aai9usY3AZzCSFkB3RSQ9/data/master_edited/file_example_TIFF_10MB_001.tif similarity index 100% rename from create_derivatives/fixtures/unpacked_bag_with_tiff_master/3aai9usY3AZzCSFkB3RSQ9/data/master/file_example_TIFF_10MB_001.tif rename to create_derivatives/fixtures/unpacked_bag_with_tiff_master_edited/3aai9usY3AZzCSFkB3RSQ9/data/master_edited/file_example_TIFF_10MB_001.tif diff --git a/create_derivatives/fixtures/unpacked_bag_with_tiff_master/3aai9usY3AZzCSFkB3RSQ9/data/master/file_example_TIFF_1MB_001.tif b/create_derivatives/fixtures/unpacked_bag_with_tiff_master_edited/3aai9usY3AZzCSFkB3RSQ9/data/master_edited/file_example_TIFF_1MB_001.tif similarity index 100% rename from create_derivatives/fixtures/unpacked_bag_with_tiff_master/3aai9usY3AZzCSFkB3RSQ9/data/master/file_example_TIFF_1MB_001.tif rename to create_derivatives/fixtures/unpacked_bag_with_tiff_master_edited/3aai9usY3AZzCSFkB3RSQ9/data/master_edited/file_example_TIFF_1MB_001.tif diff --git a/create_derivatives/fixtures/unpacked_bag_with_tiff_master/3aai9usY3AZzCSFkB3RSQ9/data/master/file_example_TIFF_5MB_001.tif b/create_derivatives/fixtures/unpacked_bag_with_tiff_master_edited/3aai9usY3AZzCSFkB3RSQ9/data/master_edited/file_example_TIFF_5MB_001.tif similarity index 100% rename from create_derivatives/fixtures/unpacked_bag_with_tiff_master/3aai9usY3AZzCSFkB3RSQ9/data/master/file_example_TIFF_5MB_001.tif rename to create_derivatives/fixtures/unpacked_bag_with_tiff_master_edited/3aai9usY3AZzCSFkB3RSQ9/data/master_edited/file_example_TIFF_5MB_001.tif diff --git a/create_derivatives/fixtures/unpacked_bag_with_tiff_master/3aai9usY3AZzCSFkB3RSQ9/manifest-md5.txt b/create_derivatives/fixtures/unpacked_bag_with_tiff_master_edited/3aai9usY3AZzCSFkB3RSQ9/manifest-md5.txt similarity index 100% rename from create_derivatives/fixtures/unpacked_bag_with_tiff_master/3aai9usY3AZzCSFkB3RSQ9/manifest-md5.txt rename to create_derivatives/fixtures/unpacked_bag_with_tiff_master_edited/3aai9usY3AZzCSFkB3RSQ9/manifest-md5.txt diff --git a/create_derivatives/fixtures/unpacked_bag_with_tiff_master/3aai9usY3AZzCSFkB3RSQ9/tagmanifest-md5.txt b/create_derivatives/fixtures/unpacked_bag_with_tiff_master_edited/3aai9usY3AZzCSFkB3RSQ9/tagmanifest-md5.txt similarity index 100% rename from create_derivatives/fixtures/unpacked_bag_with_tiff_master/3aai9usY3AZzCSFkB3RSQ9/tagmanifest-md5.txt rename to create_derivatives/fixtures/unpacked_bag_with_tiff_master_edited/3aai9usY3AZzCSFkB3RSQ9/tagmanifest-md5.txt diff --git a/create_derivatives/tests.py b/create_derivatives/tests.py index 6df783c..a28fed6 100644 --- a/create_derivatives/tests.py +++ b/create_derivatives/tests.py @@ -247,7 +247,7 @@ def test_tiff_file_paths(self): for fixture_path, expected_service, expected_master in [ ("unpacked_bag_with_tiff", False, False), ("unpacked_bag_with_tiff_empty_service", False, False), - ("unpacked_bag_with_tiff_master", False, True), + ("unpacked_bag_with_tiff_master_edited", False, True), ("unpacked_bag_with_tiff_service", True, False)]: set_up_bag(settings.TMP_DIR, fixture_path, self.bag_id) bag = Bag.objects.last() @@ -255,7 +255,7 @@ def test_tiff_file_paths(self): for path in tiffs: self.assertTrue("data" in str(path)) self.assertEqual("service" in str(path), expected_service) - self.assertEqual("master" in str(path), expected_master) + self.assertEqual("master_edited" in str(path), expected_master) shutil.rmtree(bag.bag_path) def tearDown(self):