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

Make pyhf contrib download be able to handle multiple compression types #1519

Closed
matthewfeickert opened this issue Jul 5, 2021 · 1 comment · Fixed by #1697
Closed

Make pyhf contrib download be able to handle multiple compression types #1519

matthewfeickert opened this issue Jul 5, 2021 · 1 comment · Fixed by #1697
Assignees
Labels
contrib Targeting pyhf.contrib and not the core of pyhf feat/enhancement New feature or request help wanted Extra attention is needed / contributions welcome user request Request coming form a pyhf user

Comments

@matthewfeickert
Copy link
Member

matthewfeickert commented Jul 5, 2021

Description

@alexander-held has pointed out that at the moment (pyhf v0.6.2) pyhf contrib download can't download the probability models for:

as they both don't have the models compressed as tar.gz. At the moment, pyhf contrib download can only handle .tar.gz

with requests.get(archive_url) as response:
if compress:
with open(output_directory, "wb") as archive:
archive.write(response.content)
else:
with tarfile.open(
mode="r|gz", fileobj=BytesIO(response.content)
) as archive:
archive.extractall(output_directory)

but that should be expanded.

It is reasonable to have pyhf contirb download be more robust, but ti would also be helpful if HEPData archive uploads had a standardized archive compression format.

cc @kratsg

@matthewfeickert matthewfeickert added feat/enhancement New feature or request contrib Targeting pyhf.contrib and not the core of pyhf user request Request coming form a pyhf user labels Jul 5, 2021
@matthewfeickert matthewfeickert added the help wanted Extra attention is needed / contributions welcome label Jul 5, 2021
@matthewfeickert
Copy link
Member Author

This is related to Issue #1111.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contrib Targeting pyhf.contrib and not the core of pyhf feat/enhancement New feature or request help wanted Extra attention is needed / contributions welcome user request Request coming form a pyhf user
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant