Skip to content

Commit

Permalink
Fix compilation problems in the previous commit
Browse files Browse the repository at this point in the history
  • Loading branch information
cschwan committed Mar 4, 2024
1 parent 90d9efd commit 1e417a0
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions pineappl_py/src/grid.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use pineappl::evolution::OperatorInfo;
use pineappl::evolution::{AlphasTable, OperatorInfo};
use pineappl::grid::{Grid, Ntuple, Order};

#[allow(deprecated)]
Expand All @@ -16,7 +16,6 @@ use itertools::izip;
use numpy::{IntoPyArray, PyArray1, PyReadonlyArray1, PyReadonlyArray4, PyReadonlyArray5};

use std::collections::HashMap;
use std::error::Error;
use std::fs::File;
use std::io::BufReader;
use std::path::PathBuf;
Expand Down Expand Up @@ -580,6 +579,9 @@ impl PyGrid {
&self,
slices: &PyIterator,
order_mask: PyReadonlyArray1<bool>,
xi: (f64, f64),
ren1: Vec<f64>,
alphas: Vec<f64>,
) -> PyResult<PyFkTable> {
Ok(self
.grid
Expand All @@ -592,12 +594,16 @@ impl PyGrid {
let item1 = tuple.get_item(1).unwrap();
let slice_info = item0.extract::<PyOperatorSliceInfo>().unwrap();
let operator = item1.extract::<PyReadonlyArray4<f64>>().unwrap();
// TODO: can we get rid of the `into_owned` call?
let array = CowArray::from(operator.as_array().into_owned());

// TODO: change `PyErr` into something appropriate
Ok::<_, PyErr>((slice_info.slice_info, CowArray::from(operator.as_array())))
Ok::<_, PyErr>((slice_info.slice_info, array))
}),
// TODO: what if it's non-contiguous?
order_mask.as_slice().unwrap(),
xi,
&AlphasTable { ren1, alphas },
)
.map(|fk_table| PyFkTable { fk_table })
// TODO: get rid of this `.unwrap` call
Expand Down

0 comments on commit 1e417a0

Please sign in to comment.