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

use consistent terms when names are flexible #562

Closed
prjemian opened this issue Apr 17, 2017 · 8 comments · Fixed by #698
Closed

use consistent terms when names are flexible #562

prjemian opened this issue Apr 17, 2017 · 8 comments · Fixed by #698

Comments

@prjemian
Copy link
Contributor

In some NXDL files, the name for a group, field, or attribute is flexible (the exact name given by the NXDL specification is not required) and is set at the time the HDF file is written. Across the suite of NXDL files, different terms are used to mark a name as flexible. In some cases, there is no indication that a name may be substituted. In others, upper case is used, In some other cases, such as for groups that have not been given explicit names, a default is shown in parentheses. A few, select examples should describe the variations:

NXDL type name given
NXdata field data
NXdata field variable
NXdata attribute AXISNAME_indices
NXentry group (data)
NXscan group (instrument)
NXtransformations field AXISNAME
NXtransformations field AXISNAME_end

The documentation publishing process applies the parentheses for groups where the name is not specified in the NXDL file. Such as (from NXentry):

<group type="NXsample" />

is documented as

(sample): (optional) NXsample

It is proposed to choose either UPPER_CASE or (parentheses) to denote when a name is flexible and to apply this decision across all NXDL files. The proposed should not change the meaning of any definition, but just use consistent nomenclature.

@prjemian prjemian added the telco label Apr 17, 2017
@prjemian prjemian added this to the NeXus definitions 3.3 milestone Apr 17, 2017
@prjemian
Copy link
Contributor Author

prjemian commented Jun 7, 2017

Note that the procedures that publish the manual use the parenthesis style ((suggestion)). Perhaps we standardize that.

@prjemian
Copy link
Contributor Author

prjemian commented Jun 11, 2017

In nxdl.xsd, there is an attribute to an NXDL field element that addresses this point: nameType="any"

<xs:attribute name="nameType" use="optional" default="specified">
	<xs:annotation>
		<xs:documentation>
			This interprets the name attribute as:
			* ``specified`` = use as specified
			* ``any`` = can be any name not already used in group
		</xs:documentation>
	</xs:annotation>
	<xs:simpleType>
		<xs:restriction base="nx:NX_CHAR">
			<xs:enumeration value="specified"/>
			<xs:enumeration value="any"/>
		</xs:restriction>
	</xs:simpleType>
</xs:attribute>

@prjemian
Copy link
Contributor Author

If we enclose the flexible part of the name within parentheses, this will require a change to the XML Schema and the regular expression.

Suggest that we use all capital letters (in addition to the nameType="any" attribute) to indicate in the documentation when a name is flexible. "All caps" looks simpler.

@prjemian
Copy link
Contributor Author

Pulling this out of the NXDL 3.3 milestone since a draft may take some review before acceptance. Will work that up in a branch.

@prjemian prjemian modified the milestones: later, NXDL 3.3 Jun 29, 2017
prjemian added a commit that referenced this issue Jun 30, 2017
@prjemian prjemian modified the milestones: NXDL 3.4, later Jun 30, 2017
@zjttoefs
Copy link
Contributor

Discussed at the Telco today. Just UPPERCASE wasn't deemed obvious enough. The parentheses were not strongly favoured either, though.
Suggestion was to use the uppercase to instruct the user directly like
AXISNAMEPLACEHOLDER and AXISNAMEPLACEHOLDER_indices. Use of underscores as in AXISNAME_PLACEHOLDER was discouraged because AXISNAME_PLACEHOLDER_indices looks confusing.
Alternatives could be CHANGETHISAXISNAME or the like.

@zjttoefs zjttoefs removed the telco label Aug 8, 2017
@prjemian
Copy link
Contributor Author

Might not make the next milestone (NXDLD 2018.3 planned) but will leave on the list for now.

@zjttoefs zjttoefs modified the milestones: NXDL 2018.4, NXDL 2018.10 May 2, 2018
@prjemian prjemian modified the milestones: NXDL 2018.8, NXDL 2019.1 Sep 5, 2018
@zjttoefs
Copy link
Contributor

zjttoefs commented Sep 7, 2018

Also relevant for CHANGETHISAXISNAME_set for demand values as in #599

prjemian added a commit that referenced this issue Jan 21, 2020
prjemian added a commit that referenced this issue Jan 21, 2020
@prjemian
Copy link
Contributor Author

The table given above will change to:

NXDL type name given
NXdata field DATA
NXdata field VARIABLE
NXdata attribute AXISNAME_indices
NXentry group DATA
NXscan group INSTRUMENT
NXtransformations field AXISNAME
NXtransformations field AXISNAME_end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants