From 669a29e2d4171dd279b94fe5576a0ac5fd2e57a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niccol=C3=B2=20Laurenti?= Date: Tue, 16 Apr 2024 17:08:00 +0200 Subject: [PATCH] Ciao --- pywrap/pywrap.cc | 9 +++++++++ tests/test_splitting_functions.py | 8 ++++++++ 2 files changed, 17 insertions(+) diff --git a/pywrap/pywrap.cc b/pywrap/pywrap.cc index 70e3cff9..b895d00d 100644 --- a/pywrap/pywrap.cc +++ b/pywrap/pywrap.cc @@ -416,6 +416,9 @@ PYBIND11_MODULE(_core, m) { py::init(), py::arg("order"), py::arg("entry1"), py::arg("entry2") ) + .def("GetOrder", &SplittingFunction::GetOrder) + .def("GetEntry1", &SplittingFunction::GetEntry1) + .def("GetEntry2", &SplittingFunction::GetEntry2) .def( "Regular", &SplittingFunction::Regular, py::arg("x"), py::arg("nf") ) @@ -438,6 +441,12 @@ PYBIND11_MODULE(_core, m) { py::arg("order1"), py::arg("entry1"), py::arg("entry2"), py::arg("order2"), py::arg("entry3"), py::arg("entry4") ) + .def("GetOrder1", &ConvolutedSplittingFunctions::GetOrder1) + .def("GetEntry1", &ConvolutedSplittingFunctions::GetEntry1) + .def("GetEntry2", &ConvolutedSplittingFunctions::GetEntry2) + .def("GetOrder2", &ConvolutedSplittingFunctions::GetOrder2) + .def("GetEntry3", &ConvolutedSplittingFunctions::GetEntry3) + .def("GetEntry4", &ConvolutedSplittingFunctions::GetEntry4) .def( "Regular", &ConvolutedSplittingFunctions::Regular, py::arg("x"), py::arg("nf") diff --git a/tests/test_splitting_functions.py b/tests/test_splitting_functions.py index 3ddb8919..813a4149 100644 --- a/tests/test_splitting_functions.py +++ b/tests/test_splitting_functions.py @@ -5,6 +5,14 @@ CA = 3 CF = 4./3 +def test_get_methods(): + for entry1 in ["q", "g"]: + for entry2 in ["q", "g"]: + sf = ad.SplittingFunction(0, entry1, entry2) + assert sf.GetOrder() == 0 + assert sf.GetEntry1() == entry1 + assert sf.GetEntry2() == entry2 + def test_Pgq0(): sf = ad.SplittingFunction(0, 'g', 'q')