NXDL Manager : nxdl_manager

source code documentation

Load and/or document the structure of a NeXus NXDL class specification

The nxdl_manager calls the schema_manager and is called by ____tba_____.

class punx.nxdl_manager.NXDL_Manager(file_set=None)[source]

the NXDL classes found in nxdl_dir

class punx.nxdl_manager.NXDL__Mixin(nxdl_definition, *args, **kwargs)[source]

base class for each NXDL structure

assign_defaults()[source]

set default values for required components now

parse_nxdl_xml(*args, **kwargs)[source]

parse the XML node and assemble NXDL structure

class punx.nxdl_manager.NXDL__attribute(nxdl_definition, nxdl_defaults=None, *args, **kwargs)[source]

contents of a attribute structure (XML element) in a NXDL XML file

~parse_nxdl_xml

parse_nxdl_xml(xml_node)[source]

parse the XML content

class punx.nxdl_manager.NXDL__definition(nxdl_manager=None, *args, **kwargs)[source]

contents of a definition element in a NXDL XML file

Parameters

path (str) – absolute path to NXDL definitions directory (has nxdl.xsd)

parse_nxdl_xml()[source]

parse the XML content

set_file(fname)[source]

self.category: base_classes | applications | contributed_definitions

determine the category of this NXDL

class punx.nxdl_manager.NXDL__dim(nxdl_definition, nxdl_defaults=None, *args, **kwargs)[source]

contents of a dim structure (XML element) in a NXDL XML file

parse_nxdl_xml(xml_node)[source]

parse the XML content

class punx.nxdl_manager.NXDL__dimensions(nxdl_definition, nxdl_defaults=None, *args, **kwargs)[source]

contents of a dimensions structure (XML element) in a NXDL XML file

parse_nxdl_xml(xml_node)[source]

parse the XML content

class punx.nxdl_manager.NXDL__field(nxdl_definition, nxdl_defaults=None, *args, **kwargs)[source]

contents of a field structure (XML element) in a NXDL XML file

parse_nxdl_xml(xml_node)[source]

parse the XML content

class punx.nxdl_manager.NXDL__group(nxdl_definition, nxdl_defaults=None, *args, **kwargs)[source]

contents of a group structure (XML element) in a NXDL XML file

parse_nxdl_xml(xml_node)[source]

parse the XML content

contents of a link structure (XML element) in a NXDL XML file

example from NXmonopd:

<link name="polar_angle" target="/NXentry/NXinstrument/NXdetector/polar_angle">
    <doc>Link to polar angle in /NXentry/NXinstrument/NXdetector</doc>
</link>
<link name="data" target="/NXentry/NXinstrument/NXdetector/data">
    <doc>Link to data in /NXentry/NXinstrument/NXdetector</doc>
</link>
parse_nxdl_xml(xml_node)[source]

parse the XML content

class punx.nxdl_manager.NXDL__symbols(nxdl_definition, nxdl_defaults=None, *args, **kwargs)[source]

contents of a symbols structure (XML element) in a NXDL XML file

example from NXcrystal:

<symbols>
  <doc>These symbols will be used below to coordinate dimensions with the same lengths.</doc>
  <symbol name="n_comp"><doc>number of different unit cells to be described</doc></symbol>
  <symbol name="i"><doc>number of wavelengths</doc></symbol>
</symbols>
parse_nxdl_xml(symbols_node)[source]

parse the XML content

punx.nxdl_manager.get_NXDL_file_list(nxdl_dir)[source]

return a list of all NXDL files in the nxdl_dir

The list is sorted by NXDL category (base_classes, applications, contributed_definitions) and then alphabetically within each category.

punx.nxdl_manager.validate_xml_tree(xml_tree)[source]

validate an NXDL XML file against the NeXus NXDL XML Schema file

Parameters

xml_file_name (str) – name of XML file