Fixed circular import

This commit is contained in:
Sebastian Kloth 2023-12-28 14:40:11 +01:00
parent dffd06d3c0
commit 218574d50c
2 changed files with 6 additions and 4 deletions

View File

@ -120,7 +120,7 @@ def gr(
def distance_distribution(
atoms: CoordinateFrame, bins: Optional[int, ArrayLike]
atoms: CoordinateFrame, bins: Union[int, ArrayLike]
) -> NDArray:
connection_vectors = atoms[:-1, :] - atoms[1:, :]
connection_lengths = (connection_vectors**2).sum(axis=1) ** 0.5

View File

@ -1,5 +1,6 @@
from __future__ import annotations
from collections import OrderedDict
from typing import Optional, Union
from typing import Optional, Union, TYPE_CHECKING
import numpy as np
from numpy.typing import ArrayLike, NDArray
@ -7,7 +8,8 @@ from numpy.typing import ArrayLike, NDArray
from itertools import product
from .logging import logger
from .coordinates import CoordinateFrame
if TYPE_CHECKING:
from mdevaluate.coordinates import CoordinateFrame
def pbc_diff(
@ -70,7 +72,7 @@ def pbc_diff_tric(coords_a: NDArray, coords_b: NDArray, box: NDArray) -> NDArray
def pbc_dist(
atoms_a: CoordinateFrame, atoms_b: CoordinateFrame, box: Optional[NDArray] = None
atoms_a: NDArray, atoms_b: NDArray, box: Optional[NDArray] = None
) -> ArrayLike:
return ((pbc_diff(atoms_a, atoms_b, box) ** 2).sum(axis=1)) ** 0.5