Skip to content

Commit

Permalink
Fixes linting
Browse files Browse the repository at this point in the history
  • Loading branch information
domna committed Sep 12, 2023
1 parent 602b551 commit f41ed41
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions pynxtools/dataconverter/readers/rii_database/reader.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from pynxtools.dataconverter.readers.rii_database.dispersion_reader import (
DispersionReader,
)
from pynxtools.dataconverter.readers.utils import parse_json
from pynxtools.dataconverter.readers.utils import parse_json, handle_objects


class RiiReader(YamlJsonReader):
Expand All @@ -40,7 +40,7 @@ def __init__(self, *args, **kwargs):
".yaml": self.read_dispersion,
".json": self.parse_json_w_fileinfo,
"default": lambda _: self.appdef_defaults(),
"objects": self.handle_objects,
"objects": self.handle_rii_objects,
}

def read_dispersion(self, filename: str):
Expand Down Expand Up @@ -86,20 +86,9 @@ def parse_json_w_fileinfo(self, filename: str) -> Dict[str, Any]:

return template

def handle_objects(self, objects: Tuple[Any]) -> Dict[str, Any]:
def handle_rii_objects(self, objects: Tuple[Any]) -> Dict[str, Any]:
"""Handle objects and generate template entries from them"""
if objects is None:
return {}

template = {}

for obj in objects:
if not isinstance(obj, dict):
logging.warning("Ignoring unknown object of type %s", type(obj))
continue

template.update(obj)

template = handle_objects(objects)
self.fill_dispersion_in(template)

return template
Expand Down

0 comments on commit f41ed41

Please sign in to comment.