diff --git a/pyproject.toml b/pyproject.toml index 90c9f08d..b9c07b30 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,8 +35,7 @@ pandas = "^2.1" rich = "^12.5.1" click = "^8.0.4" tomli = "^2.0.1" -nnpdf = { git = "https://github.com/NNPDF/nnpdf", optional = true} -lhapdf-management = { version = "^0.5", optional = true } +nnpdf-data = { version = "*", optional = true} [tool.poetry.group.docs] optional = true @@ -51,8 +50,7 @@ setuptools = "^69.0" optional = true [tool.poetry.group.test.dependencies] -lhapdf-management = { version = "^0.5" } -nnpdf = { git = "https://github.com/NNPDF/nnpdf" } +nnpdf-data = "*" pytest = "^7.1.3" pytest-cov = "^4.0.0" pytest-env = "^0.6.2" @@ -65,7 +63,7 @@ ipython = "^8.0" [tool.poetry.extras] docs = ["sphinx", "sphinx-rtd-theme", "sphinxcontrib-bibtex"] -nnpdf = ["nnpdf", "lhapdf-management"] +nnpdf = ["nnpdf-data"] [tool.poetry.scripts] pineko = "pineko:command" diff --git a/src/pineko/utils.py b/src/pineko/utils.py index 66076ee7..d1057fd2 100644 --- a/src/pineko/utils.py +++ b/src/pineko/utils.py @@ -29,14 +29,17 @@ def read_grids_from_nnpdf(dataset_name, configs=None): return None # Import NNPDF only if we really want it! - from nnpdf_data import legacy_to_new_map - from validphys.commondataparser import EXT - from validphys.loader import Loader + from nnpdf_data import legacy_to_new_map, path_commondata + from nnpdf_data.commondataparser import EXT, parse_new_metadata # We only need the metadata, so this should be enough + # pass it through the legacy_to_new in case this is an old name dataset_name, variant = legacy_to_new_map(dataset_name) - cd = Loader().check_commondata(dataset_name, variant=variant) - fks = cd.metadata.theory.FK_tables + + setname, observable = dataset_name.rsplit("_", 1) + metadata_file = path_commondata / setname / "metadata.yaml" + metadata = parse_new_metadata(metadata_file, observable, variant=variant) + fks = metadata.theory.FK_tables # Return it flat return [f"{i}.{EXT}" for operand in fks for i in operand]