diff --git a/src/pynxtools/nomad/parser.py b/src/pynxtools/nomad/parser.py index 6a872d398..8f26bdc61 100644 --- a/src/pynxtools/nomad/parser.py +++ b/src/pynxtools/nomad/parser.py @@ -40,10 +40,8 @@ import pynxtools.nomad.schema as nexus_schema from pynxtools.nexus.nexus import HandleNexus -# from pynxtools.nomad.utils import __rename_nx_to_nomad - -__REPLARCEMENT_FOR_NX = "BS" -__REPLARCEMENT_LEN = len(__REPLARCEMENT_FOR_NX) +__REPLACEMENT_FOR_NX = "BS" +__REPLACEMENT_LEN = len(__REPLACEMENT_FOR_NX) def _rename_nx_to_nomad(name: str) -> Optional[str]: @@ -56,7 +54,7 @@ def _rename_nx_to_nomad(name: str) -> Optional[str]: return name if name is not None: if name.startswith("NX"): - return name.replace("NX", __REPLARCEMENT_FOR_NX) + return name.replace("NX", __REPLACEMENT_FOR_NX) return name @@ -66,7 +64,7 @@ def _to_group_name(nx_node: ET.Element): """ # assuming always upper() is incorrect, e.g. NXem_msr is a specific one not EM_MSR! grp_nm = nx_node.attrib.get( - "name", nx_node.attrib["type"][__REPLARCEMENT_LEN:].upper() + "name", nx_node.attrib["type"][__REPLACEMENT_LEN:].upper() ) return grp_nm diff --git a/src/pynxtools/nomad/schema.py b/src/pynxtools/nomad/schema.py index b303b97d3..5fbbb6ac8 100644 --- a/src/pynxtools/nomad/schema.py +++ b/src/pynxtools/nomad/schema.py @@ -73,7 +73,7 @@ from pynxtools import get_definitions_url from pynxtools.definitions.dev_tools.utils.nxdl_utils import get_nexus_definitions_path -from pynxtools.nomad.utils import __REPLACEMNT_FOR_NX, __rename_nx_to_nomad +from pynxtools.nomad.utils import __REPLACEMENT_FOR_NX, __rename_nx_to_nomad # __URL_REGEXP from # https://stackoverflow.com/questions/3809401/what-is-a-good-regular-expression-to-match-a-url @@ -557,7 +557,7 @@ def __create_group(xml_node: ET.Element, root_section: Section): __add_common_properties(group, group_section) nx_name = xml_attrs.get( - "name", nx_type.replace(__REPLACEMNT_FOR_NX, "").upper() + "name", nx_type.replace(__REPLACEMENT_FOR_NX, "").upper() ) group_subsection = SubSection( section_def=group_section, diff --git a/src/pynxtools/nomad/utils.py b/src/pynxtools/nomad/utils.py index 818617b85..203e52bc7 100644 --- a/src/pynxtools/nomad/utils.py +++ b/src/pynxtools/nomad/utils.py @@ -18,7 +18,7 @@ from typing import Optional -__REPLACEMNT_FOR_NX = "BS" +__REPLACEMENT_FOR_NX = "BS" def __rename_nx_to_nomad(name: str) -> Optional[str]: @@ -31,5 +31,5 @@ def __rename_nx_to_nomad(name: str) -> Optional[str]: return name if name is not None: if name.startswith("NX"): - return name.replace("NX", __REPLACEMNT_FOR_NX) + return name.replace("NX", __REPLACEMENT_FOR_NX) return name