Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
L
LinkAhead Sample Management
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
LinkAhead Sample Management
Commits
dc1aebc5
Commit
dc1aebc5
authored
5 months ago
by
Florian Spreckelsen
Browse files
Options
Downloads
Patches
Plain Diff
ENH: Addapt upload sample script to configurable column names
parent
600603ba
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!1
F awi sams
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sample-management-custom/caosdb-server/scripting/bin/upload_sample_template.py
+4
-3
4 additions, 3 deletions
...tom/caosdb-server/scripting/bin/upload_sample_template.py
with
4 additions
and
3 deletions
sample-management-custom/caosdb-server/scripting/bin/upload_sample_template.py
+
4
−
3
View file @
dc1aebc5
...
@@ -42,7 +42,7 @@ from caoscrawler.logging import configure_server_side_logging
...
@@ -42,7 +42,7 @@ from caoscrawler.logging import configure_server_side_logging
from
bis_utils
import
(
replace_entity_urls_by_ids
,
from
bis_utils
import
(
replace_entity_urls_by_ids
,
SPECIAL_TREATMENT_SAMPLE
,
whitespace_cleanup_in_df
)
SPECIAL_TREATMENT_SAMPLE
,
whitespace_cleanup_in_df
)
from
sample_helpers.utils
import
CONSTANTS
from
sample_helpers.utils
import
CONSTANTS
,
get_column_header_name
# suppress warning of diff function
# suppress warning of diff function
apilogger
=
logging
.
getLogger
(
"
linkahead.apiutils
"
)
apilogger
=
logging
.
getLogger
(
"
linkahead.apiutils
"
)
...
@@ -66,7 +66,7 @@ def get_parser():
...
@@ -66,7 +66,7 @@ def get_parser():
def
_is_child_sample_table
(
filename
):
def
_is_child_sample_table
(
filename
):
tmp_data
=
pd
.
read_csv
(
filename
,
sep
=
'
,
'
)
tmp_data
=
pd
.
read_csv
(
filename
,
sep
=
'
,
'
)
if
'
Parent BIS ID
'
in
tmp_data
.
columns
:
if
'
Parent BIS ID
'
in
tmp_data
.
columns
:
return
not
tmp_data
[
"
Parent BIS
ID
"
].
isnull
().
all
()
return
not
tmp_data
[
get_column_header_name
(
"
Parent LinkAhead
ID
"
)
].
isnull
().
all
()
return
False
return
False
...
@@ -171,7 +171,8 @@ def main():
...
@@ -171,7 +171,8 @@ def main():
OBLIGATORY_COLUMNS
.
append
(
property_name
)
OBLIGATORY_COLUMNS
.
append
(
property_name
)
try
:
try
:
data
=
read_data_from_file
(
path
)
data
=
read_data_from_file
(
path
)
data
=
replace_entity_urls_by_ids
(
data
,
[
"
BIS ID
"
,
"
Storage ID
"
,
"
Parent BIS ID
"
])
data
=
replace_entity_urls_by_ids
(
data
,
[
get_column_header_name
(
name
)
for
name
in
[
"
entity_id
"
,
"
Storage ID
"
,
"
Parent LinkAhead ID
"
]])
pickle_out
=
NamedTemporaryFile
(
delete
=
False
,
suffix
=
"
.pkl
"
)
pickle_out
=
NamedTemporaryFile
(
delete
=
False
,
suffix
=
"
.pkl
"
)
data
.
to_pickle
(
pickle_out
.
name
)
data
.
to_pickle
(
pickle_out
.
name
)
except
DataInconsistencyError
as
err
:
except
DataInconsistencyError
as
err
:
...
...
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