Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
lasso
containers
run-lasso-o_shcu
Commits
4a1a7870
Commit
4a1a7870
authored
May 18, 2021
by
Carina Lansing
Browse files
Fixing the link script.
parent
3b11675b
Changes
1
Show whitespace changes
Inline
Side-by-side
notebooks/link_output_data.
py
→
notebooks/link_output_data.
sh
100644 → 100755
View file @
4a1a7870
...
...
@@ -15,7 +15,6 @@ def create_sym_link(source_file, linked_file):
os.remove
(
linked_file
)
# Make a symbolic link
print
(
"Creating symbolic link: "
+
linked_file
)
os.symlink
(
source_file, linked_file
)
...
...
@@ -28,11 +27,20 @@ def main():
outputs_dir
=
os.path.join
(
run_dir,
"data/outputs"
)
data_dir
=
os.path.join
(
run_dir,
"notebooks/DATA"
)
for
root
,
dirs
,
files
in
os
.
walk
(
outputs_dir
):
for
parent_folder
,
dirs
, files
in
os.walk
(
outputs_dir
)
:
for
name
in
files:
print
(
os
.
path
.
join
(
root
,
name
))
for
name
in
dirs
:
print
(
os
.
path
.
join
(
root
,
name
))
# Ignore the model raw files and log files
if
'sgpwrf'
not
in
parent_folder and name.endswith
(
'.nc'
)
:
folder_name
=
os.path.dirname
(
parent_folder
)
dest_folder
=
os.path.join
(
data_dir, folder_name
)
linked_file
=
os.path.join
(
dest_folder, name
)
source_file
=
os.path.join
(
parent_folder, name
)
# Make sure the destination folder exists
if
not os.path.isdir
(
dest_folder
)
:
os.mkdir
(
dest_folder
)
create_sym_link
(
source_file, linked_file
)
if
__name__
==
"__main__"
:
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment