Skip to content
Snippets Groups Projects
Commit 49011bd7 authored by Christopher Rob Jones's avatar Christopher Rob Jones
Browse files

Merge branch 'ra-hlt1-fast-run-change' into '2024-patches'

Insert hash of downloaded MDF files before the extension instead of at the beginning

See merge request !3521
parents f9e866d1 fd805d81
No related branches found
No related tags found
3 merge requests!4232Run5: rebase, restructure run5 code, add back examples,!3700Synchronize master branch with 2024-patches,!3521Insert hash of downloaded MDF files before the extension instead of at the beginning
Pipeline #7819078 passed
......@@ -111,12 +111,15 @@ def download_inputs_locally(urls, dest_dir, assertion_endswith, max_size=None):
url = url[4:]
if url not in local_files:
# prepend hash of full URL in case basenames are not unique
basename = '{}_{}'.format(
hashlib.md5(url.encode()).hexdigest(), os.path.basename(url))
basename = os.path.basename(url)
assertion = 0
for ending in assertion_endswith:
assertion += basename.endswith(ending)
assert assertion
stem, ext = os.path.splitext(basename)
basename = '{}_{}{}'.format(stem,
hashlib.md5(url.encode()).hexdigest(),
ext)
dest = os.path.join(dest_dir, basename)
src_size = xrd_size(url)
......@@ -158,7 +161,7 @@ def download_inputs_locally(urls, dest_dir, assertion_endswith, max_size=None):
def download_digi_inputs_locally(urls, dest_dir, max_size=None):
"""
Calls download_inputs_locally specifically for digi or xdigi files.
Calls download_inputs_locally specifically for digi or xdigi files.
"""
assertion_endswith = ['.digi', '.xdigi']
return download_inputs_locally(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment