@@ -43,8 +43,8 @@ def makedir(path):
4343
4444# Download inputs from internet
4545print ("Downloading input files..." )
46- url = 'https://storage.googleapis.com/climateimpactlab-scc-tool/dscim-epa_input_data/dscim_v0.1.0_inputs .zip'
47- name = 'dscim_v0.1.0_inputs.zip'
46+ name = 'dscim_v20220929_inputs .zip'
47+ url = 'https://storage.googleapis.com/climateimpactlab-scc-tool/dscim-epa_input_data/' + name
4848with requests .get (url , stream = True ) as r :
4949 r .raise_for_status ()
5050 with open (name , 'wb' ) as f :
@@ -53,17 +53,17 @@ def makedir(path):
5353 if chunk : # filter out keep-alive new chunks
5454 f .write (chunk )
5555 pbar .update (len (chunk ))
56-
56+ print ( "" )
5757print ("Unzipping input files..." )
58- with zipfile .ZipFile ('./dscim_v0.1.0_inputs.zip' , 'r' ) as zip_ref :
58+ with zipfile .ZipFile (Path ( base ) / name , 'r' ) as zip_ref :
5959 for member in tqdm (zip_ref .infolist ()):
6060 try :
61- zip_ref .extract (member , './' )
61+ zip_ref .extract (member , Path ( base ) )
6262 except zipfile .error as e :
6363 pass
6464
65- if os .path .exists ("./dscim_v0.1.0_inputs.zip" ):
66- os .remove ("./dscim_v0.1.0_inputs.zip" )
65+ if os .path .exists (Path ( base ) / name ):
66+ os .remove (Path ( base ) / name )
6767else :
6868 print ("Download Failed" )
6969
0 commit comments