NNPDF / pineappl

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

Add new struct `FkTable` #68

Closed cschwan closed 3 years ago

cschwan commented 3 years ago

Add a new struct FkTable, which is a special case of Grid, but

alecandido commented 3 years ago

I agree this will simplify the interaction at boundaries (both eko and fit).

The moment you provide the implementation we can migrate the python interface, but there is not so much to actually migrate: being a special case of Grid will provide a similar API, so we can just test and fix few incompatibilities.

Personal interest: being that there is no inheritance, how are you going to implement this structure? My natural answer would have been to promote the API to a trait (with some default implementations), and have two trait implementers, but doing this a posteriori would require a massive code rework (and after all it's an approximation to subclassing, I'm too used to it...).

cschwan commented 3 years ago

Personal interest: being that there is no inheritance, how are you going to implement this structure? My natural answer would have been to promote the API to a trait (with some default implementations), and have two trait implementers, but doing this a posteriori would require a massive code rework (and after all it's an approximation to subclassing, I'm too used to it...).

Like this :smile: :

struct FkTable {
    table: Grid,
}
alecandido commented 3 years ago

That's a fair solution. Simple and effective :ok_hand: Maybe inheritance might have been more suitable for the task, nevertheless it's bad that I feel lost without.

cschwan commented 3 years ago

I added a first implementation in commit 497a446651aa2805807fe5668abd68df4c072c65.

cschwan commented 3 years ago

Implemented in the pyo3 branch: #51.