Skip to content

Commit

Permalink
removing x-ray utils in from xrd reader.
Browse files Browse the repository at this point in the history
  • Loading branch information
RubelMozumder committed Nov 28, 2023
1 parent c593c92 commit fdeda34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions pynxtools/dataconverter/readers/xrd/xrd_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def get_a_value_or_warn(return_value="",
return return_value


# pylint: disable=too-many-statements
def feed_xrdml_to_template(template, xrd_dict, eln_dict, file_term, config_dict=None):
"""Fill template with data from xrdml type file.
Expand Down
5 changes: 2 additions & 3 deletions pynxtools/dataconverter/readers/xrd/xrd_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
from pathlib import Path
import warnings
import xml.etree.ElementTree as ET # for XML parsing
from xrayutilities.io.panalytical_xml import XRDMLFile # for reading XRDML files
from pynxtools.dataconverter.helpers import transform_to_intended_dt, remove_namespace_from_tag
from pynxtools.dataconverter.readers.xrd.xrd_helper import feed_xrdml_to_template

Expand Down Expand Up @@ -187,13 +186,13 @@ def parse_each_elm(self, parent_path, xml_node,

_, multi_childs_tag = self.has_multi_childs_with_same_tag(xml_node)
# List of tag extensions for child nodes which have the same tag.
tag_extensions: List[int] = [0]
tag_extensions = [0]
for child in iter(xml_node):
if child is not None:
self.parse_each_elm(parent_path, child,
multi_childs_tag, tag_extensions)

def has_multi_childs_with_same_tag(self, parent_node: ET.Element) -> Tuple[str, bool]:
def has_multi_childs_with_same_tag(self, parent_node: ET.Element) -> Tuple[bool, str]:
"""Check for multiple childs that have the same tag.
Parameter:
Expand Down

0 comments on commit fdeda34

Please sign in to comment.