diff --git a/notebooks/00-osmnx-features-demo.ipynb b/notebooks/00-osmnx-features-demo.ipynb index 6d3eaa7..e10bb81 100644 --- a/notebooks/00-osmnx-features-demo.ipynb +++ b/notebooks/00-osmnx-features-demo.ipynb @@ -38,7 +38,6 @@ "import networkx as nx\n", "import osmnx as ox\n", "\n", - "%matplotlib inline\n", "ox.__version__" ] }, @@ -264,7 +263,7 @@ "orig_y = G.nodes[orig][\"y\"]\n", "dest_x = G.nodes[dest][\"x\"]\n", "dest_y = G.nodes[dest][\"y\"]\n", - "round(ox.distance.great_circle_vec(orig_y, orig_x, dest_y, dest_x))" + "round(ox.distance.great_circle(orig_y, orig_x, dest_y, dest_x))" ] }, { @@ -456,7 +455,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.11.6" } }, "nbformat": 4, diff --git a/notebooks/01-overview-osmnx.ipynb b/notebooks/01-overview-osmnx.ipynb index f06ee64..5cb03e5 100644 --- a/notebooks/01-overview-osmnx.ipynb +++ b/notebooks/01-overview-osmnx.ipynb @@ -26,7 +26,6 @@ "import geopandas as gpd\n", "import osmnx as ox\n", "\n", - "%matplotlib inline\n", "ox.__version__" ] }, @@ -456,7 +455,7 @@ "cell_type": "markdown", "metadata": {}, "source": [ - "In this street network, the streets are ~16% more circuitous than the straight-lines paths would be.\n", + "In this street network, the streets are ~14% more circuitous than the straight-lines paths would be.\n", "\n", "For examples of analyzing street networks, see [this example](06-stats-indicators-centrality.ipynb)." ] @@ -486,7 +485,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.11.6" } }, "nbformat": 4, diff --git a/notebooks/02-routing-speed-time.ipynb b/notebooks/02-routing-speed-time.ipynb index 1711f16..ae72b59 100644 --- a/notebooks/02-routing-speed-time.ipynb +++ b/notebooks/02-routing-speed-time.ipynb @@ -23,10 +23,11 @@ "metadata": {}, "outputs": [], "source": [ + "import multiprocessing as mp\n", + "\n", "import numpy as np\n", "import osmnx as ox\n", "\n", - "%matplotlib inline\n", "np.random.seed(0)\n", "ox.__version__" ] @@ -271,10 +272,20 @@ "metadata": {}, "outputs": [], "source": [ - "%%time\n", + "# how many CPUs do you have\n", + "mp.cpu_count()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [ + "# %%time\n", "# it takes 2.3 seconds to solve all the routes using all the cores on my computer\n", "# I have a 24-thread AMD 5900x: performance will depend on your specific CPU\n", - "routes = ox.shortest_path(G, origs, dests, weight=\"travel_time\", cpus=2)" + "# routes = ox.shortest_path(G, origs, dests, weight=\"travel_time\", cpus=None)" ] }, { @@ -384,7 +395,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.11.6" } }, "nbformat": 4, diff --git a/notebooks/03-graph-place-queries.ipynb b/notebooks/03-graph-place-queries.ipynb index c9f09e4..d3f85fd 100644 --- a/notebooks/03-graph-place-queries.ipynb +++ b/notebooks/03-graph-place-queries.ipynb @@ -25,7 +25,6 @@ "source": [ "import osmnx as ox\n", "\n", - "%matplotlib inline\n", "ox.__version__" ] }, @@ -344,7 +343,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.11.6" } }, "nbformat": 4, diff --git a/notebooks/04-simplify-graph-consolidate-nodes.ipynb b/notebooks/04-simplify-graph-consolidate-nodes.ipynb index 4cd3618..bcf9636 100644 --- a/notebooks/04-simplify-graph-consolidate-nodes.ipynb +++ b/notebooks/04-simplify-graph-consolidate-nodes.ipynb @@ -24,7 +24,6 @@ "import networkx as nx\n", "import osmnx as ox\n", "\n", - "%matplotlib inline\n", "ox.__version__" ] }, @@ -317,7 +316,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.11.6" } }, "nbformat": 4, diff --git a/notebooks/05-save-load-networks.ipynb b/notebooks/05-save-load-networks.ipynb index d1943ba..078ff5e 100644 --- a/notebooks/05-save-load-networks.ipynb +++ b/notebooks/05-save-load-networks.ipynb @@ -25,7 +25,6 @@ "source": [ "import osmnx as ox\n", "\n", - "%matplotlib inline\n", "ox.__version__" ] }, @@ -184,7 +183,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.11.6" } }, "nbformat": 4, diff --git a/notebooks/06-stats-indicators-centrality.ipynb b/notebooks/06-stats-indicators-centrality.ipynb index 6cef368..c5e9a3b 100644 --- a/notebooks/06-stats-indicators-centrality.ipynb +++ b/notebooks/06-stats-indicators-centrality.ipynb @@ -25,7 +25,6 @@ "import osmnx as ox\n", "import pandas as pd\n", "\n", - "%matplotlib inline\n", "ox.__version__" ] }, @@ -194,7 +193,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.11.6" } }, "nbformat": 4, diff --git a/notebooks/07-plot-graph-over-shape.ipynb b/notebooks/07-plot-graph-over-shape.ipynb index 340ed7e..bce987b 100644 --- a/notebooks/07-plot-graph-over-shape.ipynb +++ b/notebooks/07-plot-graph-over-shape.ipynb @@ -26,7 +26,6 @@ "import matplotlib.pyplot as plt\n", "import osmnx as ox\n", "\n", - "%matplotlib inline\n", "ox.__version__" ] }, @@ -116,7 +115,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.11.6" } }, "nbformat": 4, diff --git a/notebooks/08-custom-filters-infrastructure.ipynb b/notebooks/08-custom-filters-infrastructure.ipynb index 5b78488..aeacd1b 100644 --- a/notebooks/08-custom-filters-infrastructure.ipynb +++ b/notebooks/08-custom-filters-infrastructure.ipynb @@ -25,7 +25,6 @@ "source": [ "import osmnx as ox\n", "\n", - "%matplotlib inline\n", "ox.settings.log_console = True\n", "ox.__version__" ] @@ -139,7 +138,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.11.6" } }, "nbformat": 4, diff --git a/notebooks/09-example-figure-ground.ipynb b/notebooks/09-example-figure-ground.ipynb index 410a5ef..cdaca48 100644 --- a/notebooks/09-example-figure-ground.ipynb +++ b/notebooks/09-example-figure-ground.ipynb @@ -26,7 +26,6 @@ "import osmnx as ox\n", "from IPython.display import Image\n", "\n", - "%matplotlib inline\n", "ox.__version__" ] }, @@ -575,7 +574,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.11.6" } }, "nbformat": 4, diff --git a/notebooks/10-building-footprints.ipynb b/notebooks/10-building-footprints.ipynb index b4cb854..d22c888 100644 --- a/notebooks/10-building-footprints.ipynb +++ b/notebooks/10-building-footprints.ipynb @@ -26,7 +26,6 @@ "import osmnx as ox\n", "from IPython.display import Image\n", "\n", - "%matplotlib inline\n", "ox.__version__" ] }, @@ -72,7 +71,7 @@ "outputs": [], "source": [ "# save as a GeoPackage\n", - "gdf_save = gdf.applymap(lambda x: str(x) if isinstance(x, list) else x)\n", + "gdf_save = gdf.map(lambda x: str(x) if isinstance(x, list) else x)\n", "gdf_save.drop(labels=\"nodes\", axis=1).to_file(\"./data/piedmont_bldgs.gpkg\", driver=\"GPKG\")" ] }, @@ -174,6 +173,8 @@ "outputs": [], "source": [ "# helper funcion to get one-square-mile street networks, building footprints, and plot them\n", + "\n", + "\n", "def make_plot(\n", " place,\n", " point,\n", @@ -269,7 +270,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.11.6" } }, "nbformat": 4, diff --git a/notebooks/11-interactive-web-mapping.ipynb b/notebooks/11-interactive-web-mapping.ipynb index 103fe1f..d9eca4a 100644 --- a/notebooks/11-interactive-web-mapping.ipynb +++ b/notebooks/11-interactive-web-mapping.ipynb @@ -287,7 +287,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.11.6" } }, "nbformat": 4, diff --git a/notebooks/12-node-elevations-edge-grades.ipynb b/notebooks/12-node-elevations-edge-grades.ipynb index fa09e15..4dadad3 100644 --- a/notebooks/12-node-elevations-edge-grades.ipynb +++ b/notebooks/12-node-elevations-edge-grades.ipynb @@ -29,7 +29,6 @@ "import osmnx as ox\n", "import pandas as pd\n", "\n", - "%matplotlib inline\n", "ox.__version__" ] }, @@ -73,7 +72,7 @@ "# add node elevations from multiple raster files\n", "# no nulls should remain\n", "raster_paths = [\"./input_data/elevation1.tif\", \"./input_data/elevation2.tif\"]\n", - "G = ox.elevation.add_node_elevations_raster(G, raster_paths)\n", + "G = ox.elevation.add_node_elevations_raster(G, raster_paths, cpus=1)\n", "assert not np.isnan(np.array(G.nodes(data=\"elevation\"))[:, 1]).any()" ] }, @@ -233,6 +232,8 @@ "outputs": [], "source": [ "# define some edge impedance function here\n", + "\n", + "\n", "def impedance(length, grade):\n", " penalty = grade**2\n", " return length * penalty\n", @@ -358,7 +359,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.11.6" } }, "nbformat": 4, diff --git a/notebooks/13-isolines-isochrones.ipynb b/notebooks/13-isolines-isochrones.ipynb index 4a9ae61..418a654 100644 --- a/notebooks/13-isolines-isochrones.ipynb +++ b/notebooks/13-isolines-isochrones.ipynb @@ -31,7 +31,6 @@ "from shapely.geometry import Point\n", "from shapely.geometry import Polygon\n", "\n", - "%matplotlib inline\n", "ox.__version__" ] }, @@ -250,7 +249,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.11.6" } }, "nbformat": 4, diff --git a/notebooks/14-osmnx-to-igraph.ipynb b/notebooks/14-osmnx-to-igraph.ipynb index 3cbf41d..d127291 100644 --- a/notebooks/14-osmnx-to-igraph.ipynb +++ b/notebooks/14-osmnx-to-igraph.ipynb @@ -32,7 +32,6 @@ "import numpy as np\n", "import osmnx as ox\n", "\n", - "%matplotlib inline\n", "print(ox.__version__)\n", "print(ig.__version__)\n", "\n", @@ -225,7 +224,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.11.6" } }, "nbformat": 4, diff --git a/notebooks/15-advanced-plotting.ipynb b/notebooks/15-advanced-plotting.ipynb index 1c6c66e..3dfcc25 100644 --- a/notebooks/15-advanced-plotting.ipynb +++ b/notebooks/15-advanced-plotting.ipynb @@ -24,7 +24,6 @@ "import matplotlib.pyplot as plt\n", "import osmnx as ox\n", "\n", - "%matplotlib inline\n", "ox.__version__" ] }, @@ -332,7 +331,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.11.6" } }, "nbformat": 4, diff --git a/notebooks/16-download-osm-geospatial-features.ipynb b/notebooks/16-download-osm-geospatial-features.ipynb index 58be56a..f0fea2b 100644 --- a/notebooks/16-download-osm-geospatial-features.ipynb +++ b/notebooks/16-download-osm-geospatial-features.ipynb @@ -27,7 +27,6 @@ "source": [ "import osmnx as ox\n", "\n", - "%matplotlib inline\n", "ox.__version__" ] }, @@ -139,7 +138,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.11.6" } }, "nbformat": 4, diff --git a/notebooks/17-street-network-orientations.ipynb b/notebooks/17-street-network-orientations.ipynb index f1888ae..10e24d6 100644 --- a/notebooks/17-street-network-orientations.ipynb +++ b/notebooks/17-street-network-orientations.ipynb @@ -27,7 +27,6 @@ "import numpy as np\n", "import osmnx as ox\n", "\n", - "%matplotlib inline\n", "weight_by_length = False\n", "\n", "ox.__version__" @@ -147,7 +146,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.11.4" + "version": "3.11.6" } }, "nbformat": 4,