Skip to content

Commit

Permalink
DOC: ruff user guide (#613)
Browse files Browse the repository at this point in the history
  • Loading branch information
martinfleis committed Jun 18, 2024
1 parent a838630 commit 8e34048
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 25 deletions.
8 changes: 4 additions & 4 deletions docs/user_guide/elements/blocks.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@
"source": [
"ax = blocks.plot(edgecolor=\"white\", linewidth=0.5, figsize=(8, 8))\n",
"buildings.plot(ax=ax, color=\"white\", alpha=0.5)\n",
"ax.set_axis_off()\n"
"ax.set_axis_off()"
]
},
{
Expand Down Expand Up @@ -347,7 +347,7 @@
"source": [
"ax = blocks.plot(edgecolor=\"white\", linewidth=0.5, figsize=(8, 8))\n",
"buildings.plot(ax=ax, color=\"white\", alpha=0.5)\n",
"ax.set_axis_off()\n"
"ax.set_axis_off()"
]
},
{
Expand Down Expand Up @@ -416,7 +416,7 @@
"ax = tessellation.plot(edgecolor=\"white\", linewidth=0.2, figsize=(8, 8))\n",
"buildings.plot(ax=ax, color=\"white\", alpha=0.5)\n",
"snapped.plot(ax=ax, color=\"black\")\n",
"ax.set_axis_off()\n"
"ax.set_axis_off()"
]
},
{
Expand Down Expand Up @@ -486,7 +486,7 @@
"source": [
"ax = blocks.plot(edgecolor=\"white\", linewidth=0.5, figsize=(8, 8))\n",
"buildings.plot(ax=ax, color=\"white\", alpha=0.5)\n",
"ax.set_axis_off()\n"
"ax.set_axis_off()"
]
}
],
Expand Down
5 changes: 1 addition & 4 deletions docs/user_guide/elements/enclosed.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -581,10 +581,7 @@
"source": [
"import osmnx as ox\n",
"\n",
"\n",
"gdf = ox.features_from_place(\n",
" \"Kahla, Germany\", tags={\"building\": True}\n",
")\n",
"gdf = ox.features_from_place(\"Kahla, Germany\", tags={\"building\": True})\n",
"buildings = ox.projection.project_gdf(gdf)\n",
"\n",
"streets_graph = ox.graph_from_place(\"Kahla, Germany\", network_type=\"drive\")\n",
Expand Down
6 changes: 2 additions & 4 deletions docs/user_guide/elements/tessellation.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
],
"source": [
"ax = buildings.plot(figsize=(8, 8))\n",
"ax.set_axis_off()\n"
"ax.set_axis_off()"
]
},
{
Expand Down Expand Up @@ -297,9 +297,7 @@
"source": [
"import osmnx as ox\n",
"\n",
"gdf = ox.features_from_place(\n",
" \"Kahla, Germany\", tags={\"building\": True}\n",
")\n",
"gdf = ox.features_from_place(\"Kahla, Germany\", tags={\"building\": True})\n",
"gdf_projected = ox.projection.project_gdf(gdf)"
]
},
Expand Down
8 changes: 4 additions & 4 deletions docs/user_guide/graph/centrality.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@
" scheme=\"quantiles\",\n",
" k=15,\n",
" alpha=0.6,\n",
" figsize=(15, 15)\n",
" figsize=(15, 15),\n",
")\n",
"ax.set_axis_off()\n",
"_ = ax.set_title(\"closeness400\")"
Expand Down Expand Up @@ -298,7 +298,7 @@
" scheme=\"quantiles\",\n",
" k=15,\n",
" alpha=0.6,\n",
" figsize=(15, 15)\n",
" figsize=(15, 15),\n",
")\n",
"ax.set_axis_off()\n",
"_ = ax.set_title(\"closeness_global\")"
Expand Down Expand Up @@ -370,7 +370,7 @@
" scheme=\"quantiles\",\n",
" k=7,\n",
" alpha=0.6,\n",
" figsize=(15, 15)\n",
" figsize=(15, 15),\n",
")\n",
"ax.set_axis_off()\n",
"_ = ax.set_title(\"betweenness_metric_n\")"
Expand Down Expand Up @@ -436,7 +436,7 @@
" cmap=\"Spectral_r\",\n",
" scheme=\"quantiles\",\n",
" alpha=0.6,\n",
" figsize=(15, 15)\n",
" figsize=(15, 15),\n",
")\n",
"ax.set_axis_off()\n",
"_ = ax.set_title(\"betweennes edge based\")"
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/graph/convert.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@
" cmap=\"tab20b\",\n",
" markersize=(nodes[\"degree\"] * 100),\n",
" zorder=2,\n",
" figsize=(8, 8)\n",
" figsize=(8, 8),\n",
")\n",
"edges.plot(ax=ax, color=\"lightgrey\", zorder=1)\n",
"ax.set_axis_off()"
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/graph/network.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@
" alpha=0.5,\n",
" zorder=2,\n",
" scheme=\"quantiles\",\n",
" figsize=(8, 8)\n",
" figsize=(8, 8),\n",
")\n",
"streets.plot(ax=ax, color=\"lightgrey\", alpha=0.5, zorder=1)\n",
"ax.set_axis_off()"
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/simple/dimension.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@
" scheme=\"quantiles\",\n",
" k=10,\n",
" cmap=\"Greens\",\n",
" figsize=(8, 8)\n",
" figsize=(8, 8),\n",
")\n",
"ax.set_axis_off()"
]
Expand Down
3 changes: 1 addition & 2 deletions docs/user_guide/simple/shape.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import momepy\n",
"import numpy as np"
]
Expand Down Expand Up @@ -575,7 +574,7 @@
" cmap=\"coolwarm_r\",\n",
" scheme=\"quantiles\",\n",
" k=4,\n",
" figsize=(8, 8)\n",
" figsize=(8, 8),\n",
")\n",
"buildings.plot(ax=ax, color=\"lightgrey\")\n",
"ax.set_axis_off()"
Expand Down
2 changes: 1 addition & 1 deletion docs/user_guide/weights/diversity.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@
" k=10,\n",
" legend=True,\n",
" cmap=\"plasma\",\n",
" figsize=(8, 8)\n",
" figsize=(8, 8),\n",
")\n",
"buildings.plot(ax=ax, color=\"white\", alpha=0.4)\n",
"ax.set_axis_off()"
Expand Down
4 changes: 1 addition & 3 deletions docs/user_guide/weights/examples.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -599,9 +599,7 @@
"].reset_index(drop=True)\n",
"\n",
"limit = momepy.buffered_limit(buildings)\n",
"tessellation = momepy.morphological_tessellation(\n",
" buildings, clip=limit\n",
")"
"tessellation = momepy.morphological_tessellation(buildings, clip=limit)"
]
},
{
Expand Down

0 comments on commit 8e34048

Please sign in to comment.