scipp / scippnexus

h5py-like utility for NeXus files with seamless scipp integration
https://scipp.github.io/scippnexus/
BSD 3-Clause "New" or "Revised" License
3 stars 3 forks source link

fix: incorrect annotation #164

Closed jokasimr closed 10 months ago

jokasimr commented 10 months ago

Fixes #151.

YooSunYoung commented 10 months ago

We just tried static type-checker, and I was not sure if H5Base.attr should be annotated as Mapping or Attr.

jokasimr commented 10 months ago

Attr in scippnexus inherits from collections.abc.Mapping, an immutable mapping. But H5Base.attrs seems to be mutable (example).

It seems the H5Base.attrs attribute is not always an instantiation of the Attr class. Should it be?