File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -18,16 +18,15 @@ def _is_valid_url(url: str) -> bool:
1818# From https://figshare.com/articles/dataset/IfBO_surrogate-compressed/31286173?file=61709839
1919DEFAULT_URL = "https://api.figshare.com/v2/file/download/61709839"
2020# The URL can be custom adjusted through the environment variable `IFBO_SURROGATE_URL`
21- _url = None
22- SURROGATE_URL = (
21+ SURROGATE_URL : str = (
2322 _url
2423 if (_url := os .getenv ("IFBO_SURROGATE_URL" )) and _is_valid_url (_url )
2524 else DEFAULT_URL
2625)
2726
2827
29- VERSION_MAP = {
30- "0.0.1" : dict {
28+ VERSION_MAP : dict [ str , dict [ str , str ]] = {
29+ "0.0.1" : {
3130 "url" : SURROGATE_URL ,
3231 "name" : "ftpfnv0.0.1" ,
3332 "final_name" : "bopfn_broken_unisep_1000curves_10params_2M" ,
@@ -61,7 +60,7 @@ def download_and_decompress(url: str, path: Path) -> None:
6160 path (Path): Path along with filename to save the downloaded file
6261
6362 Returns:
64- bool: Flag to indicate if the download and decompression was successful
63+ None
6564 """
6665 # Check if the file already exists
6766 if path .exists ():
@@ -74,7 +73,7 @@ def download_and_decompress(url: str, path: Path) -> None:
7473 if response .status_code != 200 :
7574 raise ValueError (
7675 f"Failed to download the surrogate from { url } ."
77- f" Recieved HTTP status code: { response .status_code } ."
76+ f" Received HTTP status code: { response .status_code } ."
7877 "Please either try again later, use an alternative link or contact the authors through github."
7978 )
8079
Original file line number Diff line number Diff line change 1- __version__ = "0.3.13 "
1+ __version__ = "0.4.0 "
You can’t perform that action at this time.
0 commit comments