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
Commits
3eb210c2
Commit
3eb210c2
authored
5 years ago
by
lukas leufen
Browse files
Options
Downloads
Patches
Plain Diff
another fix
parent
be63ba2c
Branches
Branches containing commit
Tags
Tags containing commit
3 merge requests
!17
update to v0.4.0
,
!15
new feat split subsets
,
!13
fix bug make tests running
Pipeline
#26132
passed
5 years ago
Stage: test
Stage: pages
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/helpers.py
+11
-5
11 additions, 5 deletions
src/helpers.py
test/test_helpers.py
+1
-1
1 addition, 1 deletion
test/test_helpers.py
with
12 additions
and
6 deletions
src/helpers.py
+
11
−
5
View file @
3eb210c2
...
...
@@ -135,7 +135,10 @@ class TimeTracking(object):
def
prepare_host
(
create_new
=
True
):
hostname
=
socket
.
gethostname
()
user
=
os
.
getlogin
()
try
:
user
=
os
.
getlogin
()
except
OSError
:
user
=
"
default
"
if
hostname
==
'
ZAM144
'
:
path
=
f
'
/home/
{
user
}
/Data/toar_daily/
'
elif
hostname
==
'
zam347
'
:
...
...
@@ -150,10 +153,13 @@ def prepare_host(create_new=True):
logging
.
error
(
f
"
unknown host
'
{
hostname
}
'"
)
raise
OSError
(
f
"
unknown host
'
{
hostname
}
'"
)
if
not
os
.
path
.
exists
(
path
):
if
create_new
:
check_path_and_create
(
path
)
return
path
else
:
try
:
if
create_new
:
check_path_and_create
(
path
)
return
path
else
:
raise
PermissionError
except
PermissionError
:
logging
.
error
(
f
"
path
'
{
path
}
'
does not exist for host
'
{
hostname
}
'
.
"
)
raise
NotADirectoryError
(
f
"
path
'
{
path
}
'
does not exist for host
'
{
hostname
}
'
.
"
)
else
:
...
...
This diff is collapsed.
Click to expand it.
test/test_helpers.py
+
1
−
1
View file @
3eb210c2
...
...
@@ -171,7 +171,7 @@ class TestPrepareHost:
mock_host
.
return_value
=
"
linux-gzsx
"
with
pytest
.
raises
(
NotADirectoryError
)
as
e
:
prepare_host
()
assert
"
path
'
/home/zombie21/machinelearningtools
'
does not exist for host
'
linux-gzsx
'"
in
e
.
value
.
args
[
0
]
assert
"
does not exist for host
'
linux-gzsx
'"
in
e
.
value
.
args
[
0
]
class
TestSetExperimentName
:
...
...
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