Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
bilby
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
25
Issues
25
List
Boards
Labels
Service Desk
Milestones
Iterations
Merge Requests
12
Merge Requests
12
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Test Cases
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lscsoft
bilby
Commits
82db951c
Commit
82db951c
authored
May 17, 2018
by
plasky
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of git.ligo.org:Monash/tupak
parents
96129f0d
ac14b8db
Pipeline
#19446
passed with stages
in 5 minutes and 46 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
5 deletions
+23
-5
tupak/result.py
tupak/result.py
+17
-4
tupak/sampler.py
tupak/sampler.py
+6
-1
No files found.
tupak/result.py
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
):
...
...
tupak/sampler.py
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment