Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOC: note the target attribute does not work for external file links #843

Merged
merged 1 commit into from
Oct 25, 2020

Conversation

prjemian
Copy link
Contributor

Fixes #841 as directed by NIAC2018, note the target attribute does not work for external file links.

@prjemian prjemian added high priority NIAC has requested The NIAC has requested this issue to be considered documentation labels Oct 20, 2020
@prjemian prjemian added this to the NXDL 2020.10 milestone Oct 20, 2020
@prjemian prjemian requested review from a team October 20, 2020 18:04
@prjemian prjemian self-assigned this Oct 20, 2020
@rayosborn
Copy link
Contributor

rayosborn commented Oct 20, 2020

The nexusformat API use the target attribute to define an external link, e.g.,

cspbbr3_300K['f1/data/data'] = NXlink(target='/entry/data/data', file='300K/f1.h5')

This is used to define the path within the external file to the linked data, but it is not, of course, stored in the external file itself. When nexusformat reads the external link, it creates an NXlink object that then contains this target, derived from the HDF5 external link definition, and this link resolves to the external file path when it is accessed. Since HDF5 disguises external links - it's actually quite difficult to find out that it is an external link - you need special calls to the h5py get function.

To summarize, our use of the target attribute is specific to nexusformat and is useful when using the API, but it is not a property of the stored parent file. It's not really a technical limitation - I think in a way, it shouldn't be part of the standard. It's up to the file writer whether they want the data to be external, but there is no difference to the innocent user. It's only an issue for any API the NIAC does or does not support. I don't know if this helps or not.

@prjemian
Copy link
Contributor Author

@rayosborn I'm going to copy your comment to the #842, where the target attribute is to be fixed.

@prjemian prjemian merged commit d2288c9 into master Oct 25, 2020
@prjemian prjemian deleted the 841-target-attr branch October 25, 2020 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation high priority NIAC has requested The NIAC has requested this issue to be considered
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DOC NeXus Target Attribute: only works for internal links
3 participants