Skip to content

Commit

Permalink
Merge branch 'main' into 1-add-xps-sub-reader-for-phi-versaprobe-data
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaspie committed Feb 20, 2024
2 parents 8610c70 + e095173 commit ed0857f
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 26 deletions.
16 changes: 6 additions & 10 deletions pynxtools_xps/file_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,15 @@

from typing import List, Dict

from pynxtools_xps.sle.sle_specs import SleMapperSpecs
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.slh.slh_specs import SlhMapperSpecs
from pynxtools.dataconverter.readers.xps.txt.txt_scienta import TxtMapperScienta
from pynxtools_xps.txt.txt_scienta import TxtMapperScienta

# from pynxtools.dataconverter.readers.xps.txt.txt_specs import TxtMapperSpecs
from pynxtools.dataconverter.readers.xps.txt.txt_vamas_export import (
TxtMapperVamasExport,
)
from pynxtools.dataconverter.readers.xps.vms.vamas import VamasMapper
from pynxtools.dataconverter.readers.xps.xy.xy_specs import XyMapperSpecs
from pynxtools.dataconverter.readers.xps.xml.xml_specs import XmlMapperSpecs
from pynxtools_xps.txt.txt_vamas_export import TxtMapperVamasExport
from pynxtools_xps.vms.vamas import VamasMapper
from pynxtools_xps.xy.xy_specs import XyMapperSpecs
from pynxtools_xps.xml.xml_specs import XmlMapperSpecs


class XpsDataFileParser:
Expand Down
4 changes: 2 additions & 2 deletions pynxtools_xps/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
flatten_and_replace,
parse_flatten_json,
)
from pynxtools.dataconverter.readers.xps.file_parser import XpsDataFileParser
from pynxtools.dataconverter.readers.xps.reader_utils import construct_entry_name
from pynxtools.dataconverter.template import Template
from pynxtools_xps.file_parser import XpsDataFileParser
from pynxtools_xps.reader_utils import construct_entry_name

np.set_printoptions(threshold=sys.maxsize)

Expand Down
2 changes: 1 addition & 1 deletion pynxtools_xps/sle/sle_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import xarray as xr
import numpy as np

from pynxtools.dataconverter.readers.xps.reader_utils import (
from pynxtools_xps.reader_utils import (
XPSMapper,
construct_entry_name,
construct_data_key,
Expand Down
2 changes: 1 addition & 1 deletion pynxtools_xps/txt/txt_scienta.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import xarray as xr
import numpy as np

from pynxtools.dataconverter.readers.xps.reader_utils import (
from pynxtools_xps.reader_utils import (
XPSMapper,
construct_entry_name,
construct_data_key,
Expand Down
2 changes: 1 addition & 1 deletion pynxtools_xps/txt/txt_vamas_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import xarray as xr
import numpy as np

from pynxtools.dataconverter.readers.xps.reader_utils import (
from pynxtools_xps.reader_utils import (
XPSMapper,
check_uniform_step_width,
get_minimal_step,
Expand Down
16 changes: 8 additions & 8 deletions pynxtools_xps/vms/vamas.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
import xarray as xr
import numpy as np

from pynxtools.dataconverter.readers.xps.vms.vamas_data_model import VamasHeader, Block
from pynxtools_xps.vms.vamas_data_model import VamasHeader, VamasBlock

from pynxtools.dataconverter.readers.xps.reader_utils import (
from pynxtools_xps.reader_utils import (
XPSMapper,
construct_entry_name,
construct_data_key,
Expand Down Expand Up @@ -475,7 +475,7 @@ def _parse_norm_block(self):
This method has to be implemented in the inherited parsers.
"""
return Block()
return VamasBlock()

@abstractmethod
def _parse_map_block(self):
Expand All @@ -485,7 +485,7 @@ def _parse_map_block(self):
This method has to be implemented in the inherited parsers.
"""
return Block()
return VamasBlock()

def _get_scan_numbers_for_spectra(self, spectra):
"""
Expand Down Expand Up @@ -638,7 +638,7 @@ def _parse_norm_block(self):
"""
# pylint: disable=too-many-statements
block = Block()
block = VamasBlock()
block.block_id = self.data.pop(0).strip()
block.sample_id = self.data.pop(0).strip()
block.year = int(self.data.pop(0).strip())
Expand Down Expand Up @@ -719,7 +719,7 @@ def _parse_map_block(self):
"""
# pylint: disable=too-many-statements
block = Block()
block = VamasBlock()
block.block_id = self.data.pop(0).strip()
block.sample_id = self.data.pop(0).strip()
block.year = int(self.data.pop(0).strip())
Expand Down Expand Up @@ -844,7 +844,7 @@ def _parse_norm_block(self):
"""
# pylint: disable=too-many-statements
block = Block()
block = VamasBlock()
block.block_id = self.data.pop(0).strip()
block.sample_id = self.data.pop(0).strip()
block.year = int(self.data.pop(0).strip())
Expand Down Expand Up @@ -925,7 +925,7 @@ def _parse_map_block(self):
"""
# pylint: disable=too-many-statements
block = Block()
block = VamasBlock()
block.block_id = self.data.pop(0).strip()
block.sample_id = self.data.pop(0).strip()
block.year = int(self.data.pop(0).strip())
Expand Down
2 changes: 1 addition & 1 deletion pynxtools_xps/vms/vamas_data_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class VamasHeader:


@dataclass
class Block:
class VamasBlock:
"""An object to store a block of spectrum data and meta-data."""

block_id: str = ""
Expand Down
2 changes: 1 addition & 1 deletion pynxtools_xps/xml/xml_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import xarray as xr
import numpy as np

from pynxtools.dataconverter.readers.xps.reader_utils import (
from pynxtools_xps.reader_utils import (
XPSMapper,
construct_entry_name,
)
Expand Down
2 changes: 1 addition & 1 deletion pynxtools_xps/xy/xy_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
import xarray as xr
import numpy as np

from pynxtools.dataconverter.readers.xps.reader_utils import (
from pynxtools_xps.reader_utils import (
XPSMapper,
check_uniform_step_width,
get_minimal_step,
Expand Down

0 comments on commit ed0857f

Please sign in to comment.