Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pineappl = "^1.0"
more-itertools = "^8.10.0"
appdirs = "^1.4.4"
tomli = "^2.0.1"
nnpdf-data = { version = "0.0.3" }
nnpdf-data = { version = "^4.1.1" }
yadism = { extras = ["box"], version = "^0.13.7", optional=true, markers = "python_version < '3.13'" }
eko = { extras = ["box"], version = "^0.14.2", optional=true, markers = "python_version < '3.13'" }

Expand Down
20 changes: 19 additions & 1 deletion src/pinefarm/cli/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,25 @@ def subcommand(pinecard, theory_path, pdf, dry, finalize=None):
finalize: str
path to the runfolder in which to run the post processing step
"""
pinecard = pathlib.Path(pinecard)
# Check whether pinecard is a path. If it is, override the configuration.
if (pinpath := pathlib.Path(pinecard)).exists():
# If this pinecard is not in the runcards folder, warn the user but let it continue
if pinpath.parent.absolute() != (
rcards := configs.configs["paths"]["runcards"]
):
logger.warning(
f"The pinecard ({pinecard}) is not in the runcards ({rcards}) folder, overriding config."
)
configs.configs["paths"]["runcards"] = pinpath.parent
pinecard = pinpath
# Otherwise, use the configuration to fill the path
else:
pinecard = configs.configs["paths"]["runcards"] / pinecard

# Check for existence
if not pinecard.exists():
raise FileNotFoundError(f"The pinecard {pinecard} cannot be found")

if finalize is not None:
finalize = pathlib.Path(finalize)

Expand Down
10 changes: 6 additions & 4 deletions src/pinefarm/external/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def decide_external_tool(dsname: str):
"""
# The decisions are usually based on the existence of a `.yaml` file with a specific name
# or a prefix in the pinecard

if dsname.startswith("NNLOJET"):
from .nnlojet import NNLOJET

Expand All @@ -54,7 +53,10 @@ def decide_external_tool(dsname: str):

return integrability.Integrability, "brown"

# Defaults to Madgraph
from . import mg5 # pylint: disable=import-outside-toplevel
# Try with Madgraph...
if (configs["paths"]["runcards"] / dsname / "launch.txt").exists():
from . import mg5 # pylint: disable=import-outside-toplevel

return mg5.Mg5, "blue"

return mg5.Mg5, "blue"
raise ValueError(f"pinefarm could not discover the tool to use for {dsname}")