diff --git a/devel/simple_memory_leak_test.py b/devel/simple_memory_leak_test.py index 21bd50f8..4d00140e 100644 --- a/devel/simple_memory_leak_test.py +++ b/devel/simple_memory_leak_test.py @@ -1,6 +1,7 @@ """ This is a script that runs a very basic mock Core/Likelihood """ + import gc import numpy as np import tracemalloc diff --git a/src/py21cmmc/analyse.py b/src/py21cmmc/analyse.py index 2d7e28e3..4c8d100f 100644 --- a/src/py21cmmc/analyse.py +++ b/src/py21cmmc/analyse.py @@ -2,6 +2,7 @@ Also enables more transparent input/output of chains. """ + import numpy as np from matplotlib import pyplot as plt from os.path import join diff --git a/src/py21cmmc/core.py b/src/py21cmmc/core.py index 3a7c7934..e2fb15b2 100644 --- a/src/py21cmmc/core.py +++ b/src/py21cmmc/core.py @@ -4,6 +4,7 @@ TODO: Add description of the API of cores (and how to define new ones). """ + import copy import inspect import logging @@ -627,13 +628,15 @@ def run(self, astro_params, cosmo_params, ctx): for i in range(N): muv, mhalo, lf = p21.compute_luminosity_function( mturnovers=mturnovers if self.flag_options.USE_MINI_HALOS else None, - mturnovers_mini=mturnovers_mini - if self.flag_options.USE_MINI_HALOS - else None, + mturnovers_mini=( + mturnovers_mini if self.flag_options.USE_MINI_HALOS else None + ), redshifts=self.redshift, - astro_params=astro_params[i] - if not isinstance(astro_params, p21.AstroParams) - else astro_params, + astro_params=( + astro_params[i] + if not isinstance(astro_params, p21.AstroParams) + else astro_params + ), flag_options=self.flag_options, cosmo_params=cosmo_params, user_params=self.user_params, diff --git a/src/py21cmmc/cosmoHammer.py b/src/py21cmmc/cosmoHammer.py index c61b5fe9..4f24b516 100644 --- a/src/py21cmmc/cosmoHammer.py +++ b/src/py21cmmc/cosmoHammer.py @@ -1,4 +1,5 @@ """A set of extensions to the basic ``CosmoHammer`` package.""" + import emcee import gc import h5py diff --git a/src/py21cmmc/ensemble.py b/src/py21cmmc/ensemble.py index 64f2f212..5ed03b01 100644 --- a/src/py21cmmc/ensemble.py +++ b/src/py21cmmc/ensemble.py @@ -1,4 +1,5 @@ """Patch of `emcee.Ensemble` to allow for some new features required for 21CMMC.""" + import emcee import logging import numpy as np diff --git a/src/py21cmmc/likelihood.py b/src/py21cmmc/likelihood.py index fc1603d2..eb59b28a 100644 --- a/src/py21cmmc/likelihood.py +++ b/src/py21cmmc/likelihood.py @@ -1,4 +1,5 @@ """Module containing 21CMMC likelihoods.""" + import logging import numpy as np from cached_property import cached_property @@ -1041,13 +1042,13 @@ def computeLikelihood(self, model): elif i == 4: tot[index + j] = cl["te"][j] elif i == 5: - tot[ - index + j - ] = 0 # cl['tb'][j] class does not compute tb + tot[index + j] = ( + 0 # cl['tb'][j] class does not compute tb + ) elif i == 6: - tot[ - index + j - ] = 0 # cl['eb'][j] class does not compute eb + tot[index + j] = ( + 0 # cl['eb'][j] class does not compute eb + ) index += my_clik.get_lmax()[i] + 1 diff --git a/src/py21cmmc/mcmc.py b/src/py21cmmc/mcmc.py index f6c43a0f..67bb225e 100644 --- a/src/py21cmmc/mcmc.py +++ b/src/py21cmmc/mcmc.py @@ -1,4 +1,5 @@ """High-level functions for running MCMC chains.""" + import logging import numpy as np import scipy.stats as stats