Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ exclude: '(^docs/conf.py|^user_data/External_tables/)'

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v6.0.0
hooks:
- id: trailing-whitespace
- id: check-added-large-files
Expand All @@ -17,7 +17,7 @@ repos:
- id: mixed-line-ending
args: ['--fix=no']
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0 # pick a git hash / tag to point to
rev: 7.3.0 # pick a git hash / tag to point to
hooks:
- id: flake8
additional_dependencies:
Expand All @@ -28,16 +28,16 @@ repos:
- flake8-rst-docstrings
- flake8-copyright
- flake8-docstrings
- repo: https://github.com/psf/black
rev: 23.9.1
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 25.12.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 7.0.0
hooks:
- id: isort
- repo: https://github.com/asottile/pyupgrade
rev: v3.11.1
rev: v3.21.2
hooks:
- id: pyupgrade
args: [--py38-plus]
1 change: 1 addition & 0 deletions devel/simple_memory_leak_test.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This is a script that runs a very basic mock Core/Likelihood
"""

import gc
import numpy as np
import tracemalloc
Expand Down
1 change: 1 addition & 0 deletions src/py21cmmc/analyse.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 9 additions & 6 deletions src/py21cmmc/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

TODO: Add description of the API of cores (and how to define new ones).
"""

import copy
import inspect
import logging
Expand Down Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/py21cmmc/cosmoHammer.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""A set of extensions to the basic ``CosmoHammer`` package."""

import emcee
import gc
import h5py
Expand Down
1 change: 1 addition & 0 deletions src/py21cmmc/ensemble.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
13 changes: 7 additions & 6 deletions src/py21cmmc/likelihood.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Module containing 21CMMC likelihoods."""

import logging
import numpy as np
from cached_property import cached_property
Expand Down Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/py21cmmc/mcmc.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""High-level functions for running MCMC chains."""

import logging
import numpy as np
import scipy.stats as stats
Expand Down
Loading