From 54097d32cdf601ae64769ef2502cf59bba1bebe6 Mon Sep 17 00:00:00 2001 From: Sara Veldhoen Date: Fri, 17 Nov 2023 09:13:52 +0100 Subject: [PATCH 1/2] Renamed test input files to include sample rate --- .../spectograms/{0.npz => 0_24000.npz} | Bin .../spectograms/{1.npz => 1_24000.npz} | Bin .../spectograms/{2.npz => 2_24000.npz} | Bin .../spectograms/{3.npz => 3_24000.npz} | Bin .../spectograms/{4.npz => 4_24000.npz} | Bin .../spectograms/{5.npz => 5_24000.npz} | Bin .../spectograms/{6.npz => 6_24000.npz} | Bin .../spectograms/{7.npz => 7_24000.npz} | Bin .../spectograms/{8.npz => 8_24000.npz} | Bin .../spectograms/{9.npz => 9_24000.npz} | Bin 10 files changed, 0 insertions(+), 0 deletions(-) rename data/input-files/test_source_id/spectograms/{0.npz => 0_24000.npz} (100%) rename data/input-files/test_source_id/spectograms/{1.npz => 1_24000.npz} (100%) rename data/input-files/test_source_id/spectograms/{2.npz => 2_24000.npz} (100%) rename data/input-files/test_source_id/spectograms/{3.npz => 3_24000.npz} (100%) rename data/input-files/test_source_id/spectograms/{4.npz => 4_24000.npz} (100%) rename data/input-files/test_source_id/spectograms/{5.npz => 5_24000.npz} (100%) rename data/input-files/test_source_id/spectograms/{6.npz => 6_24000.npz} (100%) rename data/input-files/test_source_id/spectograms/{7.npz => 7_24000.npz} (100%) rename data/input-files/test_source_id/spectograms/{8.npz => 8_24000.npz} (100%) rename data/input-files/test_source_id/spectograms/{9.npz => 9_24000.npz} (100%) diff --git a/data/input-files/test_source_id/spectograms/0.npz b/data/input-files/test_source_id/spectograms/0_24000.npz similarity index 100% rename from data/input-files/test_source_id/spectograms/0.npz rename to data/input-files/test_source_id/spectograms/0_24000.npz diff --git a/data/input-files/test_source_id/spectograms/1.npz b/data/input-files/test_source_id/spectograms/1_24000.npz similarity index 100% rename from data/input-files/test_source_id/spectograms/1.npz rename to data/input-files/test_source_id/spectograms/1_24000.npz diff --git a/data/input-files/test_source_id/spectograms/2.npz b/data/input-files/test_source_id/spectograms/2_24000.npz similarity index 100% rename from data/input-files/test_source_id/spectograms/2.npz rename to data/input-files/test_source_id/spectograms/2_24000.npz diff --git a/data/input-files/test_source_id/spectograms/3.npz b/data/input-files/test_source_id/spectograms/3_24000.npz similarity index 100% rename from data/input-files/test_source_id/spectograms/3.npz rename to data/input-files/test_source_id/spectograms/3_24000.npz diff --git a/data/input-files/test_source_id/spectograms/4.npz b/data/input-files/test_source_id/spectograms/4_24000.npz similarity index 100% rename from data/input-files/test_source_id/spectograms/4.npz rename to data/input-files/test_source_id/spectograms/4_24000.npz diff --git a/data/input-files/test_source_id/spectograms/5.npz b/data/input-files/test_source_id/spectograms/5_24000.npz similarity index 100% rename from data/input-files/test_source_id/spectograms/5.npz rename to data/input-files/test_source_id/spectograms/5_24000.npz diff --git a/data/input-files/test_source_id/spectograms/6.npz b/data/input-files/test_source_id/spectograms/6_24000.npz similarity index 100% rename from data/input-files/test_source_id/spectograms/6.npz rename to data/input-files/test_source_id/spectograms/6_24000.npz diff --git a/data/input-files/test_source_id/spectograms/7.npz b/data/input-files/test_source_id/spectograms/7_24000.npz similarity index 100% rename from data/input-files/test_source_id/spectograms/7.npz rename to data/input-files/test_source_id/spectograms/7_24000.npz diff --git a/data/input-files/test_source_id/spectograms/8.npz b/data/input-files/test_source_id/spectograms/8_24000.npz similarity index 100% rename from data/input-files/test_source_id/spectograms/8.npz rename to data/input-files/test_source_id/spectograms/8_24000.npz diff --git a/data/input-files/test_source_id/spectograms/9.npz b/data/input-files/test_source_id/spectograms/9_24000.npz similarity index 100% rename from data/input-files/test_source_id/spectograms/9.npz rename to data/input-files/test_source_id/spectograms/9_24000.npz From b5dfd0e2b70c60bb53df66f5748cc1c64a479644 Mon Sep 17 00:00:00 2001 From: Sara Veldhoen Date: Fri, 17 Nov 2023 13:34:00 +0100 Subject: [PATCH 2/2] Sort timestamps before processing, to make feature_extraction_test pass --- data_handling.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data_handling.py b/data_handling.py index 4e22972..048c6c7 100644 --- a/data_handling.py +++ b/data_handling.py @@ -34,7 +34,7 @@ def __init__( self.paths[int(p.stem)].update({"frame": p}) for p in datapath.glob(f"{SPECTOGRAM_INPUT_DIR}/*_{self.framerate}.npz"): self.paths[int(p.stem.split("_")[0])].update({"spec": p}) - self.timestamps = list(self.paths.keys()) + self.timestamps = sorted(list(self.paths.keys())) self.device = device self.list_of_shots = self.ListOfShots(datapath)