Skip to content

Should SafeDataset drop __getitem__ and inherrit IterableDataset? #30

Open
@rehno-lindeque

Description

@rehno-lindeque

I quickly looked under the hood of this library because I needed to handle None values in my own dataset, but felt suspicious that this is trying to do something impossible.

Looking at https://github.com/msamogh/nonechucks/blob/master/nonechucks/dataset.py#L87-L96, I am under the impression that __getitem__ will return the same value for multiple indices. E.g. suppose index 2 is None, then dataset[2] == dataset[3].

Surely that doesn't make sense for a well-behaved map-style dataset?

Alternatively indices could be remapped via a Dict[int,int] for random access.

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