Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bilby
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
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
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
Matthew David Pitkin
bilby
Commits
20383996
Commit
20383996
authored
7 months ago
by
Matthew Pitkin
Browse files
Options
Downloads
Patches
Plain Diff
emcee.py: run black
parent
50a26043
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bilby/core/sampler/emcee.py
+6
-3
6 additions, 3 deletions
bilby/core/sampler/emcee.py
with
6 additions
and
3 deletions
bilby/core/sampler/emcee.py
+
6
−
3
View file @
20383996
...
...
@@ -332,15 +332,18 @@ class Emcee(MCMCSampler):
def
write_chains_to_file
(
self
,
sample
):
chain_file
=
self
.
checkpoint_info
.
chain_file
temp_chain_file
=
chain_file
+
'
.temp
'
temp_chain_file
=
chain_file
+
"
.temp
"
if
self
.
prerelease
:
points
=
np
.
hstack
([
sample
.
coords
,
sample
.
blobs
])
else
:
points
=
np
.
hstack
([
sample
[
0
],
np
.
array
(
sample
[
3
])])
data_to_write
=
"
\n
"
.
join
(
self
.
checkpoint_info
.
chain_template
.
format
(
ii
,
*
point
)
for
ii
,
point
in
enumerate
(
points
))
data_to_write
=
"
\n
"
.
join
(
self
.
checkpoint_info
.
chain_template
.
format
(
ii
,
*
point
)
for
ii
,
point
in
enumerate
(
points
)
)
with
open
(
temp_chain_file
,
"
w
"
)
as
ff
:
ff
.
write
(
data_to_write
)
with
open
(
temp_chain_file
,
'
rb
'
)
as
ftemp
,
open
(
chain_file
,
'
ab
'
)
as
fchain
:
with
open
(
temp_chain_file
,
"
rb
"
)
as
ftemp
,
open
(
chain_file
,
"
ab
"
)
as
fchain
:
shutil
.
copyfileobj
(
ftemp
,
fchain
)
os
.
remove
(
temp_chain_file
)
...
...
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