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

[NIAC 2018 Discussion] Messy specifications #31

Closed
vasole opened this issue Oct 4, 2018 · 10 comments
Closed

[NIAC 2018 Discussion] Messy specifications #31

vasole opened this issue Oct 4, 2018 · 10 comments
Milestone

Comments

@vasole
Copy link

vasole commented Oct 4, 2018

I would like to draw your attention that by setting changing or free to interpret specifications you are cooking a messy format:

NX_CHAR: any string representation All strings are to be encoded in UTF-8. Includes fixed-length strings, variable-length strings, and string arrays. Some file writers write strings as a string array of rank 1 and length 1. Clients should be prepared to handle such strings.

That clients should be ready to handle such strings does not mean that they are acceptable. I find legitimate that readers make the life of the users of such files difficult so that in turn they make sure the writers write proper files.

The NeXus API was writing things properly. At least I never encountered such discrepancies in old files (remember the 2010 workshop at the ESRF?). If people decide to use other things, they have to write correctly and not put the burden at the readers.

A specification can be bad, but a changing specification is even worse.

When I think about the lengthy discussion concerning auxiliary_signals that could have been avoided by allowing NXdata@signal to be a list of strings instead of a string I get really angry. It was said that allowing a list of strings could break code when reading the above specification the clients should have been already prepared!!!!

I really wonder how many NIAC members are actually developing software for other facilities because as a developer I cannot understand some decisions.

@vasole
Copy link
Author

vasole commented Oct 26, 2018

@prjemian

Proposal new text

NX_CHAR: The preferred string representation is UTF-8. Use of fixed-length strings and variable-length strings is accepted. String arrays cannot be used where only a string is expected (title, start_time, end_time, NX_class attribute,...). Attributes requiring the use of string arrays will be clearly marked as such (like the NXdata attribute auxiliary_signals).

@vasole
Copy link
Author

vasole commented Oct 26, 2018

@zjttoefs @mkoennecke

Please can you check if you prefer the word accepted or tolerated

@rayosborn
Copy link

I would suggest replacing "Use of fixed-length strings and variable-length strings is accepted" with "Both fixed-length strings and variable-length strings are valid."

@zjttoefs
Copy link
Contributor

With both options being in the same sentence I see no functional difference between accepted or tolerated. Ray's suggestion is more neutral and my preference.

@vasole
Copy link
Author

vasole commented Oct 26, 2018

OK then the proposal new text is

NX_CHAR: The preferred string representation is UTF-8. Both fixed-length strings and variable-length strings are valid. String arrays cannot be used where only a string is expected (title, start_time, end_time, NX_class attribute,...). Attributes requiring the use of string arrays will be clearly marked as such (like the NXdata attribute auxiliary_signals).

@zjttoefs
Copy link
Contributor

Last sentence should start with "Fields or attributes".

@vasole
Copy link
Author

vasole commented Oct 26, 2018

Thanks

NX_CHAR: The preferred string representation is UTF-8. Both fixed-length strings and variable-length strings are valid. String arrays cannot be used where only a string is expected (title, start_time, end_time, NX_class attribute,...). Fields or attributes requiring the use of string arrays will be clearly marked as such (like the NXdata attribute auxiliary_signals).

@zjttoefs
Copy link
Contributor

I'm happy with that!

@prjemian
Copy link
Contributor

This text appears in <definitions>/nxdlTypes.xsd

@prjemian
Copy link
Contributor

definitions issue created, so closing here

@prjemian prjemian added this to the NIAC 2018 milestone Oct 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants