Skip to content

dataset58 error in writing double real uneven #107

@cedumoul

Description

@cedumoul

Hi,
I'm facing an issue with writting dataset58 double precision, real, uneven spaced:
The current implentation lead to an error when rem_vals > 0

if rem_vals > 0:
                            fmt = ['%13.5e', '%20.11e', '%13.5e', '%20.11e']
                            fh.write((''.join(fmt[rem_vals]) + '\n') % tuple(data[4 * n4_blocks:]))

It is failing since in fmt[rem_vals] is getting only the nth value in the format list, while it should be a slice until the nth value. I think the implementation should be (tested on my side)

if rem_vals > 0:
                            fmt = ['%13.5e', '%20.11e', '%13.5e', '%20.11e']
                            fh.write((''.join(fmt[:rem_vals]) + '\n') % tuple(data[4 * n4_blocks:]))

best regards,
Cédric

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions