diff --git a/glass/ext/__init__.py b/glass/ext/__init__.py index bb7a8501..dd44fdb9 100644 --- a/glass/ext/__init__.py +++ b/glass/ext/__init__.py @@ -6,6 +6,9 @@ """ +import os.path +from pkgutil import extend_path + def _extend_path(path: list[str], name: str) -> list[str]: """ @@ -23,9 +26,6 @@ def _extend_path(path: list[str], name: str) -> list[str]: The extended path. """ - import os.path - from pkgutil import extend_path - _pkg, _, _mod = name.partition(".") return list( diff --git a/glass/fields.py b/glass/fields.py index 0d02f4de..e433dc51 100644 --- a/glass/fields.py +++ b/glass/fields.py @@ -29,6 +29,7 @@ import collections.abc import typing import warnings +from itertools import combinations_with_replacement, product import healpy as hp import numpy as np @@ -553,8 +554,6 @@ def effective_cls( If the shapes of *weights1* and *weights2* are incompatible. """ - from itertools import combinations_with_replacement, product - # this is the number of fields n = int((2 * len(cls)) ** 0.5) if n * (n + 1) // 2 != len(cls): diff --git a/glass/shells.py b/glass/shells.py index 34f5a2ca..8fcde046 100644 --- a/glass/shells.py +++ b/glass/shells.py @@ -52,6 +52,7 @@ import numpy as np import numpy.typing as npt +from glass.core.algorithm import nnls from glass.core.array import ndinterp if typing.TYPE_CHECKING: @@ -644,8 +645,6 @@ def partition_nnls( The partition. """ - from glass.core.algorithm import nnls - # make sure nothing breaks sumtol = max(sumtol, 1e-4) diff --git a/tests/test_points.py b/tests/test_points.py index 0aede8a8..a4e545ab 100644 --- a/tests/test_points.py +++ b/tests/test_points.py @@ -20,9 +20,6 @@ import pytest_mock -if typing.TYPE_CHECKING: - import collections.abc - def catpos( pos: collections.abc.Generator[