Skip to content
Snippets Groups Projects
Verified Commit f1323ea0 authored by Daniel Hornung's avatar Daniel Hornung
Browse files

MAINT: Code cleanup.

parent 4a507ac1
Branches
Tags
2 merge requests!107Release v0.11.0,!102ENH: XLSX reader
Pipeline #50701 failed
...@@ -103,8 +103,6 @@ Look at ``xlsx_utils.get_path_position`` for the specification of the "proper na ...@@ -103,8 +103,6 @@ Look at ``xlsx_utils.get_path_position`` for the specification of the "proper na
data_column_paths = {col.index: col.path for col in data_columns.values()} data_column_paths = {col.index: col.path for col in data_columns.values()}
# Parent path, insert in correct order. # Parent path, insert in correct order.
parent, proper_name = xlsx_utils.get_path_position(sheet) parent, proper_name = xlsx_utils.get_path_position(sheet)
# print(parent, proper_name, sheet.title)
# breakpoint()
if parent: if parent:
parent_sheetname = xlsx_utils.get_worksheet_for_path(parent, self._defining_path_index) parent_sheetname = xlsx_utils.get_worksheet_for_path(parent, self._defining_path_index)
if parent_sheetname not in self._handled_sheets: if parent_sheetname not in self._handled_sheets:
...@@ -148,7 +146,6 @@ Look at ``xlsx_utils.get_path_position`` for the specification of the "proper na ...@@ -148,7 +146,6 @@ Look at ``xlsx_utils.get_path_position`` for the specification of the "proper na
value = self._validate_and_convert(value, path) value = self._validate_and_convert(value, path)
_set_in_nested(mydict=data, path=path, value=value, prefix=parent, skip=1) _set_in_nested(mydict=data, path=path, value=value, prefix=parent, skip=1)
continue continue
continue
# Find current position in tree # Find current position in tree
parent_dict = self._get_parent_dict(parent_path=parent, foreign=foreign) parent_dict = self._get_parent_dict(parent_path=parent, foreign=foreign)
...@@ -157,11 +154,7 @@ Look at ``xlsx_utils.get_path_position`` for the specification of the "proper na ...@@ -157,11 +154,7 @@ Look at ``xlsx_utils.get_path_position`` for the specification of the "proper na
if proper_name not in parent_dict: if proper_name not in parent_dict:
parent_dict[proper_name] = [] parent_dict[proper_name] = []
parent_dict[proper_name].append(data) parent_dict[proper_name].append(data)
# breakpoint()
# if sheet.title == "Training.Organisation":
# breakpoint()
self._handled_sheets.add(sheet.title) self._handled_sheets.add(sheet.title)
# print(f"Added sheet: {sheet.title}")
def _is_multiple_choice(self, path: list[str]) -> bool: def _is_multiple_choice(self, path: list[str]) -> bool:
"""Test if the path belongs to a multiple choice section.""" """Test if the path belongs to a multiple choice section."""
...@@ -318,7 +311,7 @@ mydict: dict ...@@ -318,7 +311,7 @@ mydict: dict
path: list path: list
A list of keys, denoting the location of the value. A list of keys, denoting the location of the value.
value value
The value inside the dict. The value which shall be set inside the dict.
prefix: list prefix: list
A list of keys which shall be removed from ``path``. A KeyError is raised if ``path`` does not A list of keys which shall be removed from ``path``. A KeyError is raised if ``path`` does not
start with the elements of ``prefix``. start with the elements of ``prefix``.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment