You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We could incrementally add support for faster copy.
This would mean, in pado.shutil we'd switch to a different copy implementation based on the (IN, OUT) FileSystem class of fsspec...
Something like this maybe better integrated:
importosfrompado.imagesimportImageProviderfrompado.io.filesimporturlpathlike_to_fs_and_pathdefwrite_download_script(
image_provider: ImageProvider, destination: str|os.PathLike
) ->str:
""" get a bash-script for downloading images Parameters ---------- image_provider: thats what you want to copy destination: local path Returns ------- str: the bash script """finished_file=os.path.join(destination, "done")
script= [
"#!/bin/sh",
"FILES=$(cat << EOF",
]
forurlpathinimage_provider.df.urlpath:
fs, path=urlpathlike_to_fs_and_path(urlpath)
assert"gs"infs.protocoliffs.storage_argsorfs.storage_options: # type: ignoreraiseNotImplementedError("todo")
bucket_url=f"gs://{path}"script.append(bucket_url)
script.extend([
"EOF",
")",
f"echo \"$FILES\" | gsutil -m cp -I {destination!s}"f"touch {finished_file}",
"",
])
return"\n".join(script)
The text was updated successfully, but these errors were encountered:
We could incrementally add support for faster copy.
This would mean, in
pado.shutil
we'd switch to a different copy implementation based on the (IN, OUT) FileSystem class of fsspec...Something like this maybe better integrated:
The text was updated successfully, but these errors were encountered: