Commit e3e0230f authored by Russell Luke's avatar Russell Luke
Browse files

fixed data i/o for Elser!!!

parent de0a29af
......@@ -280,5 +280,9 @@ class Elser_Experiment(PhaseExperiment):
if __name__ == "__main__":
Elser = Elser_Experiment(Atoms=200, category='E', algorithm='RRR', lambda_0=0.95, lambda_max=0.95, anim=True)
......@@ -2,7 +2,7 @@ from pathlib import Path
import sys
import urllib.request
import tarfile
import zipfile
from zipfile import ZipFile
#shows progress of download
def dlProgress(counter, blocksize, size):
......@@ -43,16 +43,14 @@ def getData(problemFamily):
if query_yes_no("Do you want to download the " + problemFamily + " input data?"):
urllib.request.urlretrieve("","../InputData/" + problemFamily + ".zip", reporthook=dlProgress)
print("\nExtracting data...")
# don't know how to do this.
os.system("mv ../../../InputData/Phase/Elser/phase-retrieval-benchmarks-master/data/* ../../../InputData/Phase/Elser/")
os.system("rm -r ../../../InputData/Phase/Elser/phase-retrieval-benchmarks-master")
# don't know how to do this.
with ZipFile("../InputData/") as myzip:
myzip.extract(member='phase-retrieval-benchmarks-master/data/', path='../InputData/Phase/Elser/')
elif query_yes_no("Do you want to download the " + problemFamily + " input data?"):
urllib.request.urlretrieve("" + problemFamily + ".tar.gz","../InputData/" + problemFamily + ".tar.gz", reporthook=dlProgress)
print("\nExtracting data...")
tar ="../InputData/" + problemFamily + ".tar.gz", "r:gz")
tar.extractall("../InputData/" + problemFamily)
if not(my_file.is_file()):
print('* Message from *')
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment