Skip to content
Draft
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.15.10
rev: v0.15.20
hooks:
- id: ruff
alias: ruff-include-sorting
Expand All @@ -15,7 +15,7 @@ repos:
files: ^pedpy/

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.20.0
rev: v2.1.0
hooks:
- id: mypy
name: Check type hints (mypy)
Expand Down
6 changes: 3 additions & 3 deletions pedpy/methods/spatial_analysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def compute_pair_distribution_function(
traj_data: TrajectoryData,
radius_bin_size: float,
randomisation_stacking: int = 1,
) -> Tuple[npt.NDArray[np.float16], npt.NDArray[np.float16]]:
) -> Tuple[npt.NDArray[np.float64], npt.NDArray[np.float64]]:
"""Computes the pair distribution function g(r).

This function calculates the spatial distribution of positions :math:`g(r)`
Expand Down Expand Up @@ -101,7 +101,7 @@ def compute_pair_distribution_function(

def _calculate_pair_distances(
data_df: pd.DataFrame,
) -> npt.NDArray[np.float16]:
) -> npt.NDArray[np.float64]:
"""Calculates the pairwise distances of pedestrians.

This function calculates the pairwise Euclidean distances between all
Expand All @@ -114,7 +114,7 @@ def _calculate_pair_distances(
identified by FRAME_COL, ID_COL, X_COL, and Y_COL constants.

Returns:
npt.NDArray[np.float16]: A 1D numpy array of pairwise distances.
npt.NDArray[np.float64]: A 1D numpy array of pairwise distances.
"""
distances_list = []

Expand Down
2 changes: 1 addition & 1 deletion pedpy/preprocessing/trajectory_projector.py
Original file line number Diff line number Diff line change
Expand Up @@ -790,4 +790,4 @@ def _zero_point_alignment(p1x: float, p1y: float, p2x: float, p2y: float, direct
if a == 0:
return math.sqrt(math.sqrt(c))
x_sq = ((a + b - c) ** 2) / (4 * a)
return np.sign(sin_p) * math.sqrt(math.fabs(b - x_sq))
return float(np.sign(sin_p) * math.sqrt(math.fabs(b - x_sq)))
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ max-statements = 50
allow-magic-value-types = ["int", "str"]

[tool.mypy]
python_version = "3.11"
python_version = "3.12"
namespace_packages = true
ignore_missing_imports = false
check_untyped_defs = true
Expand Down