Skip to content

Commit

Permalink
Merge pull request #722 from sarthakpati/721-move-unit-testing-data-t…
Browse files Browse the repository at this point in the history
…o-the-mlcommons-storage

Move unit testing data to the mlcommons storage
  • Loading branch information
Geeks-Sid authored Oct 30, 2023
2 parents bc72ff0 + 90af114 commit d099b7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ def run(self):
"pyyaml",
"tiffslide",
"matplotlib",
"requests>=2.25.0",
"gdown",
"pytest",
"coverage",
"pytest-cov",
Expand Down
14 changes: 7 additions & 7 deletions testing/test_full.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from pathlib import Path
import requests, zipfile, io, os, csv, random, copy, shutil, yaml, torch, pytest
import gdown, zipfile, os, csv, random, copy, shutil, yaml, torch, pytest
import SimpleITK as sitk
import numpy as np
import pandas as pd
Expand Down Expand Up @@ -109,9 +109,7 @@

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

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

sanitize_outputDir()
Expand Down

0 comments on commit d099b7b

Please sign in to comment.