Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
beat.web
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
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
beat
beat.web
Commits
94e56b5d
".gitlab/git@gitlab.idiap.ch:beat/beat.editor.git" did not exist on "1a8dbdeb503fc3d5dfbdcf6db1f9d20c862a03b5"
Commit
94e56b5d
authored
8 years ago
by
André Anjos
Browse files
Options
Downloads
Patches
Plain Diff
[experiments] Add function to return relative paths to caches
parent
f6bba0c8
No related branches found
No related tags found
1 merge request
!194
Scheduler
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
beat/web/experiments/models.py
+15
-3
15 additions, 3 deletions
beat/web/experiments/models.py
with
15 additions
and
3 deletions
beat/web/experiments/models.py
+
15
−
3
View file @
94e56b5d
...
@@ -599,6 +599,13 @@ class Experiment(Shareable):
...
@@ -599,6 +599,13 @@ class Experiment(Shareable):
def
core
(
self
):
def
core
(
self
):
return
validate_experiment
(
self
.
declaration
,
self
.
toolchain
.
declaration
)[
0
]
return
validate_experiment
(
self
.
declaration
,
self
.
toolchain
.
declaration
)[
0
]
def
job_splits
(
self
,
status
=
None
):
from
..backend.models
import
JobSplit
retval
=
JobSplit
.
objects
.
filter
(
job__block__in
=
self
.
blocks
)
if
state
is
not
None
:
retval
=
retval
.
filter
(
status
=
status
)
return
retval
def
get_absolute_url
(
self
):
def
get_absolute_url
(
self
):
return
reverse
(
return
reverse
(
'
experiments:view
'
,
'
experiments:view
'
,
...
@@ -1127,14 +1134,19 @@ class CachedFile(models.Model):
...
@@ -1127,14 +1134,19 @@ class CachedFile(models.Model):
def
path
(
self
):
def
path
(
self
):
'''
Returns the full path prefix to the cached file on disk
'''
'''
Returns the full path prefix to the cached file on disk
'''
return
os
.
path
.
join
(
settings
.
CACHE_ROOT
,
return
beat
.
core
.
hash
.
toPath
(
self
.
hash
,
suffix
=
''
)
beat
.
core
.
hash
.
toPath
(
self
.
hash
,
suffix
=
''
))
def
absolute_path
(
self
):
'''
Returns the full path prefix to the cached file on disk
'''
return
os
.
path
.
join
(
settings
.
CACHE_ROOT
,
self
.
relative_path
())
def
files
(
self
):
def
files
(
self
):
'''
Returns a list of files matching this cache prefix path
'''
'''
Returns a list of files matching this cache prefix path
'''
return
glob
.
glob
(
self
.
path
()
+
'
*
'
)
return
glob
.
glob
(
self
.
absolute_
path
()
+
'
*
'
)
def
exists
(
self
):
def
exists
(
self
):
...
...
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