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

[Bug]: Invalid groups with linked children don't get detected as undocumented #429

Open
rettigl opened this issue Sep 12, 2024 · 6 comments
Labels
bug Something isn't working

Comments

@rettigl
Copy link
Collaborator

rettigl commented Sep 12, 2024

Contact Details

[email protected]

What happened?

If the converter gets a path which contains a link, but some undocumented elements in the path, it is not recognized as undocumented by the writer.
Example from NXmpes

 "/ENTRY[entry]/SAMPLE[sample]": {
    "bias": {
      "voltmeter": "@link:/entry/instrument/manipulator/sample_bias_voltmeter"
    }
}

Does not produce a warning, even though "bias" is not defined, but rather "bias_env". "bias" also does not get an NX_class attribute.

Relevant log output

No response

@rettigl rettigl added the bug Something isn't working label Sep 12, 2024
@rettigl
Copy link
Collaborator Author

rettigl commented Sep 12, 2024

/entry/sample/bias gets namefitted to /ENTRY/SAMPLE/BEAM/TRANSFORMATIONS ...

This code is clearly not functioning completely.

@lukaspie
Copy link
Collaborator

Isn't this a consequence of how we defined our namefitting algorithm? If bias is not explicitly defined in NXsample, it tries to namefit and BEAM in NXsample is the closest fit because of the b at the beginning. Then inside NXbeam, there is only TRANSFORMATIONS as a renameable group, so that's what it's fitting voltmeter to. So I don't think it's a bug.

This is why I am not a big fan of our current namefitting algo, but one needs to do something for these renameable fields, so I currently don't see any alternative. For NXsample, it is particularly bad because of the many uppercase groups.

The problem with throwing a warning is: what if I actually wanted to name my BEAM bias? I know, not very realistic, but there are other cases where something similar might happen. In that case, do we want to have a warning whenever we namefit a fully uppercase name?

@rettigl
Copy link
Collaborator Author

rettigl commented Sep 12, 2024

I think the solution would be to not do automatic name fitting, but always require to provide the NXCLASS in such cases (or in case of fields also the FIELDNAME).

@rettigl
Copy link
Collaborator Author

rettigl commented Sep 12, 2024

Otherwise this produces garbage, as here, and does not detect errors.

@lukaspie
Copy link
Collaborator

Note that during NIAC2024, a new resolution was adopted for uppercase notation: nexusformat/definitions#1436. After implementing this, we would probably get rid of these ambiguities.

See issue here: #441

@lukaspie
Copy link
Collaborator

lukaspie commented Oct 2, 2024

I think the solution would be to not do automatic name fitting, but always require to provide the NXCLASS in such cases (or in case of fields also the FIELDNAME).

We discussed this today and will adopt this to throw an error. Will look into the implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants