Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Supress C++ stoplist extraction warnings if only called once or twice #194

Open
fxjung opened this issue Jan 28, 2022 · 0 comments
Open
Assignees

Comments

@fxjung
Copy link
Member

fxjung commented Jan 28, 2022

For a perfectly fine simulation, we always get a bunch of warnings:

/home/jung/Desktop/data/code/ridepy/ridepy/fleet_state.py:290: UserWarning: Extracting the C++ stoplist will impact performance
  "location": fleet_state.stoplist[0].location,
/home/jung/Desktop/data/code/ridepy/ridepy/extras/simulation_set.py:253: UserWarning: disregarding params['general']['n_vehicles']=10
  warnings.warn(f"disregarding {params['general']['n_vehicles']=}")
/home/jung/Desktop/data/code/ridepy/ridepy/fleet_state.py:290: UserWarning: Extracting the C++ stoplist will impact performance
  "location": fleet_state.stoplist[0].location,
/home/jung/Desktop/data/code/ridepy/ridepy/fleet_state.py:329: UserWarning: Extracting the C++ stoplist will impact performance
  vehicle.stoplist[-1].estimated_arrival_time
/home/jung/Desktop/data/code/ridepy/ridepy/fleet_state.py:342: UserWarning: Extracting the C++ stoplist will impact performance
  "location": fleet_state.stoplist[0].location,
/home/jung/Desktop/data/code/ridepy/ridepy/fleet_state.py:329: UserWarning: Extracting the C++ stoplist will impact performance
  vehicle.stoplist[-1].estimated_arrival_time
/home/jung/Desktop/data/code/ridepy/ridepy/fleet_state.py:342: UserWarning: Extracting the C++ stoplist will impact performance
  "location": fleet_state.stoplist[0].location,
/home/jung/Desktop/data/code/ridepy/ridepy/fleet_state.py:329: UserWarning: Extracting the C++ stoplist will impact performance
  vehicle.stoplist[-1].estimated_arrival_time
/home/jung/Desktop/data/code/ridepy/ridepy/fleet_state.py:342: UserWarning: Extracting the C++ stoplist will impact performance
  "location": fleet_state.stoplist[0].location,
/home/jung/Desktop/data/code/ridepy/ridepy/fleet_state.py:329: UserWarning: Extracting the C++ stoplist will impact performance

This should not be.
--> Either implement a counter in VehicleState.pyx to only warn after a certain number of calls, or suppress warnings temporarily in FleetState.py.

@fxjung fxjung self-assigned this Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant