@@ -226,16 +226,17 @@ def _parse_resource_file(file) -> list[dict[str, Any]]:
226226DEFAULT_SOURCE : SourceOptions = _ENV_SOURCE if _ENV_SOURCE in {"ngc" , "pbss" } else "ngc"
227227
228228
229- def default_pbss_client ():
230- """Create a default S3 client for PBSS."""
231- try :
232- import boto3
233- from botocore .config import Config
234- except ImportError :
235- raise ImportError ("boto3 and botocore are required to download from PBSS." )
229+ def default_pbss_client ():
230+ """Create a default S3 client for PBSS."""
231+ try :
232+ import boto3
233+ from botocore .config import Config
234+ except ImportError :
235+ raise ImportError ("boto3 and botocore are required to download from PBSS." )
236+
237+ retry_config = Config (retries = {"max_attempts" : 10 , "mode" : "standard" })
238+ return boto3 .client ("s3" , endpoint_url = "https://pbss.s8k.io" , config = retry_config )
236239
237- retry_config = Config (retries = {"max_attempts" : 10 , "mode" : "standard" })
238- return boto3 .client ("s3" , endpoint_url = "https://pbss.s8k.io" , config = retry_config )
239240
240241def _s3_download (url : str , output_file : str | Path , _ : pooch .Pooch ) -> None :
241242 """Download a file from PBSS."""
@@ -340,12 +341,13 @@ def load(
340341) -> Path :
341342 """Download a resource from PBSS or NGC.
342343
343- Args:
344- model_or_data_tag: A pointer to the desired resource. Must be a key in the resources dictionary.
344+ Args:
345+ model_or_data_tag: A pointer to the desired resource. Must be a key in the resources dictionary.
345346 source: Either "pbss" (NVIDIA-internal) or "ngc" (NGC). Defaults to DEFAULT_SOURCE
346347 (from environment variable BIONEMO_DATA_SOURCE; defaults to "ngc").
347- resources: A custom dictionary of resources. If None, the default resources will be used. (Mostly for testing.)
348- cache_dir: The directory to store downloaded files. Defaults to BIONEMO_CACHE_DIR. (Mostly for testing.)
348+ resources: A custom dictionary of resources. If None, the default resources will be used. (Mostly for testing.)
349+ cache_dir: The directory to store downloaded files. Defaults to BIONEMO_CACHE_DIR. (Mostly for testing.)
350+
349351 Raises:
350352 ValueError: If the desired tag was not found, or if an NGC url was requested but not provided.
351353
0 commit comments