NNPDF / pineappl

PineAPPL is not an extension of APPLgrid
https://nnpdf.github.io/pineappl/
GNU General Public License v3.0
13 stars 3 forks source link

Return numpy arrays instead of lists in Python interface #82

Closed alecandido closed 2 years ago

alecandido commented 3 years ago

At the moment, we're not consistently dealing with arrays/lists in python, since we only tried late the rust_numpy crate.

We should then move the formerly implemented methods that returns Vec<T> (handled in python as a list) to return whatever PyArray is suitable from the mentioned crate.

New with rust_numpy:

https://github.com/N3PDF/pineappl/blob/a1fe0350b00a1129e35d680c5dfa4448a59f8fa6/pineappl_py/src/grid.rs#L410

old with Vec<T>:

https://github.com/N3PDF/pineappl/blob/a1fe0350b00a1129e35d680c5dfa4448a59f8fa6/pineappl_py/src/grid.rs#L427

https://github.com/N3PDF/pineappl/blob/a1fe0350b00a1129e35d680c5dfa4448a59f8fa6/pineappl_py/src/grid.rs#L444

cschwan commented 3 years ago

Yes, that's a good point!