From 97327475f807a6b92fe68842d4e04f2359e0dc0d Mon Sep 17 00:00:00 2001 From: Mohcine Chraibi Date: Sat, 2 Mar 2024 13:11:25 +0100 Subject: [PATCH] change type of some parameters for profiles --- calculate_profiles.py | 14 +++++--------- create_profile_data.py | 2 +- profile_config_data.py | 6 +++--- run_profile_calculations.py | 6 +++--- 4 files changed, 12 insertions(+), 16 deletions(-) diff --git a/calculate_profiles.py b/calculate_profiles.py index 281bbfd..db49856 100644 --- a/calculate_profiles.py +++ b/calculate_profiles.py @@ -10,15 +10,11 @@ import numpy.typing as npt import pandas as pd import pedpy as pp -from tqdm import tqdm from joblib import Parallel, delayed -from pedpy import ( - DensityMethod, - SpeedMethod, - compute_grid_cell_polygon_intersection_area, - compute_speed_profile, - get_grid_cells, -) +from pedpy import (DensityMethod, SpeedMethod, + compute_grid_cell_polygon_intersection_area, + compute_speed_profile, get_grid_cells) +from tqdm import tqdm from log_config import setup_logging from profile_config_data import Config @@ -90,7 +86,7 @@ def calculate( logging.info(f"Results in {result_file}") -def main(config: Config): +def main(config: Config) -> None: """Contains main logic for calculation of profiles.""" setup_logging() grid_size = config.grid_size diff --git a/create_profile_data.py b/create_profile_data.py index c8a7273..1946b79 100644 --- a/create_profile_data.py +++ b/create_profile_data.py @@ -7,9 +7,9 @@ import pandas as pd import pedpy as pp -from tqdm import tqdm from joblib import Parallel, delayed from pedpy.column_identifier import FRAME_COL, ID_COL +from tqdm import tqdm from log_config import setup_logging from profile_config_data import Config diff --git a/profile_config_data.py b/profile_config_data.py index 905bcf9..ce17444 100644 --- a/profile_config_data.py +++ b/profile_config_data.py @@ -15,6 +15,6 @@ class Config: fps: int walkable_area: pedpy.WalkableArea grid_size: float - rmax: int - vmax: int - jmax: int + rmax: float + vmax: float + jmax: float diff --git a/run_profile_calculations.py b/run_profile_calculations.py index 2582aa2..aa97f56 100644 --- a/run_profile_calculations.py +++ b/run_profile_calculations.py @@ -5,12 +5,12 @@ import glob -from profile_config_data import Config from pedpy import WalkableArea import calculate_profiles import create_profile_data import ploting_profiles +from profile_config_data import Config def run_all() -> None: @@ -24,9 +24,9 @@ def run_all() -> None: walkable_area=WalkableArea(area), profile_data_file="AppData/profile_data.pkl", result_file="AppData/density_speed_profiles.pkl", - rmax=3, + rmax=3.0, vmax=1.2, - jmax=2, + jmax=2.0, ) # Run the modules in sequence