Skip to content

Match NumPy behavior regarding ".npy" extension for names in .npz files #48

@jturner314

Description

@jturner314

As @jonathanstrong pointed out in #46, NumPy and ndarray-npy currently behave differently regarding the names of the arrays in .npz files. When writing a .npz file, NumPy unconditionally adds ".npy" to every name. When generating the public list of names when reading a .npz file, NumPy strips a single ".npy" (if present) from each name. When accessing an array in a .npz file by name, it first checks if that exact name is in the .npz file, and if not, it then tries the name with ".npy" appended. While I personally dislike the inconsistency/implicitness of this behavior, ndarray-npy should consider following it for compatibility with NumPy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    breaking changePRs that break backwards compatibility

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions