Skip to content

Commit

Permalink
dont fail on keyerrors
Browse files Browse the repository at this point in the history
  • Loading branch information
scarlehoff committed Nov 30, 2023
1 parent 5ae01b4 commit c48cbe2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,23 +9,24 @@ jobs:
strategy:
max-parallel: 3
matrix:
python-version: [3.8, 3.9]
python-version: [3.9, "3.10"]

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v3
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v2
with:
python-version: ${{ matrix.python-version }}
auto-update-conda: true
activate-environment: pytesting
- name: Install dependencies and package
shell: bash --login {0}
run: |
conda info
python -m pip install --upgrade pip
pip install .[tf-cpu]
# Install LHAPDF
conda install -y lhapdf -c https://packages.nnpdf.science/conda
conda install -y lhapdf -c conda-forge
# Download and install a PDF set to ensure that the environment paths are working
wget http://pcteserver.mi.infn.it/~nnpdf/nnpdf31/NNPDF31_nnlo_as_0118.tar.gz
mkdir -p pdfsets
Expand Down
4 changes: 4 additions & 0 deletions benchmarks_and_tests/test_many_pdfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ def _compare_w_lhapdf(pdf, npoints=1000, tolerance=1e-6):
# Try loading the PDF
loaded_pdf = pdf.load()
_compare_w_lhapdf(loaded_pdf, npoints=args.points, tolerance=args.tolerance)
except KeyError as e:
# If there's a key error on the PDF either the .info file is malformed (then not our problem)
# or the PDF is using analytical running for alpha_s, so PDFFlow cannot use it
pass
except Exception as e:
# We are not going to care that much _how_ the failure happened
if args.verbose:
Expand Down

0 comments on commit c48cbe2

Please sign in to comment.