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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
caosdb
Software
caosdb-advanced-user-tools
Commits
5ae24891
Commit
5ae24891
authored
1 year ago
by
Henrik tom Wörden
Browse files
Options
Downloads
Patches
Plain Diff
DOC: fix doc strings
parent
b26a08ba
No related branches found
Branches containing commit
No related tags found
Tags containing commit
4 merge requests
!100
WIP: Filling XLSX: Seems to be working.
,
!94
ENH: add framework for converting json schema into table templates
,
!93
Filling XLSX: Everything except multiple choice.
,
!92
ENH: xlsx template generator
Pipeline
#48092
failed
1 year ago
Stage: setup
Stage: cert
Stage: style
Stage: unittest
Stage: integrationtest
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/caosadvancedtools/table_json_conversion/table_generator.py
+9
-8
9 additions, 8 deletions
...aosadvancedtools/table_json_conversion/table_generator.py
with
9 additions
and
8 deletions
src/caosadvancedtools/table_json_conversion/table_generator.py
+
9
−
8
View file @
5ae24891
...
...
@@ -38,6 +38,7 @@ class ColumnType(Enum):
SCALAR
=
1
LIST
=
2
FOREIGN
=
3
IGNORE
=
3
class
RowType
(
Enum
):
...
...
@@ -62,20 +63,20 @@ class TableTemplateGenerator(ABC):
elements of the path within the JSON where the key is needed. Suppose we want
to distinguis Persons that are referenced by Trainings, foreign_keys must at
least contain the following: {
"
Training
"
: {
"
Person
"
: [key1, key2]}}.
Values wihtin the dicts can be a list representing the keys, a tuple where
the first element is the list representing the keys and the second elment is
a dict that allows to set further foreign keys at lower depth. The third
possibility is a dict. In that case no foreign keys exist at that level (
e.g. in the above example there is no foreign key for the path [
"
Training
"
].
Values wihtin the dicts can be a list representing the keys or
a dict that allows to set further foreign keys at lower depth.
In latter case if foreign keys exist at that level (
e.g. in the above example there might be further levels below
"
Person
"
.),
then the keys can be set using the special
"
__this__
"
key.
Example: {
"
Training
"
: {
"
__this__
"
: [
"
date
"
],
"
Person
"
: [key1, key2]}}
Here,
"
date
"
is the sole key for Training.
"""
pass
def
_generate_sheets_from_schema
(
self
,
schema
:
dict
,
foreign_keys
:
dict
=
None
)
->
dict
[
str
,
dict
[
str
,
tuple
[
str
,
list
]]
]
:
)
->
dict
[
str
,
dict
[
str
,
list
]]:
"""
generates a sheet definition from a given JSON schema
Parameters
----------
schema: dict
...
...
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