Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MLAir
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esde
machine-learning
MLAir
Merge requests
!12
Experiment Setup finished
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Experiment Setup finished
develop
into
master
Overview
0
Commits
10
Pipelines
1
Changes
4
Merged
Ghost User
requested to merge
develop
into
master
5 years ago
Overview
0
Commits
10
Pipelines
1
Changes
4
Expand
0
0
Merge request reports
Viewing commit
1d45bfff
Prev
Next
Show latest version
4 files
+
96
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
4
Search (e.g. *.vue) (Ctrl+P)
1d45bfff
new: prepare host, set experiment name, argparser for exp date
· 1d45bfff
lukas leufen
authored
5 years ago
src/helpers.py
+
39
−
0
Options
@@ -10,6 +10,8 @@ from typing import Union
import
numpy
as
np
import
os
import
time
import
socket
import
sys
def
to_list
(
arg
):
@@ -123,3 +125,40 @@ class TimeTracking(object):
def
duration
(
self
):
return
self
.
_duration
()
def
prepare_host
():
hostname
=
socket
.
gethostname
()
user
=
os
.
getlogin
()
if
hostname
==
'
ZAM144
'
:
# pragma: no branch
path
=
f
'
/home/
{
user
}
/Data/toar_daily/
'
elif
hostname
==
'
zam347
'
:
path
=
f
'
/home/
{
user
}
/Data/toar_daily/
'
elif
hostname
==
'
linux-gzsx
'
:
path
=
f
'
/home/
{
user
}
/machinelearningtools
'
elif
(
len
(
hostname
)
>
2
)
and
(
hostname
[:
2
]
==
'
jr
'
):
path
=
f
'
/p/project/cjjsc42/
{
user
}
/DATA/toar_daily/
'
elif
(
len
(
hostname
)
>
2
)
and
(
hostname
[:
2
]
==
'
jw
'
):
path
=
f
'
/p/home/jusers/
{
user
}
/juwels/intelliaq/DATA/toar_daily/
'
else
:
logging
.
error
(
f
"
unknown host
'
{
hostname
}
'"
)
raise
OSError
(
f
"
unknown host
'
{
hostname
}
'"
)
if
not
os
.
path
.
exists
(
path
):
logging
.
error
(
f
"
path
'
{
path
}
'
does not exist for host
'
{
hostname
}
'
.
"
)
raise
NotADirectoryError
(
f
"
path
'
{
path
}
'
does not exist for host
'
{
hostname
}
'
.
"
)
else
:
logging
.
info
(
f
"
set path to:
{
path
}
"
)
return
path
def
set_experiment_name
(
experiment_date
=
None
,
experiment_path
=
None
):
if
experiment_date
is
None
:
experiment_name
=
""
else
:
experiment_name
=
f
"
{
experiment_date
}
_network/
"
if
experiment_path
is
None
:
experiment_path
=
os
.
path
.
abspath
(
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"
..
"
,
experiment_name
))
else
:
experiment_path
=
os
.
path
.
abspath
(
experiment_path
)
return
experiment_name
,
experiment_path
Loading