Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Option to cache input data cannot be used with XRootD prefixes #21

Open
vepadulano opened this issue Jul 10, 2023 · 0 comments
Open

Option to cache input data cannot be used with XRootD prefixes #21

vepadulano opened this issue Jul 10, 2023 · 0 comments
Assignees

Comments

@vepadulano
Copy link
Member

The function used to cache the input files on user's request only works with https based paths

def cache_files(file_paths: list, cache_dir: str, remote_prefix: str):
for url in file_paths:
out_path = Path(cache_dir) / url.removeprefix(remote_prefix).lstrip('/')
out_path.parent.mkdir(parents=True, exist_ok=True)
if not out_path.exists():
with tqdm(unit='B', unit_scale=True, unit_divisor=1024, miniters=1, desc=out_path.name) as t:
urlretrieve(url, out_path.absolute(), reporthook=_tqdm_urlretrieve_hook(t))

We could support also caching files in case XRootD paths are used

@vepadulano vepadulano self-assigned this Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant