Skip to content

Commit 34d3453

Browse files
committed
addressing code rabbit again
1 parent 01c709f commit 34d3453

2 files changed

Lines changed: 15 additions & 19 deletions

File tree

sub-packages/bionemo-scdl/pyproject.toml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,12 @@ test = [
2929
[project.scripts]
3030
convert_h5ad_to_scdl = "bionemo.scdl.scripts.convert_h5ad_to_scdl:main"
3131

32-
[tool.setuptools]
33-
include-package-data = true
34-
3532
[tool.setuptools.packages.find]
3633
where = ["src"]
3734
include = ["bionemo.*"]
3835
namespaces = true
3936
exclude = ["test*."]
4037

41-
[tool.setuptools.package-data]
42-
"bionemo.scdl.data.resources" = ["*.yaml", "*.yml"]
43-
4438
[tool.setuptools.dynamic]
4539
version = { file = "VERSION" }
4640

sub-packages/bionemo-scdl/src/bionemo/scdl/data/load.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -226,16 +226,17 @@ def _parse_resource_file(file) -> list[dict[str, Any]]:
226226
DEFAULT_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

240241
def _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

Comments
 (0)