Skip to content

NCDatasets should fail when trying to access a nonexisting index. #30

@aramirezreyes

Description

@aramirezreyes

Hi:

When trying to read beyond the possible indices of a multifile dataset, NCDatasets doesn't fail, instead returns the array with some random data.

file2d = somelistoffiles
ds2d                = Dataset(file2d)
for (varname,var) in ds2d
    @show (varname,size(var))
end

returns: (varname, size(var)) = ("Prec", (512, 512, 2400))

If now I do

Prec = ds2d["Prec"].var[:,:,2500]

I get an array 512×512 Array{Float32,2} with some random information.

I would expect this to fail. Is that the expected behavior?

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