Skip to content

Prova#414

Open
Grufoony wants to merge 1 commit intomainfrom
newexample
Open

Prova#414
Grufoony wants to merge 1 commit intomainfrom
newexample

Conversation

@Grufoony
Copy link
Collaborator

@Grufoony Grufoony commented Mar 5, 2026

No description provided.

@Grufoony Grufoony closed this Mar 5, 2026
@Grufoony Grufoony reopened this Mar 5, 2026
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

Unable to import 'tqdm' (import-error)
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

Unable to import 'numpy' (import-error)
@@ -0,0 +1,75 @@
from datetime import datetime

Check warning

Code scanning / Pylintpython3 (reported by Codacy)

Missing module docstring Warning

Missing module docstring
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

third party import "from tqdm import trange" should be placed before "from dsf.cartography import get_cartography"
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

third party import "import numpy as np" should be placed before "from dsf.cartography import get_cartography"
@@ -0,0 +1,75 @@
from datetime import datetime

Check warning

Code scanning / Pylint (reported by Codacy)

Missing module docstring Warning

Missing module docstring
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

Constant name "df_nodes" doesn't conform to UPPER_CASE naming style
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

Constant name "df_edges" doesn't conform to UPPER_CASE naming style
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

Constant name "nodes" doesn't conform to UPPER_CASE naming style

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

Constant name "origin_ids" doesn't conform to UPPER_CASE naming style
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

Constant name "destination_ids" doesn't conform to UPPER_CASE naming style
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

Constant name "road_network" doesn't conform to UPPER_CASE naming style

# 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

Constant name "vehicle_input" doesn't conform to UPPER_CASE naming style
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

Constant name "dynamics" doesn't conform to UPPER_CASE naming style
# 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

Constant name "epoch_time" doesn't conform to UPPER_CASE naming style
@codecov
Copy link

codecov bot commented Mar 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.65%. Comparing base (86f152d) to head (88eb256).
⚠️ Report is 1 commits behind head on main.

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           
Flag Coverage Δ
unittests 87.65% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Successfully merging this pull request may close these issues.

1 participant