Skip to content

Conversation

@mhabedan
Copy link
Contributor

As a follow-up to HEPData/hepdata-converter#64, this PR adds yoda-H5 support for the hepdata command line interface.
Namely the changes are

  • Include .yoda.h5 in supported file formats.
  • Update documentation accordingly.
  • Add test case for .yoda.h5.

Tested locally on commit f923a755 from hepdata-converter.
Requires HEPData/hepdata#884.

* Also upgrade actions/checkout and actions/setup-python.
* '%' encoded as '%2525' instead of '%25', so replace in URL.
* Remove explanation of Click problem with Python 3.6.
* Install virtual environment in subdirectory 'venv'.
* Correct typo: 'four' to 'six' when counting non-JSON file formats.
* Necessary to avoid "429 Client Error: TOO MANY REQUESTS" error.
* Try to avoid "too many 429 error responses".
* Use fewer test cases to avoid 429 error responses, keeping coverage.
* Avoid 429 responses from running tests for multiple Python versions.
* Check installation and "hepdata-cli --help" for all Python versions.
@GraemeWatt GraemeWatt requested a review from Copilot August 22, 2025 13:34
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds support for the yoda-H5 file format to the hepdata command line interface, following up on related work in the hepdata-converter repository. The changes enable users to download data in the .yoda.h5 format through both the API and CLI.

  • Include .yoda.h5 in the list of supported file formats
  • Update documentation to reflect the new format availability
  • Add test cases to verify yoda-H5 functionality

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
hepdata_cli/api.py Adds yoda.h5 to ALLOWED_FORMATS and updates documentation
hepdata_cli/cli.py Updates CLI help text to reference ALLOWED_FORMATS dynamically
tests/test_download.py Adds test cases for yoda-H5 format downloads
tests/test_search.py Reorganizes test parameters for API and CLI testing
README.md Updates documentation to include yoda.h5 format
setup.py Bumps minimum Python version requirement to 3.7
hepdata_cli/version.py Updates version to 0.2.3
.github/workflows/ci.yml Updates CI configuration for newer Python versions

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@GraemeWatt
Copy link
Member

@codecov-ai-reviewer review

@codecov-ai

This comment has been minimized.

* Comment to investigate double URL encoding (new issue HEPData#8).
@GraemeWatt GraemeWatt merged commit 93f4994 into HEPData:main Aug 22, 2025
9 checks passed
@GraemeWatt
Copy link
Member

@mhabedan : I've merged this PR and tagged a new release v0.2.3 (PyPI). Thanks for all your contributions to support the yoda.h5 format!

The table name "95% CL upper limit on XSEC times BF" you added to the tests uncovered a bug due to double URL encoding of the % symbol, so I added a quick fix (and opened an issue #8 to investigate further). Also, I think we've added rate-limiting to the production server since the tests were last run a couple of years ago, so I had to simplify the tests and specify that they're only run for one Python version in the CI to avoid getting "429 Client Error: TOO MANY REQUESTS" errors.

@mhabedan
Copy link
Contributor Author

mhabedan commented Sep 1, 2025

Thanks @GraemeWatt for pushing this over the finish line and apologies it turned out to be so much more cumbersome than I anticipated. Really appreciate your help on this! It works beautifully now.

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

Successfully merging this pull request may close these issues.

2 participants