nexusformat / NIAC

Issue for the NIAC to discuss (no code)
2 stars 0 forks source link

Clarify Data Types #142

Open benajamin opened 2 years ago

benajamin commented 2 years ago

We have not specified precisely what NX_NUMBER incudes, e.g. does it include NX_QUATERNION? Further, issue https://github.com/nexusformat/definitions/issues/945 requires a data type that encompasses both NX_NUMBER and NX_CHAR.

benajamin commented 2 years ago

Proposal is to define NX_CHAR_XOR_NUM which encompasses NX_NUMBER and NX_CHAR such that either type can be used exclusively for all elements of the entire dataset.

benajamin commented 2 years ago

Proposal is to replace the description of NX_NUMBER in the NeXus manual with: "any of the set of non-compound number representations NX_INT, NX_UINT, NX_POSINT and NX_FLOAT."

benajamin commented 2 years ago

and for completeness: Proposal is to define NX_COMPOUND as encompassing the set of compound number types such as NX_COMPLEX, NX_CCOMPLEX, NX_PCOMPLEX and NX_QUATERNION

prjemian commented 2 years ago

NX_NUMBER is not vague:

    <xs:simpleType name="NX_NUMBER">
        <xs:annotation>
            <xs:documentation>any valid NeXus number representation</xs:documentation>
        </xs:annotation>
        <xs:union memberTypes="
            nxdl:NX_INT 
            nxdl:NX_UINT 
            nxdl:NX_POSINT 
            nxdl:NX_FLOAT
            " />
    </xs:simpleType>
FreddieAkeroyd commented 2 years ago

NX_ALPHANUM to me usually means a string of numbers and characters, how about NX_SIMPLETYPE ? or just NX_SIMPLE to complement NX_COMPOUND

prjemian commented 2 years ago

simpleType is an XSD/XML thing, seems awkward

prjemian commented 2 years ago

NX_CHAR_OR_NUM

prjemian commented 2 years ago

NX_CHAR_XOR_NUM

PeterC-DLS commented 2 years ago

and for completeness: Proposal is to define NX_COMPOUND as encompassing the set of compound number types such as NX_COMPLEX, NX_CCOMPLEX, NX_PCOMPLEX and NX_QUATERNION

Rejected as a use-case cannot be forseen without including simple number types (i.e. NX_NUMBER).