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):
show()
if __name__ == "__main__":
Elser = Elser_Experiment(Atoms=200, category='E', algorithm='RRR', lambda_0=0.95, lambda_max=0.95, anim=True)
Elser.run()
Elser.show()
......@@ -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(" https://github.com/veitelser/phase-retrieval-benchmarks/archive/master.zip","../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/Elser.zip") as myzip:
print(myzip.namelist())
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(" http://vaopt.math.uni-goettingen.de/data/" + problemFamily + ".tar.gz","../InputData/" + problemFamily + ".tar.gz", reporthook=dlProgress)
print("\nExtracting data...")
tar = tarfile.open("../InputData/" + problemFamily + ".tar.gz", "r:gz")
tar.extractall("../InputData/" + problemFamily)
tar.close()
if not(my_file.is_file()):
print('***************************************************************************************')
print('* Message from GetData.py: *')
......
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