Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bilby
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
lscsoft
bilby
Commits
82db951c
There was a problem fetching the pipeline summary.
Commit
82db951c
authored
6 years ago
by
plasky
Browse files
Options
Downloads
Plain Diff
Merge branch 'master' of git.ligo.org:Monash/tupak
parents
96129f0d
ac14b8db
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
tupak/result.py
+17
-4
17 additions, 4 deletions
tupak/result.py
tupak/sampler.py
+6
-1
6 additions, 1 deletion
tupak/sampler.py
with
23 additions
and
5 deletions
tupak/result.py
+
17
−
4
View file @
82db951c
...
...
@@ -17,13 +17,26 @@ def result_file_name(outdir, label):
return
'
{}/{}_result.h5
'
.
format
(
outdir
,
label
)
def
read_in_result
(
outdir
,
label
):
"""
Read in a saved .h5 data file
"""
filename
=
result_file_name
(
outdir
,
label
)
def
read_in_result
(
outdir
=
None
,
label
=
None
,
filename
=
None
):
"""
Read in a saved .h5 data file
Parameters
----------
outdir, label: str
If given, use the default naming convention for saved results file
filename: str
If given, try to load from this filename
Returns:
result: tupak.result.Result instance
"""
if
filename
is
None
:
filename
=
result_file_name
(
outdir
,
label
)
if
os
.
path
.
isfile
(
filename
):
return
Result
(
deepdish
.
io
.
load
(
filename
))
else
:
r
eturn
None
r
aise
ValueError
(
"
No information given to load file
"
)
class
Result
(
dict
):
...
...
This diff is collapsed.
Click to expand it.
tupak/sampler.py
+
6
−
1
View file @
82db951c
...
...
@@ -200,7 +200,12 @@ class Sampler(object):
logging
.
debug
(
"
Command line argument clean given, forcing rerun
"
)
self
.
cached_result
=
None
return
self
.
cached_result
=
read_in_result
(
self
.
outdir
,
self
.
label
)
try
:
self
.
cached_result
=
read_in_result
(
self
.
outdir
,
self
.
label
)
except
ValueError
:
self
.
cached_result
=
None
if
utils
.
command_line_args
.
use_cached
:
logging
.
debug
(
"
Command line argument cached given, no cache check performed
"
)
return
...
...
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