Skip to content

Why is Array.name nullable? #2498

Closed
Closed
@d-v-b

Description

@d-v-b

The name of an array can be None, which is a bit odd since None is not a valid location in a file system. Can someone explain what we are expressing by allowing Array.name to be None? Note that this is carried over from v2, and the docstring references h5py.

def name(self) -> str | None:
"""Array name following h5py convention.
Returns
-------
str
The name of the array.
"""
if self.path:
# follow h5py convention: add leading slash
name = self.path
if name[0] != "/":
name = "/" + name
return name
return None

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