silx icon indicating copy to clipboard operation
silx copied to clipboard

Nexus: mygroup@default must be a name in mygroup

Open woutdenolf opened this issue 2 years ago • 7 comments

https://github.com/nexusformat/definitions/issues/1063

I believe we got this wrong in silx: we expect the default group to be an NXdata group, except for the default of NXroot don't we?

woutdenolf avatar Mar 05 '22 00:03 woutdenolf

For example here: https://github.com/silx-kit/silx/blob/360f890a617676a92f0bed6a28b718d09e70ec03/src/silx/io/nxdata/parse.py#L973

That's in fact wrong. What we should do is recurse through the group defaults until we get the final NXdata.

woutdenolf avatar Mar 05 '22 00:03 woutdenolf

As far as I have understod:

  • default points to a NXentry in case of NXroot
  • default can only point to an NXdata (in the underlying hierachy) in any other case

If that is not the case, the NIAC 2018 got it wrong.

vasole avatar Mar 05 '22 07:03 vasole

I guess you propose we should check if the target group contains a default attribute in case of the target not being an NXdata but another type of group to support the step-by-step approach.

Probably we should take an example with a relative path down the hierarchy going beyond just the inmediate level. If that is already supported but NeXpy, I would not expect any trouble.

vasole avatar Mar 05 '22 07:03 vasole

I guess you propose we should check if the target group contains a default attribute in case of the target not being an NXdata but another type of group.

Indeed. I will double check again with the NIAC before doing that though. Thanks for the input!

woutdenolf avatar Mar 05 '22 08:03 woutdenolf

IMO as a reader we should follow the specification, but also be permissive. The recursive approach supports a wider range of situation, so it sounds better.

t20100 avatar Mar 08 '22 07:03 t20100

True, but currently we don't support the step-by-step interpretation of the @default attribute which seems to be the intended interpretation as far as I understand.

woutdenolf avatar Mar 08 '22 17:03 woutdenolf

Yes we missing the recursive way.

t20100 avatar Mar 08 '22 17:03 t20100