From e8d1d005bcad419208b4cd71b5fe20dc57898ce8 Mon Sep 17 00:00:00 2001 From: Lukas Pielsticker <50139597+lukaspie@users.noreply.github.com> Date: Wed, 31 Jan 2024 10:34:58 +0100 Subject: [PATCH] rename Phi parser and mapper --- .../dataconverter/readers/xps/file_parser.py | 8 ++++---- .../readers/xps/{spe => phi}/__init__.py | 0 .../xps/{spe/spe_phi.py => phi/spe_pro_phi.py} | 15 +++++++-------- 3 files changed, 11 insertions(+), 12 deletions(-) rename pynxtools/dataconverter/readers/xps/{spe => phi}/__init__.py (100%) rename pynxtools/dataconverter/readers/xps/{spe/spe_phi.py => phi/spe_pro_phi.py} (99%) diff --git a/pynxtools/dataconverter/readers/xps/file_parser.py b/pynxtools/dataconverter/readers/xps/file_parser.py index 2c75e3e1b..df601590b 100644 --- a/pynxtools/dataconverter/readers/xps/file_parser.py +++ b/pynxtools/dataconverter/readers/xps/file_parser.py @@ -23,11 +23,10 @@ from typing import List, Dict +from pynxtools.dataconverter.readers.xps.phi.spe_pro_phi import MapperPhi from pynxtools.dataconverter.readers.xps.sle.sle_specs import SleMapperSpecs -from pynxtools.dataconverter.readers.xps.spe.spe_phi import SpeMapperPhi # from pynxtools.dataconverter.readers.xps.slh.slh_specs import SlhMapperSpecs -from pynxtools.dataconverter.readers.xps.pro.pro_phi import ProMapperPhi from pynxtools.dataconverter.readers.xps.txt.txt_scienta import TxtMapperScienta # from pynxtools.dataconverter.readers.xps.txt.txt_specs import TxtMapperSpecs @@ -42,12 +41,13 @@ class XpsDataFileParser: """Class intended for receiving any type of XPS data file.""" - __prmt_file_ext__ = ["sle", "txt", "vms", "xml", "xy"] + __prmt_file_ext__ = ["pro", "sle", "spe", "txt", "vms", "xml", "xy"] __prmt_metadata_file_ext__ = ["slh"] __vendors__ = ["kratos", "phi", "scienta", "specs", "unkwown"] __prmt_vndr_cls: Dict[str, Dict] = { + "pro": {"phi": MapperPhi}, "sle": {"specs": SleMapperSpecs}, - "spe": {"phi": SpeMapperPhi}, + "spe": {"phi": MapperPhi}, # "slh": {"specs": SlhMapperSpecs}, "txt": { "scienta": TxtMapperScienta, diff --git a/pynxtools/dataconverter/readers/xps/spe/__init__.py b/pynxtools/dataconverter/readers/xps/phi/__init__.py similarity index 100% rename from pynxtools/dataconverter/readers/xps/spe/__init__.py rename to pynxtools/dataconverter/readers/xps/phi/__init__.py diff --git a/pynxtools/dataconverter/readers/xps/spe/spe_phi.py b/pynxtools/dataconverter/readers/xps/phi/spe_pro_phi.py similarity index 99% rename from pynxtools/dataconverter/readers/xps/spe/spe_phi.py rename to pynxtools/dataconverter/readers/xps/phi/spe_pro_phi.py index e377cbc27..f0a1febf4 100644 --- a/pynxtools/dataconverter/readers/xps/spe/spe_phi.py +++ b/pynxtools/dataconverter/readers/xps/phi/spe_pro_phi.py @@ -1,9 +1,8 @@ """ Parser for reading XPS (X-ray Photoelectron Spectroscopy) data from -Specs Lab Prodigy XY exports, to be passed to mpes nxdl -(NeXus Definition Language) template. +Phi PHI Versaprobe instruments (.spe or .pro format), to be passed to +mpes nxdl (NeXus Definition Language) template. """ - # Copyright The NOMAD Authors. # # This file is part of NOMAD. See https://nomad-lab.eu for further info. @@ -40,10 +39,10 @@ ) -class SpeMapperPhi(XPSMapper): +class MapperPhi(XPSMapper): """ Class for restructuring .xy data file from - Specs vendor into python dictionary. + Phi vendor into python dictionary. """ config_file = "config_spe_phi.json" @@ -53,11 +52,11 @@ def __init__(self): self.write_channels_to_data = True def _select_parser(self): - return SpeParser() + return PhiParser() def parse_file(self, file, **kwargs): """ - Parse the file using the Specs XY parser. + Parse the file using the Phi sle/pro parser. Parameters ---------- @@ -583,7 +582,7 @@ def _update_xps_dict_with_spectrum(self, spectrum, key_map): # ============================================================================= -class SpeParser: # pylint: disable=too-few-public-methods +class PhiParser: # pylint: disable=too-few-public-methods """ A parser for reading in PHI Versaprobe data in the .spe or .pro format.