Skip to content

Commit

Permalink
fix: change name func
Browse files Browse the repository at this point in the history
  • Loading branch information
renaudjester committed Sep 17, 2024
1 parent e073ab5 commit a3ccd84
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions copernicusmarine/download_functions/download_original_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ def download_files(
pathlib.Path.mkdir(parent_dir, parents=True)
if max_concurrent_requests:
run_concurrently(
_original_files_file_download,
_download_one_file,
[
(username, endpoint_url, bucket, in_file, out_file)
for in_file, out_file in zip(
Expand All @@ -240,7 +240,7 @@ def download_files(
desc="Downloading files",
) as pbar:
for in_file, out_file in zip(filenames_in, filenames_out):
_original_files_file_download(
_download_one_file(
username, endpoint_url, bucket, in_file, out_file
)
pbar.update(1)
Expand Down Expand Up @@ -511,16 +511,13 @@ def _get_file_size_and_last_modified(
raise e


def _original_files_file_download(
def _download_one_file(
username,
endpoint_url: str,
bucket: str,
file_in: str,
file_out: pathlib.Path,
) -> pathlib.Path:
"""
Download ONE file and return the path of the result
"""
) -> None:
s3_client, s3_resource = get_configured_boto3_session(
endpoint_url,
["GetObject", "HeadObject"],
Expand All @@ -547,8 +544,6 @@ def _original_files_file_download(
f"of the file {file_out} is denied."
)

return file_out


# /////////////////////////////
# --- Tools
Expand Down

0 comments on commit a3ccd84

Please sign in to comment.