Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
caosdb-advanced-user-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-advanced-user-tools
Commits
f1323ea0
Verified
Commit
f1323ea0
authored
1 year ago
by
Daniel Hornung
Browse files
Options
Downloads
Patches
Plain Diff
MAINT: Code cleanup.
parent
4a507ac1
Branches
Branches containing commit
Tags
Tags containing commit
2 merge requests
!107
Release v0.11.0
,
!102
ENH: XLSX reader
Pipeline
#50701
failed
1 year ago
Stage: setup
Stage: cert
Stage: style
Stage: unittest
Stage: integrationtest
Changes
1
Pipelines
2
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/caosadvancedtools/table_json_conversion/convert.py
+1
-8
1 addition, 8 deletions
src/caosadvancedtools/table_json_conversion/convert.py
with
1 addition
and
8 deletions
src/caosadvancedtools/table_json_conversion/convert.py
+
1
−
8
View file @
f1323ea0
...
@@ -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``.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment