Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
mkexp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esmenv
mkexp
Commits
52da3610
Commit
52da3610
authored
4 years ago
by
Karl-Hermann Wieners
Browse files
Options
Downloads
Patches
Plain Diff
Global: changed directory creation to only create parts w/o native variables
parent
781b96f5
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CHANGES.txt
+8
-0
8 additions, 0 deletions
CHANGES.txt
mkexp
+17
-6
17 additions, 6 deletions
mkexp
with
25 additions
and
6 deletions
CHANGES.txt
+
8
−
0
View file @
52da3610
...
...
@@ -6,6 +6,14 @@ Make Experiments!
Release Changes
---------------
Release 1.0.10
==============
Global
------
* Changed directory creation to only create parts w/o native variables
Release 1.0.9
=============
...
...
This diff is collapsed.
Click to expand it.
mkexp
+
17
−
6
View file @
52da3610
...
...
@@ -378,6 +378,9 @@ except ExpConfigError as error:
# Create target directories
def
cut_dir_variable
(
directory
):
return
re
.
sub
(
os
.
sep
+
r
'
[^
'
+
os
.
sep
+
r
'
$]*\$\{\w+\}.*$
'
,
''
,
directory
)
# Create directory for scripts if it doesn't exist
script_dir
=
config
[
'
SCRIPT_DIR
'
]
print
"
Script directory:
'"
+
script_dir
+
"'"
...
...
@@ -392,20 +395,28 @@ else:
# Create directory for output data if it doesn't exist
data_dir
=
config
[
'
DATA_DIR
'
]
print
"
Data directory:
'"
+
data_dir
+
"'"
+
(
"
(not created)
"
if
not
args
.
make_dirs
else
""
)
data_cut
=
cut_dir_variable
(
data_dir
)
print
"
Data directory:
'"
+
data_dir
+
"'"
+
(
"
(not created)
"
if
not
args
.
make_dirs
else
""
)
if
args
.
make_dirs
:
if
not
os
.
path
.
isdir
(
data_dir
):
os
.
makedirs
(
data_dir
)
if
data_dir
!=
data_cut
:
feedback
.
warning
(
"
only considering non-variable part of directory
"
)
if
not
os
.
path
.
isdir
(
data_cut
):
os
.
makedirs
(
data_cut
)
elif
not
script_dir
.
startswith
(
data_dir
):
feedback
.
warning
(
"
data directory already exists
"
)
# Create directory for running the experiment if it doesn't exist
work_dir
=
config
[
'
WORK_DIR
'
]
work_cut
=
cut_dir_variable
(
work_dir
)
if
work_dir
!=
data_dir
:
print
"
Work directory:
'"
+
work_dir
+
"'"
+
(
"
(not created)
"
if
not
args
.
make_dirs
else
""
)
print
"
Work directory:
'"
+
work_dir
+
"'"
+
(
"
(not created)
"
if
not
args
.
make_dirs
else
""
)
if
args
.
make_dirs
:
if
not
os
.
path
.
isdir
(
work_dir
):
os
.
makedirs
(
work_dir
)
if
work_dir
!=
work_cut
:
feedback
.
warning
(
"
only considering non-variable part of directory
"
)
if
not
os
.
path
.
isdir
(
work_cut
):
os
.
makedirs
(
work_cut
)
else
:
feedback
.
warning
(
"
work directory already exists
"
)
...
...
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