From 786a6c981b234a0b66f6b80f364e35b8e7b126c0 Mon Sep 17 00:00:00 2001
From: Matthew Pitkin <matthew.pitkin@ligo.org>
Date: Thu, 29 Feb 2024 07:32:54 -0800
Subject: [PATCH] Apply black

---
 bilby/bilby_mcmc/sampler.py   | 4 +++-
 bilby/core/sampler/emcee.py   | 6 +++---
 bilby/core/sampler/kombine.py | 6 +++---
 bilby/core/sampler/ptemcee.py | 8 ++++----
 4 files changed, 13 insertions(+), 11 deletions(-)

diff --git a/bilby/bilby_mcmc/sampler.py b/bilby/bilby_mcmc/sampler.py
index 9aeaa731d..c8ccf253f 100644
--- a/bilby/bilby_mcmc/sampler.py
+++ b/bilby/bilby_mcmc/sampler.py
@@ -388,7 +388,9 @@ class Bilby_MCMC(MCMCSampler):
             If true, resume file was successfully loaded, otherwise false
 
         """
-        if os.path.isfile(self.resume_file) is False or not os.path.getsize(self.resume_file):
+        if os.path.isfile(self.resume_file) is False or not os.path.getsize(
+            self.resume_file
+        ):
             return False
         import dill
 
diff --git a/bilby/core/sampler/emcee.py b/bilby/core/sampler/emcee.py
index a2fa4cfa9..76e4dd1eb 100644
--- a/bilby/core/sampler/emcee.py
+++ b/bilby/core/sampler/emcee.py
@@ -312,9 +312,9 @@ class Emcee(MCMCSampler):
         if hasattr(self, "_sampler"):
             pass
         elif (
-            self.resume and
-            os.path.isfile(self.checkpoint_info.sampler_file) and
-            os.path.getsize(self.checkpoint_info.sampler_file)
+            self.resume
+            and os.path.isfile(self.checkpoint_info.sampler_file)
+            and os.path.getsize(self.checkpoint_info.sampler_file)
         ):
             import dill
 
diff --git a/bilby/core/sampler/kombine.py b/bilby/core/sampler/kombine.py
index e3aef85ab..467751959 100644
--- a/bilby/core/sampler/kombine.py
+++ b/bilby/core/sampler/kombine.py
@@ -167,9 +167,9 @@ class Kombine(Emcee):
 
     def check_resume(self):
         return (
-            self.resume and
-            os.path.isfile(self.checkpoint_info.sampler_file) and
-            os.path.getsize(self.checkpoint_info.sampler_file) > 0
+            self.resume
+            and os.path.isfile(self.checkpoint_info.sampler_file)
+            and os.path.getsize(self.checkpoint_info.sampler_file) > 0
         )
 
     @signal_wrapper
diff --git a/bilby/core/sampler/ptemcee.py b/bilby/core/sampler/ptemcee.py
index 518473450..1d74a6f6a 100644
--- a/bilby/core/sampler/ptemcee.py
+++ b/bilby/core/sampler/ptemcee.py
@@ -416,9 +416,9 @@ class Ptemcee(MCMCSampler):
             ptemcee.sampler.np.float = float
 
         if (
-            os.path.isfile(self.resume_file) and
-            os.path.getsize(self.resume_file) and
-            self.resume is True
+            os.path.isfile(self.resume_file)
+            and os.path.getsize(self.resume_file)
+            and self.resume is True
         ):
             import dill
 
@@ -517,7 +517,7 @@ class Ptemcee(MCMCSampler):
         logger.info("Starting to sample")
 
         while True:
-            for (pos0, log_posterior, log_likelihood) in sampler.sample(
+            for pos0, log_posterior, log_likelihood in sampler.sample(
                 self.pos0,
                 storechain=False,
                 iterations=self.convergence_inputs.niterations_per_check,
-- 
GitLab