From f5f46d65c5cb27582125075fa164b5b1bb0fa1eb Mon Sep 17 00:00:00 2001 From: Radonirinaunimi Date: Fri, 18 Oct 2024 16:27:58 +0200 Subject: [PATCH] Init general convolution for PyAPI --- pineappl_py/src/grid.rs | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/pineappl_py/src/grid.rs b/pineappl_py/src/grid.rs index 396196d0..b64c4d60 100644 --- a/pineappl_py/src/grid.rs +++ b/pineappl_py/src/grid.rs @@ -297,20 +297,29 @@ impl PyGrid { .into_pyarray_bound(py) } + /// Convolve a grid with as many convolutions. + /// + /// # Panics /// TODO // #[pyo3(signature = (pdg_convs, xfxs, alphas, order_mask = None, bin_indices = None, channel_mask = None, xi = None))] #[must_use] pub fn convolve<'py>( &self, - _pdg_convs: Vec>, - _xfxs: &Bound<'py, PyIterator>, - _alphas: &Bound<'py, PyAny>, - _order_mask: Option>, - _bin_indices: Option>, - _channel_mask: Option>, - _xi: Option>, - _py: Python<'py>, + pdg_convs: Vec>, + xfxs: Vec, + alphas: PyObject, + order_mask: Option>, + bin_indices: Option>, + channel_mask: Option>, + xi: Option>, + py: Python<'py>, ) -> Bound<'py, PyArray1> { + // Closure for alphas function + let mut alphas = |q2: f64| { + let result: f64 = alphas.call1(py, (q2,)).unwrap().extract(py).unwrap(); + result + }; + todo!() }