Skip to content

Commit

Permalink
Merge pull request #2268 from NNPDF/api_extended_feb25
Browse files Browse the repository at this point in the history
Modify the VP api so it can take its own objects.
  • Loading branch information
scarlehoff authored Feb 4, 2025
2 parents 91226b2 + aa07cc9 commit d7bfbd0
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion validphys2/src/validphys/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from reportengine.helputils import get_parser_type
from reportengine.namespaces import NSList
from validphys.core import (
PDF,
CutsPolicy,
DataGroupSpec,
DataSetInput,
Expand Down Expand Up @@ -147,10 +148,16 @@ def _check_pdf_usable(self, pdf_name: str):

@element_of("pdfs")
@_id_with_label
def parse_pdf(self, name: str, unpolarized_bc=None):
def parse_pdf(self, name, unpolarized_bc=None):
"""A PDF set installed in LHAPDF.
If an unpolarized boundary condition it defined, it will be registered as part of the PDF.
If ``name`` is already an instance of a vp PDF object, return it unchanged.
"""
# NB: for reportengine to check the inputs, name should have type: Union[str, PDF]
# to be changed when support for older versions of python is dropped
if isinstance(name, PDF):
return name
pdf = self._check_pdf_usable(name)
if unpolarized_bc is not None:
pdf.register_boundary(unpolarized_bc=unpolarized_bc)
Expand Down

0 comments on commit d7bfbd0

Please sign in to comment.