pyhf.contrib.utils.download#
- pyhf.contrib.utils.download(archive_url, output_directory, force=False, compress=False)[source]#
Download the patchset archive from the remote URL and extract it in a directory at the path given.
Example
>>> from pyhf.contrib.utils import download >>> download("https://doi.org/10.17182/hepdata.90607.v3/r3", "1Lbb-likelihoods") >>> import os >>> sorted(os.listdir("1Lbb-likelihoods")) ['BkgOnly.json', 'README.md', 'patchset.json'] >>> download("https://doi.org/10.17182/hepdata.90607.v3/r3", "1Lbb-likelihoods.tar.gz", compress=True) >>> import glob >>> glob.glob("1Lbb-likelihoods.tar.gz") ['1Lbb-likelihoods.tar.gz']
- Parameters:
- Raises:
InvalidArchiveHost – if the provided archive host name is not known to be valid