Skip to content

Commit c36b30f

Browse files
committed
add boto3 to requirements
1 parent df0ac82 commit c36b30f

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

ibllib/oneibl/aws.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
import boto3
2-
from pathlib import Path
3-
import numpy as np
41
import logging
2+
from pathlib import Path
53
import sys
4+
from time import time
5+
6+
import boto3
7+
import numpy as np
68

79
from one.api import ONE
810
from one.alf.files import add_uuid_string
@@ -19,6 +21,7 @@
1921
# https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-quickstart.html to set up
2022
# credentials
2123

24+
2225
class AWS:
2326
def __init__(self, s3_bucket_name=None, one=None):
2427
# TODO some initialisation routine to set up credentials for the first time
@@ -50,8 +53,10 @@ def _download_datasets(self, datasets):
5053
# probably better to do filter on collection ? Not for today
5154
objects = list(self.bucket.objects.filter(Prefix=aws_path))
5255
if len(objects) == 1:
56+
ts = time()
5357
_logger.info(f'Downloading {aws_path} to {file_path}')
5458
self.bucket.download_file(aws_path, file_path)
59+
_logger.debug(f'Complete. Time elapsed {time() - ts} for {file_path}')
5560
else:
5661
_logger.warning(f'{aws_path} not found on s3 bucket: {self.bucket.name}')
5762

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
boto3
12
click>=7.0.0
23
colorlog>=4.0.2
34
flake8>=3.7.8

0 commit comments

Comments
 (0)