From 3dc675e9c01f1a47e4eae88990740386efbb9d84 Mon Sep 17 00:00:00 2001 From: Magdalen Date: Mon, 14 Oct 2024 13:50:10 -0700 Subject: [PATCH] moved filename generation outside if-else block --- benchmark/datasets.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/benchmark/datasets.py b/benchmark/datasets.py index 76e7efdb..fe59e08b 100644 --- a/benchmark/datasets.py +++ b/benchmark/datasets.py @@ -153,6 +153,9 @@ def prepare(self, skip_data=False, original_size=10**9): fn = self.ds_fn sourceurl = os.path.join(self.base_url, fn) outfile = os.path.join(self.basedir, fn) + if self.nb != original_size: + outfile = outfile + '.crop_nb_%d' % self.nb + if os.path.exists(outfile): print("file %s already exists" % outfile) return @@ -164,7 +167,6 @@ def prepare(self, skip_data=False, original_size=10**9): else: # download cropped version of file file_size = 8 + self.d * self.nb * np.dtype(self.dtype).itemsize - outfile = outfile + '.crop_nb_%d' % self.nb if os.path.exists(outfile): print("file %s already exists" % outfile) return