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 `Grid::write_lz4` method #80

Closed cschwan closed 2 years ago

cschwan commented 2 years ago

To read a Grid we have the Grid::read class method, which automatically detects whether a grid was compressed. The corresponding Grid::write can't guess whether we want to write a compressed grid, of course, so we need a Grid::write_lz4 method.

felixhekhorn commented 2 years ago

once this is completed the python version should be stripped from

is the decompress function actually needed https://github.com/NNPDF/runcards/blob/bdc0789e00c01856e3adabbdb4aeef6bdc7f0e5d/runcardsrunner/tools.py#L78 ? it is suspicious that it's return value is not read here: https://github.com/NNPDF/runcards/blob/bdc0789e00c01856e3adabbdb4aeef6bdc7f0e5d/runcardsrunner/external/interface.py#L39

alecandido commented 2 years ago

is the decompress function actually needed https://github.com/NNPDF/runcards/blob/bdc0789e00c01856e3adabbdb4aeef6bdc7f0e5d/runcardsrunner/tools.py#L78 ? it is suspicious that it's return value is not read here: https://github.com/NNPDF/runcards/blob/bdc0789e00c01856e3adabbdb4aeef6bdc7f0e5d/runcardsrunner/external/interface.py#L39

The decompress() function is actually decompressing the file whatever.lz4 -> whatever, and not loading the content in memory for later use. In this case it is used just to reset the status of the folder to an intermediate one. and restart from there, you don't need to load the value in this place, whatever is needed, is done later on.

In any case, this is an internal issue of runcards, this is not the proper place to deal with it.

cschwan commented 2 years ago

Implemented in commit dfdcdcc15ee5bfe50b774fa8e364b873d921ae1a.