@@ -216,7 +216,7 @@ def rainbow23_layouts(sites_count: int = 8) -> Tuple[ZigZagLayout]:
216216
217217
218218def fetch_publication_data (
219- base_dir : Optional [ str ] = "fermi_hubbard_data" ,
219+ base_dir : str = "fermi_hubbard_data" ,
220220 exclude : Optional [List [str ]] = None ,
221221 auth_token : Optional [str ] = None ,
222222) -> None :
@@ -270,19 +270,15 @@ def fetch_publication_data(
270270 # Correct endpoint for file download
271271 url = f"{ api_url } /files/{ file_id } /download"
272272
273- try :
274- # stream=True is better for large zip files
275- response = requests .get (url , headers = headers , stream = True )
273+ # stream=True is better for large zip files
274+ response = requests .get (url , headers = headers , stream = True )
276275
277- # If you still get a 400, this will print the server's explanation
278- if response .status_code != 200 :
279- print (f"Server returned { response .status_code } : { response .text } " )
280- continue
281-
282- with ZipFile (BytesIO (response .content )) as zfile :
283- zfile .extractall (base_dir )
284- print (f"Successfully downloaded and extracted { file_name } .\n " )
276+ # If you still get a 400, this will print the server's explanation
277+ if response .status_code != 200 :
278+ print (f"Server returned { response .status_code } : { response .text } " )
279+ continue
285280
286- except Exception as e :
287- print (f"Failed to download { file_name } : { e } " )
281+ with ZipFile (BytesIO (response .content )) as zfile :
282+ zfile .extractall (base_dir )
283+ print (f"Successfully downloaded and extracted { file_name } .\n " )
288284
0 commit comments