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

NX_COMPLEX - Update nxdlTypes.xsd #1068

Merged
merged 8 commits into from
Jun 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 63 additions & 6 deletions nxdlTypes.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -451,16 +451,20 @@
<xs:documentation>any valid NeXus field or attribute type</xs:documentation>
</xs:annotation>
<xs:union memberTypes="
nxdl:ISO8601
nxdl:NX_BINARY
nxdl:NX_BOOLEAN
nxdl:NX_CCOMPLEX
nxdl:NX_CHAR
nxdl:NX_COMPLEX
nxdl:NX_DATE_TIME
nxdl:NX_FLOAT
nxdl:NX_INT
nxdl:NX_UINT
nxdl:NX_POSINT
nxdl:NX_NUMBER
nxdl:NX_DATE_TIME
nxdl:NX_BOOLEAN
nxdl:NX_BINARY
nxdl:ISO8601
nxdl:NX_PCOMPLEX
nxdl:NX_POSINT
nxdl:NX_QUATERNION
nxdl:NX_UINT
"/>
</xs:simpleType>

Expand Down Expand Up @@ -518,6 +522,59 @@
nxdl:NX_FLOAT
" />
</xs:simpleType>

<xs:simpleType name="list_of_doubles">
<xs:list itemType='xs:double' />
</xs:simpleType>

<xs:simpleType name="NX_CCOMPLEX">
<xs:annotation>
<xs:documentation>
Compound type cartesian representation of complex numbers (real and
imaginary parts) in NeXus.
</xs:documentation>
</xs:annotation>
<xs:restriction base="nxdl:list_of_doubles">
<xs:length value='2' />
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="NX_PCOMPLEX">
<xs:annotation>
<xs:documentation>
Compound type polar representation of complex numbers
(amplitude and phase *in radians*) in NeXus.
</xs:documentation>
</xs:annotation>
<xs:restriction base="nxdl:list_of_doubles">
<xs:length value='2' />
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="NX_COMPLEX">
<xs:annotation>
<xs:documentation>
Compound type representation of complex numbers (either
cartesian or polar form) in NeXus.
</xs:documentation>
</xs:annotation>
<xs:union memberTypes="
nxdl:NX_CCOMPLEX
nxdl:NX_PCOMPLEX
" />
</xs:simpleType>

<xs:simpleType name="NX_QUATERNION">
<xs:annotation>
<xs:documentation>
Compound type representation of quaternion numbers
(real,i,j,k) in NeXus.
</xs:documentation>
</xs:annotation>
<xs:restriction base="nxdl:list_of_doubles">
<xs:length value='4' />
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="NX_DATE_TIME">
<xs:annotation>
Expand Down
3 changes: 2 additions & 1 deletion utils/dev_units2rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
from units2rst import worker


sys.argv.append("../nxdlTypes.xsd")
# sys.argv.append("../nxdlTypes.xsd")
sys.argv.append("nxdlTypes.xsd")
worker('anyUnitsAttr')
2 changes: 2 additions & 0 deletions utils/units2rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ def worker(nodeMatchString, section = 'units'):
# get the definition of each type of units
for node in node_list:
node_name = node.get('name')
if node_name is None:
continue
if 'nxdl:' + node_name in members:
words = node.xpath('xs:annotation/xs:documentation', namespaces=ns)[0]
examples = []
Expand Down