Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
AMBS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository 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
esde
machine-learning
AMBS
Commits
7985a87f
Commit
7985a87f
authored
Jun 8, 2020
by
Michael Langguth
Browse files
Options
Downloads
Plain Diff
Manually solved merge conflict.
parents
d3fd2bf2
f674a466
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
metadata.py
+7
-4
7 additions, 4 deletions
metadata.py
with
7 additions
and
4 deletions
metadata.py
+
7
−
4
View file @
7985a87f
...
@@ -138,13 +138,15 @@ class MetaData:
...
@@ -138,13 +138,15 @@ class MetaData:
with
open
(
batch_script
,
'
r
'
)
as
file
:
with
open
(
batch_script
,
'
r
'
)
as
file
:
data
=
file
.
readlines
()
data
=
file
.
readlines
()
nlines
=
len
(
data
)
matched_lines
=
[
iline
for
iline
in
range
(
nlines
)
if
any
(
str_id
in
data
[
iline
]
for
str_id
in
paths_to_mod
)]
# list of line-number indices to be modified
matched_lines
=
[
iline
for
iline
in
range
(
nlines
)
if
any
(
str_id
in
data
[
iline
]
for
str_id
in
paths_to_mod
)]
# list of line-number indices to be modified
for
i
in
matched_lines
:
for
i
in
matched_lines
:
data
[
i
]
=
add_str_to_path
(
data
[
i
],
self
.
exp_dir
)
data
[
i
]
=
add_str_to_path
(
data
[
i
],
self
.
exp_dir
)
with
open
(
batch_script
,
'
w
'
)
as
file
:
with
open
(
batch_script
,
'
w
'
)
as
file
:
file
.
write
s
lines
(
data
)
file
.
writelines
(
data
)
def
write_metadata_to_file
(
self
,
dest_dir
=
None
):
def
write_metadata_to_file
(
self
,
dest_dir
=
None
):
...
@@ -243,6 +245,7 @@ class MetaData:
...
@@ -243,6 +245,7 @@ class MetaData:
pass
pass
# ----------------------------------- end of class MetaData -----------------------------------
# ----------------------------------- end of class MetaData -----------------------------------
# some auxilary functions which are not bound to MetaData-class
# some auxilary functions which are not bound to MetaData-class
...
@@ -254,8 +257,8 @@ def add_str_to_path(path_in,add_str):
...
@@ -254,8 +257,8 @@ def add_str_to_path(path_in,add_str):
Function is also capable to handle carriage returns for handling input-strings obtained by reading a file.
Function is also capable to handle carriage returns for handling input-strings obtained by reading a file.
"""
"""
l_linebreak
=
line_str
.
endswith
(
"
\n
"
)
# flag for carriage return at the end of input string
l_linebreak
=
path_in
.
endswith
(
"
\n
"
)
# flag for carriage return at the end of input string
line_str
=
line_str
.
rstrip
(
"
\n
"
)
line_str
=
path_in
.
rstrip
(
"
\n
"
)
if
(
not
line_str
.
endswith
(
add_str
))
or
\
if
(
not
line_str
.
endswith
(
add_str
))
or
\
(
not
line_str
.
endswith
(
add_str
.
rstrip
(
"
/
"
))):
(
not
line_str
.
endswith
(
add_str
.
rstrip
(
"
/
"
))):
...
...
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