Skip to content

Commit d099b7b

Browse files
authored
Merge pull request #722 from sarthakpati/721-move-unit-testing-data-to-the-mlcommons-storage
Move unit testing data to the mlcommons storage
2 parents bc72ff0 + 90af114 commit d099b7b

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ def run(self):
9292
"pyyaml",
9393
"tiffslide",
9494
"matplotlib",
95-
"requests>=2.25.0",
95+
"gdown",
9696
"pytest",
9797
"coverage",
9898
"pytest-cov",

testing/test_full.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from pathlib import Path
2-
import requests, zipfile, io, os, csv, random, copy, shutil, yaml, torch, pytest
2+
import gdown, zipfile, os, csv, random, copy, shutil, yaml, torch, pytest
33
import SimpleITK as sitk
44
import numpy as np
55
import pandas as pd
@@ -109,9 +109,7 @@
109109

110110
def test_generic_download_data():
111111
print("00: Downloading the sample data")
112-
urlToDownload = (
113-
"https://upenn.box.com/shared/static/y8162xkq1zz5555ye3pwadry2m2e39bs.zip"
114-
)
112+
urlToDownload = "https://drive.google.com/uc?id=1c4Yrv-jnK6Tk7Ne1HmMTChv-4nYk43NT"
115113

116114
files_check = [
117115
os.path.join(inputDir, "2d_histo_segmentation", "1", "image.tiff"),
@@ -122,9 +120,11 @@ def test_generic_download_data():
122120
for file in files_check:
123121
if not os.path.isfile(file):
124122
print("Downloading and extracting sample data")
125-
r = requests.get(urlToDownload)
126-
z = zipfile.ZipFile(io.BytesIO(r.content))
127-
z.extractall(testingDir)
123+
output = os.path.join(testingDir, "gandlf_unit_test_data.tgz")
124+
gdown.download(urlToDownload, output, quiet=False)
125+
with zipfile.ZipFile(output, "r") as zip_ref:
126+
zip_ref.extractall(testingDir)
127+
os.remove(output)
128128
break
129129

130130
sanitize_outputDir()

0 commit comments

Comments
 (0)