Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CADET-RDM
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IBG-1
ModSim
CADET
CADET-RDM
Commits
b9fda30a
Commit
b9fda30a
authored
1 year ago
by
r.jaepel
Browse files
Options
Downloads
Patches
Plain Diff
Add .results_path to Case()
parent
63c88e7f
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
cadetrdm/batch_runner.py
+36
-2
36 additions, 2 deletions
cadetrdm/batch_runner.py
with
36 additions
and
2 deletions
cadetrdm/batch_runner.py
+
36
−
2
View file @
b9fda30a
...
...
@@ -30,6 +30,7 @@ class Case:
self
.
name
=
name
self
.
study
=
study
self
.
options
=
options
self
.
_results_branch
=
None
@property
def
status_file
(
self
):
...
...
@@ -87,13 +88,26 @@ class Case:
@property
def
has_results_for_this_run
(
self
):
if
self
.
results_branch
==
"
not found
"
:
return
False
else
:
return
True
@property
def
results_branch
(
self
):
if
self
.
_results_branch
is
None
:
self
.
_results_branch
=
self
.
_get_results_branch
()
return
self
.
_results_branch
def
_get_results_branch
(
self
):
output_log
=
self
.
study
.
output_log
for
log_entry
in
output_log
:
if
(
self
.
study
.
current_commit_hash
==
log_entry
.
project_repo_commit_hash
and
self
.
options
.
hash
==
log_entry
.
options_hash
):
return
True
return
log_entry
.
output_repo_branch
return
False
return
"
not found
"
def
run_study
(
self
,
force
=
False
):
"""
Run specified study commands in the given repository.
"""
...
...
@@ -128,3 +142,23 @@ class Case:
print
(
f
"
Command execution failed:
{
e
}
"
)
self
.
status
=
'
failed
'
return
@property
def
_results_path
(
self
):
return
self
.
study
.
path
/
(
self
.
study
.
_output_folder
+
"
_cached
"
)
/
self
.
results_branch
def
load
(
self
,
):
if
self
.
results_branch
is
None
:
print
(
f
"
No results available for Case(
{
self
.
study
.
path
,
self
.
options
.
hash
[
:
7
]
}
)
"
)
return
None
if
self
.
_results_path
.
exists
():
return
self
.
study
.
copy_data_to_cache
(
self
.
results_branch
)
@property
def
results_path
(
self
):
self
.
load
()
return
self
.
_results_branch
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