Skip to content

EKO xgrid_reshape manipulation leaves them in an unusable state #453

@scarlehoff

Description

@scarlehoff
from eko import EKO
from eko.interpolation import XGrid
from eko.io import manipulate
from pathlib import Path
new_xgrid = XGrid([0.05, 0.5, 1.0])
target = Path("to_test.tar")
eko_op = EKO.edit(target)
for i, elem in eko_op.items():
     eko_op[i] = manipulate.xgrid_reshape(elem, eko_op.xgrid, 2, targetgrid=new_xgrid, inputgrid=new_xgrid)
eko_op.close()
eko_op = EKO.edit(target)
for i, elem in eko_op.items():
    eko_op[i] = manipulate.xgrid_reshape(elem, eko_op.xgrid, 2, targetgrid=new_xgrid, inputgrid=new_xgrid)

This is related to NNPDF/nnpdf#2181 (comment) I didn't realize that they were also going to be written down with a shape that is no longer reflected by the metadata.

(not sure whether ths is a bug or a feature that I didn't know I wanted :P but I think eko should not writed down no-longer-readable ekos?)

to_test.tar.zip

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions