Skip to content

Commit

Permalink
address Rubel's review
Browse files Browse the repository at this point in the history
  • Loading branch information
lukaspie committed Nov 30, 2023
1 parent ec2dd46 commit 9c9d6eb
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 22 deletions.
4 changes: 2 additions & 2 deletions pynxtools/dataconverter/readers/xps/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ def fill_template_with_xps_data(config_dict, xps_data_dict, template, entry_set)

fill_detector_group(key, entries_values, config_dict, template, entry_set)

if XPS_TOKEN in str(value):
elif XPS_TOKEN in str(value):
token = value.split(XPS_TOKEN)[-1]
entries_values = find_entry_and_value(
xps_data_dict, token, dt_typ=XPS_TOKEN
Expand Down Expand Up @@ -355,7 +355,7 @@ def read(
yaml.safe_load(eln), CONVERT_DICT, REPLACE_NESTED
)
)
elif file_ext in [".sle", ".xml", ".txt", "xy", "vms"]:
elif file_ext in XpsDataFileParser.__prmt_file_ext__:
parser = XpsDataFileParser([file])
data_dict = parser.get_dict(**kwargs)
config_file = parser.config_file
Expand Down
6 changes: 2 additions & 4 deletions pynxtools/dataconverter/readers/xps/sle/sle_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
# limitations under the License.
#

# pylint: disable=too-many-lines
# pylint: disable=too-many-instance-attributes
# pylint: disable=too-many-lines,too-many-instance-attributes

import re
import struct
Expand Down Expand Up @@ -172,8 +171,7 @@ def _update_xps_dict_with_spectrum(self, spectrum, key_map):
Map one spectrum from raw data to NXmpes-ready dict.
"""
# pylint: disable=too-many-locals
# pylint: disable=duplicate-code
# pylint: disable=too-many-locals,duplicate-code
group_parent = f'{self._root_path}/RegionGroup_{spectrum["group_name"]}'
region_parent = f'{group_parent}/regions/RegionData_{spectrum["spectrum_type"]}'
instrument_parent = f"{region_parent}/instrument"
Expand Down
3 changes: 1 addition & 2 deletions pynxtools/dataconverter/readers/xps/txt/txt_scienta.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,7 @@ def _update_xps_dict_with_spectrum(self, spectrum, key_map):
Map one spectrum from raw data to NXmpes-ready dict.
"""
# pylint: disable=too-many-locals
# pylint: disable=duplicate-code
# pylint: disable=too-many-locals,duplicate-code
group_parent = f'{self._root_path}/RegionGroup_{spectrum["spectrum_type"]}'
region_parent = f'{group_parent}/regions/RegionData_{spectrum["region_name"]}'
file_parent = f"{region_parent}/file_info"
Expand Down
6 changes: 2 additions & 4 deletions pynxtools/dataconverter/readers/xps/txt/txt_vamas_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
# pylint: disable=too-many-lines
# pylint: disable=too-few-public-methods
# pylint: disable=too-many-lines,too-few-public-methods

import itertools
import operator
Expand Down Expand Up @@ -131,8 +130,7 @@ def _update_xps_dict_with_spectrum(self, spectrum, key_map):
Map one spectrum from raw data to NXmpes-ready dict.
"""
# pylint: disable=too-many-locals
# pylint: disable=duplicate-code
# pylint: disable=too-many-locals,duplicate-code
group_parent = f'{self._root_path}/RegionGroup_{spectrum["group_name"]}'
region_parent = f'{group_parent}/regions/RegionData_{spectrum["spectrum_type"]}'
file_parent = f"{region_parent}/file_info"
Expand Down
5 changes: 2 additions & 3 deletions pynxtools/dataconverter/readers/xps/vms/vamas.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def _get_vms_type(self):
for vms_type in self.parser_map:
if vms_type.upper() in contents:
return vms_type
return None
return ""

def construct_data(self):
"""Map VMS format to NXmpes-ready dict."""
Expand Down Expand Up @@ -146,8 +146,7 @@ def construct_data(self):

def _update_xps_dict_with_spectrum(self, spectrum, key_map):
"""Map one spectrum from raw data to NXmpes-ready dict."""
# pylint: disable=too-many-locals
# pylint: disable=duplicate-code
# pylint: disable=too-many-locals,duplicate-code
group_parent = f'{self._root_path}/RegionGroup_{spectrum["group_name"]}'
region_parent = f'{group_parent}/regions/RegionData_{spectrum["spectrum_type"]}'
instrument_parent = f"{region_parent}/instrument"
Expand Down
4 changes: 1 addition & 3 deletions pynxtools/dataconverter/readers/xps/xml/xml_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ def parse_file(self, file, **kwargs):

return self.data_dict

# pylint: disable=too-many-locals
# pylint: disable=too-many-statements
# pylint: disable=too-many-branches
# pylint: disable=too-many-locals,too-many-statements, too-many-branches
def construct_data(self):
"""
Construct the Binding Energy and separate the counts for
Expand Down
6 changes: 2 additions & 4 deletions pynxtools/dataconverter/readers/xps/xy/xy_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
# limitations under the License.
#

# pylint: disable=too-many-lines
# pylint: disable=too-many-instance-attributes
# pylint: disable=too-many-lines,too-many-instance-attributes

import re
import itertools
Expand Down Expand Up @@ -138,8 +137,7 @@ def _update_xps_dict_with_spectrum(self, spectrum, key_map):
Map one spectrum from raw data to NXmpes-ready dict.
"""
# pylint: disable=too-many-locals
# pylint: disable=duplicate-code
# pylint: disable=too-many-locals,duplicate-code
group_parent = f'{self._root_path}/RegionGroup_{spectrum["group_name"]}'
region_parent = f'{group_parent}/regions/RegionData_{spectrum["region_name"]}'
file_parent = f"{region_parent}/file_info"
Expand Down

0 comments on commit 9c9d6eb

Please sign in to comment.