Conversation
| from dsf.cartography import get_cartography | ||
| from dsf.mobility import RoadNetwork, Dynamics | ||
|
|
||
| from tqdm import trange |
Check warning
Code scanning / Prospector (reported by Codacy)
Unable to import 'tqdm' (import-error) Warning
| from dsf.mobility import RoadNetwork, Dynamics | ||
|
|
||
| from tqdm import trange | ||
| import numpy as np |
Check warning
Code scanning / Prospector (reported by Codacy)
Unable to import 'numpy' (import-error) Warning
| @@ -0,0 +1,75 @@ | |||
| from datetime import datetime | |||
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
Missing module docstring Warning
| from dsf.cartography import get_cartography | ||
| from dsf.mobility import RoadNetwork, Dynamics | ||
|
|
||
| from tqdm import trange |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
third party import "from tqdm import trange" should be placed before "from dsf.cartography import get_cartography" Warning
| from dsf.mobility import RoadNetwork, Dynamics | ||
|
|
||
| from tqdm import trange | ||
| import numpy as np |
Check warning
Code scanning / Pylintpython3 (reported by Codacy)
third party import "import numpy as np" should be placed before "from dsf.cartography import get_cartography" Warning
| @@ -0,0 +1,75 @@ | |||
| from datetime import datetime | |||
Check warning
Code scanning / Pylint (reported by Codacy)
Missing module docstring Warning
| if __name__ == "__main__": | ||
| logging.info("Getting data from OpenStreetMap...") | ||
| # Get the cartography of Modena, Italy | ||
| G, df_edges, df_nodes = get_cartography("Parma, Emilia-Romagna, Italy") |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "df_nodes" doesn't conform to UPPER_CASE naming style Warning
| if __name__ == "__main__": | ||
| logging.info("Getting data from OpenStreetMap...") | ||
| # Get the cartography of Modena, Italy | ||
| G, df_edges, df_nodes = get_cartography("Parma, Emilia-Romagna, Italy") |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "df_edges" doesn't conform to UPPER_CASE naming style Warning
| df_edges.to_csv("modena_edges.csv", sep=";", index=False) | ||
| df_nodes.to_csv("modena_nodes.csv", sep=";", index=False) | ||
|
|
||
| nodes = G.nodes(data=False) |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "nodes" doesn't conform to UPPER_CASE naming style Warning
|
|
||
| nodes = G.nodes(data=False) | ||
| # Extract 10% random node ids as origins and destinations for the traffic simulation | ||
| origin_ids = np.random.choice( |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "origin_ids" doesn't conform to UPPER_CASE naming style Warning
| origin_ids = np.random.choice( | ||
| list(nodes), size=int(0.1 * len(nodes)), replace=False | ||
| ) | ||
| destination_ids = np.random.choice( |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "destination_ids" doesn't conform to UPPER_CASE naming style Warning
| logging.info("Creating road network and dynamics model...") | ||
|
|
||
| # Create a road network from the cartography | ||
| road_network = RoadNetwork() |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "road_network" doesn't conform to UPPER_CASE naming style Warning
|
|
||
| # Generaate a random vector of integer values for vehicle input | ||
| # We want values to have a 10s entry for a whole day | ||
| vehicle_input = np.random.randint(0, 10, size=8640) |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "vehicle_input" doesn't conform to UPPER_CASE naming style Warning
| vehicle_input = np.random.randint(0, 10, size=8640) | ||
|
|
||
| # Create a dynamics model for the road network | ||
| dynamics = Dynamics(road_network, seed=SEED, alpha=0.8) |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "dynamics" doesn't conform to UPPER_CASE naming style Warning
| # Create a dynamics model for the road network | ||
| dynamics = Dynamics(road_network, seed=SEED, alpha=0.8) | ||
| # Get epoch time of today at midnight | ||
| epoch_time = int( |
Check warning
Code scanning / Pylint (reported by Codacy)
Constant name "epoch_time" doesn't conform to UPPER_CASE naming style Warning
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #414 +/- ##
=======================================
Coverage 87.65% 87.65%
=======================================
Files 52 52
Lines 6164 6164
Branches 687 687
=======================================
Hits 5403 5403
Misses 742 742
Partials 19 19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
No description provided.