Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
platy-browser-data
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
Kimberly Isobel Meechan
platy-browser-data
Commits
72dfb368
Commit
72dfb368
authored
5 years ago
by
Constantin Pape
Browse files
Options
Downloads
Patches
Plain Diff
Add scripts to copy tables
parent
1c8e755e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
scripts/files/copy_helper.py
+16
-6
16 additions, 6 deletions
scripts/files/copy_helper.py
update_platy_browser.py
+11
-10
11 additions, 10 deletions
update_platy_browser.py
with
27 additions
and
16 deletions
scripts/files/copy_helper.py
+
16
−
6
View file @
72dfb368
...
...
@@ -22,8 +22,23 @@ def copy_files_with_pattern(src_folder, dst_folder, pattern):
copy_file
(
xml_in
,
xml_out
)
# For now we put symlinks with relative paths, but I am not sure
# if this is the best idea, because I don't know if it will work on windows
def
copy_tables
(
src_folder
,
dst_folder
,
name
):
pass
table_in
=
os
.
path
.
join
(
src_folder
,
'
tables
'
,
name
)
table_out
=
os
.
path
.
join
(
dst_folder
,
'
tables
'
,
name
)
os
.
makedirs
(
table_out
,
exist_ok
=
True
)
table_files
=
os
.
listdir
(
table_in
)
table_files
=
[
ff
for
ff
in
table_files
if
os
.
path
.
splitext
(
ff
)[
1
]
==
'
.csv
'
]
for
ff
in
table_files
:
src_file
=
os
.
path
.
join
(
table_in
,
ff
)
dst_file
=
os
.
path
.
join
(
table_out
,
ff
)
rel_path
=
os
.
path
.
relpath
(
src_file
,
table_out
)
if
not
os
.
path
.
exists
(
dst_file
):
os
.
symlink
(
rel_path
,
dst_file
)
def
copy_segmentation
(
src_folder
,
dst_folder
,
name
):
...
...
@@ -59,8 +74,3 @@ def copy_misc_data(src_folder, dst_folder):
if
os
.
path
.
exists
(
bkmrk_in
):
shutil
.
copyfile
(
bkmrk_in
,
os
.
path
.
join
(
dst_folder
,
'
bookmarks.json
'
))
# TODO
def
copy_static_segmentations
(
src_folder
,
dst_folder
):
pass
This diff is collapsed.
Click to expand it.
update_platy_browser.py
+
11
−
10
View file @
72dfb368
...
...
@@ -95,11 +95,10 @@ def make_attributes(folder, new_folder,
# update or copy nucleus tables
if
update_nucleus_tables
:
make_nucleus_tables
(
new_folder
,
NAME_NUCLEI
,
'
tmp_tables_nuclei
'
,
RES_NUCLEI
,
target
=
target
,
max_jobs
=
max_jobs
)
target
=
target
,
max_jobs
=
max_jobs
)
else
:
copy_tables
(
folder
,
new_folder
,
NAME_NUCLEI
)
# TODO
# copy tables associated with static segmentations
static_seg_names
=
(
'
sbem-6dpf-1-whole-segmented-tissue-labels
'
,)
for
seg_name
in
static_seg_names
:
...
...
@@ -114,7 +113,7 @@ def make_release(tag, folder, description=''):
call
([
'
git
'
,
'
tag
'
,
tag
])
else
:
call
([
'
git
'
,
'
-m
'
,
description
,
'
tag
'
,
tag
])
# TODO
autopush ???
# TODO
use the gitlab api instead
# call(['git', 'push', 'origin', 'master', '--tags'])
...
...
@@ -170,8 +169,10 @@ def update_platy_browser(update_cell_segmentation=False,
new_folder
=
os
.
path
.
join
(
'
data
'
,
new_tag
)
make_folder_structure
(
new_folder
)
target
=
'
slurm
'
max_jobs
=
250
# target = 'slurm'
# max_jobs = 250
target
=
'
local
'
max_jobs
=
48
# copy static image and misc data
copy_image_data
(
os
.
path
.
join
(
folder
,
'
images
'
),
...
...
@@ -191,15 +192,15 @@ def update_platy_browser(update_cell_segmentation=False,
update_nucleus_tables
,
target
=
target
,
max_jobs
=
max_jobs
)
# TODO implement make release properly
return
# make new release
make_release
(
new_tag
,
new_folder
,
description
)
print
(
"
Updated platybrowser to new release
"
,
new_tag
)
print
(
"
All changes were successfully made. Starting clean up now.
"
)
print
(
"
This can take a few hours, you can already use the new data; clean up will only remove temp files.
"
)
# TODO would be better to start this as a job on a different machine, not the login node!
# TODO clean up tmp folders
# clean_up()
print
(
"
This can take a few hours, you can already use the new data.
"
)
print
(
"
Clean-up will only remove temp files.
"
)
clean_up
()
def
str2bool
(
v
):
...
...
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