Skip to content

Commit 25994eb

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 0838529 commit 25994eb

File tree

7 files changed

+21
-12
lines changed

7 files changed

+21
-12
lines changed

devel/simple_memory_leak_test.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""
22
This is a script that runs a very basic mock Core/Likelihood
33
"""
4+
45
import gc
56
import numpy as np
67
import tracemalloc

src/py21cmmc/analyse.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
33
Also enables more transparent input/output of chains.
44
"""
5+
56
import numpy as np
67
from matplotlib import pyplot as plt
78
from os.path import join

src/py21cmmc/core.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
55
TODO: Add description of the API of cores (and how to define new ones).
66
"""
7+
78
import copy
89
import inspect
910
import logging
@@ -627,13 +628,15 @@ def run(self, astro_params, cosmo_params, ctx):
627628
for i in range(N):
628629
muv, mhalo, lf = p21.compute_luminosity_function(
629630
mturnovers=mturnovers if self.flag_options.USE_MINI_HALOS else None,
630-
mturnovers_mini=mturnovers_mini
631-
if self.flag_options.USE_MINI_HALOS
632-
else None,
631+
mturnovers_mini=(
632+
mturnovers_mini if self.flag_options.USE_MINI_HALOS else None
633+
),
633634
redshifts=self.redshift,
634-
astro_params=astro_params[i]
635-
if not isinstance(astro_params, p21.AstroParams)
636-
else astro_params,
635+
astro_params=(
636+
astro_params[i]
637+
if not isinstance(astro_params, p21.AstroParams)
638+
else astro_params
639+
),
637640
flag_options=self.flag_options,
638641
cosmo_params=cosmo_params,
639642
user_params=self.user_params,

src/py21cmmc/cosmoHammer.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""A set of extensions to the basic ``CosmoHammer`` package."""
2+
23
import emcee
34
import gc
45
import h5py

src/py21cmmc/ensemble.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Patch of `emcee.Ensemble` to allow for some new features required for 21CMMC."""
2+
23
import emcee
34
import logging
45
import numpy as np

src/py21cmmc/likelihood.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Module containing 21CMMC likelihoods."""
2+
23
import logging
34
import numpy as np
45
from cached_property import cached_property
@@ -1041,13 +1042,13 @@ def computeLikelihood(self, model):
10411042
elif i == 4:
10421043
tot[index + j] = cl["te"][j]
10431044
elif i == 5:
1044-
tot[
1045-
index + j
1046-
] = 0 # cl['tb'][j] class does not compute tb
1045+
tot[index + j] = (
1046+
0 # cl['tb'][j] class does not compute tb
1047+
)
10471048
elif i == 6:
1048-
tot[
1049-
index + j
1050-
] = 0 # cl['eb'][j] class does not compute eb
1049+
tot[index + j] = (
1050+
0 # cl['eb'][j] class does not compute eb
1051+
)
10511052

10521053
index += my_clik.get_lmax()[i] + 1
10531054

src/py21cmmc/mcmc.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""High-level functions for running MCMC chains."""
2+
23
import logging
34
import numpy as np
45
import scipy.stats as stats

0 commit comments

Comments
 (0)