Skip to content

Commit

Permalink
moved filename generation outside if-else block
Browse files Browse the repository at this point in the history
  • Loading branch information
magdalendobson committed Oct 14, 2024
1 parent 54b8894 commit 3dc675e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion benchmark/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 3dc675e

Please sign in to comment.