Skip to content

Commit

Permalink
move s3 to global scope
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewPlayer3 committed Oct 15, 2024
1 parent aa2a427 commit 4a656d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/hyp3_srg/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from shapely.geometry import Polygon, shape


S3 = client('s3')
log = logging.getLogger(__name__)
EARTHDATA_HOST = 'urs.earthdata.nasa.gov'

Expand Down Expand Up @@ -275,7 +276,6 @@ def download_from_s3(uri: str, dest_dir: Optional[Path] = None) -> None:
uri: URI of the file to download
dest_dir: the directory to place the downloaded file in
"""
S3 = client('s3')
bucket, key, out_path = get_s3_args(uri, dest_dir)
S3.download_file(bucket, key, out_path)
return out_path

0 comments on commit 4a656d5

Please sign in to comment.