diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 2202349..09da589 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -36,7 +36,7 @@ repos: - repo: https://github.com/psf/black-pre-commit-mirror - rev: 23.12.1 + rev: 24.1.1 hooks: - id: black diff --git a/src/powerbox/__init__.py b/src/powerbox/__init__.py index b977060..702bb6e 100644 --- a/src/powerbox/__init__.py +++ b/src/powerbox/__init__.py @@ -1,4 +1,5 @@ """A package for creating mocks from input isotropic power spectra.""" + try: from importlib.metadata import PackageNotFoundError, version except ImportError: diff --git a/src/powerbox/dft.py b/src/powerbox/dft.py index 06b6bb9..8773347 100644 --- a/src/powerbox/dft.py +++ b/src/powerbox/dft.py @@ -24,6 +24,7 @@ We note that currently, only positive values for b are implemented (in fact, using negative b is consistent, but one must be careful that the frequencies returned are descending, rather than ascending). """ + import warnings __all__ = ["fft", "ifft", "fftfreq", "fftshift", "ifftshift"] diff --git a/src/powerbox/tools.py b/src/powerbox/tools.py index bd3403e..68ecdb7 100644 --- a/src/powerbox/tools.py +++ b/src/powerbox/tools.py @@ -3,6 +3,7 @@ Tools include those for averaging a field angularly, and generating the isotropic power spectrum. """ + import numpy as np import warnings diff --git a/tests/test_power.py b/tests/test_power.py index 5228e33..755c86f 100644 --- a/tests/test_power.py +++ b/tests/test_power.py @@ -6,9 +6,7 @@ def test_power1d(): p = [0] * 40 for i in range(40): - pb = PowerBox( - 8001, dim=1, pk=lambda k: 1.0 * k**-2.0, boxlength=1.0, a=0, b=1 - ) + pb = PowerBox(8001, dim=1, pk=lambda k: 1.0 * k**-2.0, boxlength=1.0, a=0, b=1) p[i], k = get_power(pb.delta_x(), pb.boxlength, a=0, b=1)