From 0ce0eaaf8e71737ecdd7cc2d318a76fffd43e641 Mon Sep 17 00:00:00 2001 From: magdalendobson <58752279+magdalendobson@users.noreply.github.com> Date: Mon, 14 Oct 2024 17:04:38 -0400 Subject: [PATCH] moved filename generation outside if-else block (#314) --- 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