{"cells": [{"cell_type": "markdown", "id": "c00", "metadata": {}, "source": "*openmobisim tutorials* \u00b7 [00 \u00b7 overview](00_getting_started.ipynb) \u00b7 \u2190 [07 \u00b7 Validation](07_validation.ipynb) \u00b7 [09 \u00b7 Five minimal studies](09_applications.ipynb) \u2192 \u00b7 [documentation](https://openmobisim.github.io)\n\n# 08 \u00b7 Performance\n\nHow long the starter cases take, where the time goes, and how a sample of the demand trades accuracy for speed.\nEvery run says its time in one line and records its **wall-clock** time by stage (`Run.timings()`, `timings.csv`),\nmeasured on this machine's clock; times differ from run to run and from machine to machine, so they are in no result\nand not in the run's fingerprint. The times shown here were measured on a MacBook Pro with an Apple M2 Pro (8 performance and 4 efficiency cores), 32 GB of memory, macOS 26, with nothing else running.\n\nThe cities' mornings are congested and large. Amsterdam, Paris and Lyon run **fast** by default: each simulated\ntraveller stands for five people (ten in Paris); Delft, the smallest, simulates every traveller. Every case shares its\nroute searches by origin and half hour, so a run takes from ten seconds (Delft) to a minute (Paris) on a\nlaptop; `case.demand(weight=1)` gives a city's **complete** run, one traveller per person, a few times slower (Delft's\nbase is one)."}, {"cell_type": "markdown", "id": "download", "metadata": {}, "source": "**Download** {download}`this notebook <../_static/notebooks/08_performance.ipynb>` or {download}`all ten <../_static/notebooks/openmobisim_notebooks.zip>` (a zip), without their outputs. The Installation section below installs openmobisim; its last command, `openmobisim notebooks`, copies the same ten into a folder and opens the first in JupyterLab."}, {"cell_type": "markdown", "id": "c01", "metadata": {}, "source": "---\n\n## Installation\n\n> Skip this if `import openmobisim` already works in this notebook. **One install is all there is:**\n> `pip install \"openmobisim[all]\"` brings the simulator and everything the ten tutorials use (JupyterLab,\n> matplotlib for the figures, pandas, polars and pyarrow for the tables); nothing is installed later. Find the case\n> that matches yours and copy its commands, in order. Each needs Python 3.11 or newer.\n>\n> **A new conda environment** (any system; openmobisim is on PyPI, so pip installs it into the environment):\n>\n> ```bash\n> conda create -y -n openmobisim python=3.12\n> conda activate openmobisim\n> pip install \"openmobisim[all]\"\n> openmobisim notebooks\n> ```\n>\n> **A new venv on macOS or Linux** (in a terminal):\n>\n> ```bash\n> python3 -m venv openmobisim\n> source openmobisim/bin/activate\n> pip install \"openmobisim[all]\"\n> openmobisim notebooks\n> ```\n>\n> **A new venv on Windows** (in the Command Prompt):\n>\n> ```bat\n> py -m venv openmobisim\n> openmobisim\\Scripts\\activate\n> pip install \"openmobisim[all]\"\n> openmobisim notebooks\n> ```\n>\n> The last line copies these ten notebooks into `./openmobisim-notebooks` and opens them in JupyterLab. In VS Code or\n> PyCharm, open a notebook and choose the `openmobisim` environment's Python as its kernel instead.\n>\n> **Into the environment this notebook already runs in**: paste this into a new code cell, run it, then restart the\n> kernel.\n>\n> ```python\n> %pip install \"openmobisim[all]\"\n> ```\n\n---"}, {"cell_type": "code", "execution_count": 1, "id": "c03", "metadata": {"execution": {"iopub.execute_input": "2026-10-19T19:39:18.278792Z", "iopub.status.busy": "2026-10-19T19:39:18.278373Z", "iopub.status.idle": "2026-10-19T19:39:18.597818Z", "shell.execute_reply": "2026-10-19T19:39:18.597380Z"}}, "outputs": [{"name": "stdout", "output_type": "stream", "text": ["macOS-26.6.2-arm64-arm-64bit-Mach-O \u00b7 arm \u00b7 12 logical cores\n", "{'version': '0.1.0', 'git_sha': 'f036acd815fa', 'code_version': 1, 'rng_scheme_version': 1, 'parallel': True, 'target': 'aarch64-apple-darwin', 'profile': 'release'}\n"]}], "source": ["import os\n", "import platform\n", "import time\n", "\n", "import numpy as np\n", "import openmobisim as ms\n", "import pandas as pd\n", "\n", "print(platform.platform(), \"\u00b7\", platform.processor() or platform.machine(), \"\u00b7\", os.cpu_count(), \"logical cores\")\n", "print(ms.build_info())"]}, {"cell_type": "markdown", "id": "c04", "metadata": {}, "source": "## 1 \u00b7 The starter cases\n\nEach case's default scenario with the package's defaults (a logit model over route sets, the method of successive\naverages until converged, the point-queue loading; with modes, every trip choosing among those its class may use).\n\"read\" is reading the network, the timetable and the parkings; \"run\" is the simulation itself, from the demand to the\nwritten results."}, {"cell_type": "code", "execution_count": 2, "id": "c05", "metadata": {"execution": {"iopub.execute_input": "2026-10-19T19:39:18.599225Z", "iopub.status.busy": "2026-10-19T19:39:18.599118Z", "iopub.status.idle": "2026-10-19T19:42:48.968851Z", "shell.execute_reply": "2026-10-19T19:42:48.968389Z"}}, "outputs": [{"name": "stderr", "output_type": "stream", "text": ["/var/folders/q0/vjghqqvj4dvcq_z2rjmvd0jmw3f5y2/T/ipykernel_98515/3079632518.py:19: NoAlternativeWarning: 288 trips (1,440 people, 0.5% of run 'perf-amsterdam-base-1') had no alternative \u2014 no mode they may use reached their destination within the limits \u2014 and were not simulated. By class (stated mode): 254 'no_vehicle' (choosing), 33 'from_outside_transit' (transit), 1 'car_and_bike' (choosing). Why, by mode offered (trips): car: no_road_route 1; bike: ride_too_long 1; walk: walk_too_long 255; transit: no_stop_in_reach 206, no_transit_journey 82; car_transit: too_short 1; bike_transit: too_short 1. Most between (latitude, longitude, about 1 km): 25 people from (52.39, 4.84) to (52.41, 4.85); 15 people from (52.38, 4.90) to (52.40, 4.87); 15 people from (52.40, 4.91) to (52.41, 4.85); 10 people from (52.35, 4.81) to (52.40, 4.87); 10 people from (52.35, 4.85) to (52.41, 4.82). To change: walk_too_long: mode_options['walk_max_s'] or the class's walk_max_s; ride_too_long: mode_options['bike_max_s'] or the class's bike_max_s; no_road_route: the road network between the two (network_check); no_stop_in_reach: transit_options['access_walk_max_s'] or the class's access_walk_max_s; no_transit_journey: transit_options['journey_max_s'], the window, or the timetable; too_short: parking_options['pr_min_km']. Run.report_no_alternative() lists every trip with its reasons.\n", " run = sc.run(f\"perf-{name}-{scenario}-{sample}\", quiet=True)\n"]}, {"data": {"text/html": ["
\n", "\n", "
\n", " \n", " \n", " | \n", " travellers simulated | \n", " people | \n", " links | \n", " iterations | \n", " read (s) | \n", " run (s) | \n", " mean trip (min) | \n", "
\n", " \n", " \n", " \n", " | delft / base | \n", " 65956.0 | \n", " 65956.0 | \n", " 42699.0 | \n", " 9.0 | \n", " 3.20 | \n", " 10.36 | \n", " 22.94 | \n", "
\n", " \n", " | nguyendupuis / base | \n", " 2000.0 | \n", " 2000.0 | \n", " 19.0 | \n", " 6.0 | \n", " 0.01 | \n", " 0.04 | \n", " 54.52 | \n", "
\n", " \n", " | siouxfalls / base | \n", " 180300.0 | \n", " 180300.0 | \n", " 76.0 | \n", " 5.0 | \n", " 1.00 | \n", " 2.46 | \n", " 11.79 | \n", "
\n", " \n", " | siouxfalls / congested | \n", " 270450.0 | \n", " 270450.0 | \n", " 76.0 | \n", " 6.0 | \n", " 1.49 | \n", " 4.95 | \n", " 21.48 | \n", "
\n", " \n", " | amsterdam / base | \n", " 57381.0 | \n", " 286905.0 | \n", " 252184.0 | \n", " 6.0 | \n", " 12.84 | \n", " 37.44 | \n", " 24.03 | \n", "
\n", " \n", " | paris / base | \n", " 84878.0 | \n", " 848780.0 | \n", " 349348.0 | \n", " 5.0 | \n", " 14.90 | \n", " 62.70 | \n", " 20.27 | \n", "
\n", " \n", " | lyon / base | \n", " 58417.0 | \n", " 292085.0 | \n", " 242580.0 | \n", " 10.0 | \n", " 6.86 | \n", " 51.84 | \n", " 24.99 | \n", "
\n", " \n", "
\n", "
"], "text/plain": [" travellers simulated people links iterations \\\n", "delft / base 65956.0 65956.0 42699.0 9.0 \n", "nguyendupuis / base 2000.0 2000.0 19.0 6.0 \n", "siouxfalls / base 180300.0 180300.0 76.0 5.0 \n", "siouxfalls / congested 270450.0 270450.0 76.0 6.0 \n", "amsterdam / base 57381.0 286905.0 252184.0 6.0 \n", "paris / base 84878.0 848780.0 349348.0 5.0 \n", "lyon / base 58417.0 292085.0 242580.0 10.0 \n", "\n", " read (s) run (s) mean trip (min) \n", "delft / base 3.20 10.36 22.94 \n", "nguyendupuis / base 0.01 0.04 54.52 \n", "siouxfalls / base 1.00 2.46 11.79 \n", "siouxfalls / congested 1.49 4.95 21.48 \n", "amsterdam / base 12.84 37.44 24.03 \n", "paris / base 14.90 62.70 20.27 \n", "lyon / base 6.86 51.84 24.99 "]}, "execution_count": 2, "metadata": {}, "output_type": "execute_result"}], "source": ["CASES = [(\"delft\", \"base\", 1), (\"nguyendupuis\", \"base\", 1), (\"siouxfalls\", \"base\", 1), (\"siouxfalls\", \"congested\", 1),\n", " (\"amsterdam\", \"base\", 1), (\"paris\", \"base\", 1), (\"lyon\", \"base\", 1)] # fmt: skip\n", "\n", "\n", "def timed(name, scenario, sample=1):\n", " \"\"\"A case's scenario, on one of its travellers in ``sample``, timed.\"\"\"\n", " case = ms.examples.case(name)\n", " t = time.perf_counter()\n", " sc = case.scenario(scenario)\n", " if sample > 1: # the same scenario on a sample of its travellers\n", " network = case.network()\n", " transit = case.transit(network)\n", " sc = ms.Scenario.from_parts(\n", " network, ms.demand_sample(case.demand(), sample, seed=0), classes=case.classes(),\n", " transit=transit, parkings=case.parkings() if transit is not None else None,\n", " **case.info[\"scenarios\"][scenario],\n", " ) # fmt: skip\n", " read_s = time.perf_counter() - t\n", " run = sc.run(f\"perf-{name}-{scenario}-{sample}\", quiet=True)\n", " timings = pd.DataFrame(run.timings())\n", " return run, {\n", " \"travellers simulated\": run.completion[\"total_trips\"],\n", " \"people\": sum(run.trip_modes()[\"weight\"]),\n", " \"links\": run.network.link_count,\n", " \"iterations\": len(run.convergence()[\"gap\"]),\n", " \"read (s)\": read_s,\n", " \"run (s)\": timings.loc[timings[\"stage\"] == \"total\", \"seconds\"].iloc[0],\n", " \"mean trip (min)\": run.mean_travel_time_s / 60,\n", " }\n", "\n", "\n", "runs, rows = {}, {}\n", "for name, scenario, sample in CASES:\n", " label = f\"{name} / {scenario}\" + (f\", 1 in {sample}\" if sample > 1 else \"\")\n", " runs[name, scenario, sample], rows[label] = timed(name, scenario, sample)\n", "pd.DataFrame(rows).T.round(2)"]}, {"cell_type": "markdown", "id": "c06", "metadata": {}, "source": "## 2 \u00b7 Where the time goes\n\nAmsterdam's run by stage, summed over the iterations: **static routes** (each trip's walk and ride on the layers,\nonce), **route sets** (the car routes each pair may choose among), the **loadings** (the traffic simulation itself),\nthe **route updates** (between loadings, new routes on the latest times), the **choices** (routes and itineraries),\nthe **network gap** (how far from equilibrium), and the results. On this morning the **itinerary choices** take the\nlargest part (each trip's walk, ride, transit, park-and-ride and bike-and-ride alternatives, searched and weighed:\nabout half here), then the **route updates** (between loadings, a new best route for every pair on the latest\ntimes: about a quarter); the traffic simulation itself about a sixth, partial loadings included."}, {"cell_type": "code", "execution_count": 3, "id": "c07", "metadata": {"execution": {"iopub.execute_input": "2026-10-19T19:42:48.970265Z", "iopub.status.busy": "2026-10-19T19:42:48.970175Z", "iopub.status.idle": "2026-10-19T19:42:48.978624Z", "shell.execute_reply": "2026-10-19T19:42:48.978193Z"}}, "outputs": [{"data": {"text/html": ["\n", "\n", "
\n", " \n", " \n", " | \n", " seconds | \n", " share (%) | \n", "
\n", " \n", " | stage | \n", " | \n", " | \n", "
\n", " \n", " \n", " \n", " | demand_read | \n", " 0.0 | \n", " 0.1 | \n", "
\n", " \n", " | setup | \n", " 0.4 | \n", " 1.0 | \n", "
\n", " \n", " | static_routes | \n", " 0.9 | \n", " 2.4 | \n", "
\n", " \n", " | itineraries_setup | \n", " 0.2 | \n", " 0.6 | \n", "
\n", " \n", " | route_sets | \n", " 0.4 | \n", " 1.1 | \n", "
\n", " \n", " | route_choice | \n", " 0.4 | \n", " 1.0 | \n", "
\n", " \n", " | itinerary_choice | \n", " 19.6 | \n", " 52.4 | \n", "
\n", " \n", " | partial_loading | \n", " 2.1 | \n", " 5.5 | \n", "
\n", " \n", " | route_update | \n", " 8.6 | \n", " 23.0 | \n", "
\n", " \n", " | loading | \n", " 4.6 | \n", " 12.2 | \n", "
\n", " \n", " | network_gap | \n", " 0.1 | \n", " 0.2 | \n", "
\n", " \n", " | results_assembled | \n", " 0.0 | \n", " 0.0 | \n", "
\n", " \n", " | results_written | \n", " 0.2 | \n", " 0.4 | \n", "
\n", " \n", "
\n", "
"], "text/plain": [" seconds share (%)\n", "stage \n", "demand_read 0.0 0.1\n", "setup 0.4 1.0\n", "static_routes 0.9 2.4\n", "itineraries_setup 0.2 0.6\n", "route_sets 0.4 1.1\n", "route_choice 0.4 1.0\n", "itinerary_choice 19.6 52.4\n", "partial_loading 2.1 5.5\n", "route_update 8.6 23.0\n", "loading 4.6 12.2\n", "network_gap 0.1 0.2\n", "results_assembled 0.0 0.0\n", "results_written 0.2 0.4"]}, "execution_count": 3, "metadata": {}, "output_type": "execute_result"}], "source": ["t = pd.DataFrame(runs[\"amsterdam\", \"base\", 1].timings())\n", "t = t[~t[\"stage\"].isin([\"total\", \"network_read\"])]\n", "stage = t.groupby(\"stage\", sort=False)[\"seconds\"].sum()\n", "pd.DataFrame({\"seconds\": stage, \"share (%)\": 100 * stage / stage.sum()}).round(1)"]}, {"cell_type": "markdown", "id": "c08", "metadata": {}, "source": "## 3 \u00b7 A sample of the demand\n\n`demand_sample` keeps one traveller in `w`, each standing for `w` times as many people: the run is roughly `w` times\nfaster. Its vehicles are `w` times larger, so queues are lumpier and the delays a little higher under congestion; a\nsample is for screening many scenarios, the fuller demand for the numbers a study reports. Here Amsterdam's fast run\n(five people a traveller) against samples of it (ten and twenty people a traveller).\n\nA weight is a small aggregation, not a rescaled network: each simulated traveller is a platoon of as many cars as\npeople it stands for, each car counted at its full size on every link, on the network's real capacities, storage and\nsignals (notebook 02). Coarser groups queue in bigger blocks, which is what the table shows."}, {"cell_type": "code", "execution_count": 4, "id": "c09", "metadata": {"execution": {"iopub.execute_input": "2026-10-19T19:42:48.979640Z", "iopub.status.busy": "2026-10-19T19:42:48.979573Z", "iopub.status.idle": "2026-10-19T19:43:43.259932Z", "shell.execute_reply": "2026-10-19T19:43:43.259408Z"}}, "outputs": [{"name": "stderr", "output_type": "stream", "text": ["/var/folders/q0/vjghqqvj4dvcq_z2rjmvd0jmw3f5y2/T/ipykernel_98515/1177908057.py:12: NoAlternativeWarning: 65 trips (1,300 people, 0.5% of run 'perf-sample-4') had no alternative \u2014 no mode they may use reached their destination within the limits \u2014 and were not simulated. By class (stated mode): 57 'no_vehicle' (choosing), 7 'from_outside_transit' (transit), 1 'car_and_bike' (choosing). Why, by mode offered (trips): car: no_road_route 1; bike: ride_too_long 1; walk: walk_too_long 58; transit: no_stop_in_reach 52, no_transit_journey 13; car_transit: too_short 1; bike_transit: too_short 1. Most between (latitude, longitude, about 1 km): 60 people from (52.39, 4.84) to (52.41, 4.85); 40 people from (52.37, 4.85) to (52.41, 4.85); 20 people from (52.28, 4.95) to (52.30, 4.95); 20 people from (52.28, 5.00) to (52.30, 4.95); 20 people from (52.29, 5.02) to (52.31, 5.02). To change: walk_too_long: mode_options['walk_max_s'] or the class's walk_max_s; ride_too_long: mode_options['bike_max_s'] or the class's bike_max_s; no_road_route: the road network between the two (network_check); no_stop_in_reach: transit_options['access_walk_max_s'] or the class's access_walk_max_s; no_transit_journey: transit_options['journey_max_s'], the window, or the timetable; too_short: parking_options['pr_min_km']. Run.report_no_alternative() lists every trip with its reasons.\n", " ).run(f\"perf-sample-{w}\", quiet=True) # fmt: skip\n"]}, {"name": "stderr", "output_type": "stream", "text": ["/var/folders/q0/vjghqqvj4dvcq_z2rjmvd0jmw3f5y2/T/ipykernel_98515/1177908057.py:12: NoAlternativeWarning: 126 trips (1,260 people, 0.4% of run 'perf-sample-2') had no alternative \u2014 no mode they may use reached their destination within the limits \u2014 and were not simulated. By class (stated mode): 111 'no_vehicle' (choosing), 14 'from_outside_transit' (transit), 1 'car_and_bike' (choosing). Why, by mode offered (trips): car: no_road_route 1; bike: ride_too_long 1; walk: walk_too_long 112; transit: no_stop_in_reach 97, no_transit_journey 29; car_transit: too_short 1; bike_transit: too_short 1. Most between (latitude, longitude, about 1 km): 40 people from (52.39, 4.84) to (52.41, 4.85); 20 people from (52.36, 4.91) to (52.41, 4.85); 20 people from (52.36, 4.93) to (52.41, 4.84); 20 people from (52.37, 4.85) to (52.41, 4.85); 20 people from (52.38, 4.90) to (52.40, 4.85). To change: walk_too_long: mode_options['walk_max_s'] or the class's walk_max_s; ride_too_long: mode_options['bike_max_s'] or the class's bike_max_s; no_road_route: the road network between the two (network_check); no_stop_in_reach: transit_options['access_walk_max_s'] or the class's access_walk_max_s; no_transit_journey: transit_options['journey_max_s'], the window, or the timetable; too_short: parking_options['pr_min_km']. Run.report_no_alternative() lists every trip with its reasons.\n", " ).run(f\"perf-sample-{w}\", quiet=True) # fmt: skip\n"]}, {"data": {"text/html": ["\n", "\n", "
\n", " \n", " \n", " | \n", " run (s) | \n", " mean trip (min) | \n", " bike (%) | \n", " car (%) | \n", " transit (%) | \n", "
\n", " \n", " \n", " \n", " | 20 people a traveller | \n", " 17.72 | \n", " 26.43 | \n", " 35.15 | \n", " 34.32 | \n", " 28.05 | \n", "
\n", " \n", " | 10 people a traveller | \n", " 23.60 | \n", " 25.90 | \n", " 34.23 | \n", " 35.07 | \n", " 27.98 | \n", "
\n", " \n", " | 5 (the fast run) | \n", " 37.44 | \n", " 24.03 | \n", " 33.84 | \n", " 35.56 | \n", " 27.97 | \n", "
\n", " \n", "
\n", "
"], "text/plain": [" run (s) mean trip (min) bike (%) car (%) \\\n", "20 people a traveller 17.72 26.43 35.15 34.32 \n", "10 people a traveller 23.60 25.90 34.23 35.07 \n", "5 (the fast run) 37.44 24.03 33.84 35.56 \n", "\n", " transit (%) \n", "20 people a traveller 28.05 \n", "10 people a traveller 27.98 \n", "5 (the fast run) 27.97 "]}, "execution_count": 4, "metadata": {}, "output_type": "execute_result"}], "source": ["case = ms.examples.case(\"amsterdam\")\n", "network, transit, parkings = case.network(), None, None\n", "transit = case.transit(network)\n", "parkings = case.parkings()\n", "demand = case.demand()\n", "rows = {}\n", "for w in (4, 2):\n", " sample = ms.demand_sample(demand, w, seed=0)\n", " run = ms.Scenario.from_parts(\n", " network, sample, classes=case.classes(), transit=transit, parkings=parkings,\n", " **case.info[\"scenarios\"][\"base\"],\n", " ).run(f\"perf-sample-{w}\", quiet=True) # fmt: skip\n", " shares = pd.Series(run.trip_modes()[\"mode\"]).value_counts(normalize=True)\n", " timings = pd.DataFrame(run.timings())\n", " rows[f\"{5 * w} people a traveller\"] = {\"run (s)\": timings.loc[timings[\"stage\"] == \"total\", \"seconds\"].iloc[0],\n", " \"mean trip (min)\": run.mean_travel_time_s / 60, \"bike (%)\": 100 * shares.get(\"bike\", 0),\n", " \"car (%)\": 100 * shares.get(\"car\", 0), \"transit (%)\": 100 * shares.get(\"transit\", 0)} # fmt: skip\n", "fast = runs[\"amsterdam\", \"base\", 1]\n", "shares = pd.Series(fast.trip_modes()[\"mode\"]).value_counts(normalize=True)\n", "rows[\"5 (the fast run)\"] = {\"run (s)\": pd.DataFrame(fast.timings()).query(\"stage == 'total'\")[\"seconds\"].iloc[0],\n", " \"mean trip (min)\": fast.mean_travel_time_s / 60, \"bike (%)\": 100 * shares.get(\"bike\", 0),\n", " \"car (%)\": 100 * shares.get(\"car\", 0), \"transit (%)\": 100 * shares.get(\"transit\", 0)} # fmt: skip\n", "pd.DataFrame(rows).T.round(2)"]}, {"cell_type": "markdown", "id": "c10", "metadata": {}, "source": "**Reading the numbers.** A run's time grows with the travellers simulated, the links, the iterations and the\ncongestion (a congested morning needs more iterations to settle). The cities' default runs (one simulated traveller\nfor five people, ten in Paris, every traveller in Delft, on networks of 43 000\u2013350 000 links, with transit, parking\nand mode choice) are in the first table; Delft, the smallest city, runs in seconds. A coarser sample is faster still: at ten people a\ntraveller its mode shares stay within a few tenths of a point, at twenty they move by up to a point and a half, and\nits mean trip is a little longer, from its lumpier queues."}, {"cell_type": "markdown", "id": "c11", "metadata": {}, "source": "**Next:** [09 \u00b7 Five minimal studies](09_applications.ipynb): five minimal studies to copy and extend: transit frequency, your own utility, accessibility, emissions, a road closed for an hour. The whole series: [00 \u00b7 overview](00_getting_started.ipynb). The documentation: [openmobisim.github.io](https://openmobisim.github.io). Something wrong or unclear? [Report it](https://github.com/bahmanmdd/openmobisim/issues)."}], "metadata": {"kernelspec": {"display_name": "Python 3", "language": "python", "name": "python3"}, "language_info": {"codemirror_mode": {"name": "ipython", "version": 3}, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.13.3"}}, "nbformat": 4, "nbformat_minor": 5}