Skip to content

.save() ignores schema's data type #1

@spthm

Description

@spthm

It is possible to reassign a value with a different type, e.g.

s = GadgetSnapshot('file_name')
s.load()
hsml = s.hsml[0]
hsml = hsml * np.ones(len(hsml)) * 2.0
s.hsml[0] = hsml

will result s.hsml[0].dtype == dtype('float64'), introducing errors on saving. FortranFile.write_ndarray[s]() should accept a type parameter, and SnapshotBase.save() should pass the type in the schema.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions