Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use 2.0 Beta 0 #88

Merged
merged 7 commits into from
May 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,25 +23,30 @@ jobs:
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 2

- name: Create environment with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
cache-downloads: true
cache-environment: true
environment-file: environment.yml
post-cleanup: none

- name: Lint notebooks
run: |
SKIP=no-commit-to-branch pre-commit run --all-files
- name: Cache pre-commit
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit/
key: pre-commit-${{ matrix.os }}-${{ hashFiles('.pre-commit-config.yaml') }}

- name: Run pre-commit checks
run: pre-commit run --all-files
env:
SKIP: no-commit-to-branch

- name: Test notebooks
run: |
ipython -c "import osmnx; print(osmnx.__version__)"
cd ./notebooks
rm -r -f *.py
jupyter nbconvert --to python *.ipynb
for f in *.py; do ipython "$f"; done
for filename in *.py; do ipython "$filename"; done
rm -r -f *.py
21 changes: 21 additions & 0 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
cff-version: 1.2.0
message: "If you use OSMnx, please cite the preferred-citation below."
title: "OSMnx Examples"
abstract: "Gallery of OSMnx tutorials, usage examples, and feature demonstations."
authors:
- family-names: "Boeing"
given-names: "Geoff"
orcid: "https://orcid.org/0000-0003-1851-6411"
website: "https://geoffboeing.com"
url: "https://osmnx.readthedocs.org"
repository-code: "https://github.com/gboeing/osmnx-examples"
preferred-citation:
type: report
title: "Modeling and Analyzing Urban Networks and Amenities with OSMnx"
authors:
- family-names: "Boeing"
given-names: "Geoff"
orcid: "https://orcid.org/0000-0003-1851-6411"
website: "https://geoffboeing.com"
year: 2024
url: "https://geoffboeing.com/publications/osmnx-paper/"
23 changes: 21 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,29 @@
name: osmnx-examples
channels:
- conda-forge

dependencies:
# OSMnx required/optional dependencies
- gdal
- geopandas
- matplotlib
- networkx
- numpy
- pandas
- rasterio
- requests
- scipy
- scikit-learn
- shapely

# other packages needed for CI or running examples
- jupyterlab
- osmnx=1.9.3
- pillow
- pre-commit
- python=3.11.*
- python=3.12.*
- python-igraph

# install OSMnx beta via pip
- pip
- pip:
- osmnx==2.0.0b0
2 changes: 1 addition & 1 deletion notebooks/00-osmnx-features-demo.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
4 changes: 2 additions & 2 deletions notebooks/01-overview-osmnx.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@
"outputs": [],
"source": [
"# turn off strict mode and see what nodes we'd remove, in yellow\n",
"nc = [\"r\" if ox.simplification._is_endpoint(G, node, None) else \"y\" for node in G.nodes()]\n",
"nc = [\"r\" if ox.simplification._is_endpoint(G, node, None, None) else \"y\" for node in G.nodes()]\n",
"fig, ax = ox.plot_graph(G, node_color=nc)"
]
},
Expand Down Expand Up @@ -484,7 +484,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
8 changes: 5 additions & 3 deletions notebooks/04-simplify-graph-consolidate-nodes.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
"outputs": [],
"source": [
"# show which nodes we'd remove if we simplify it (yellow)\n",
"nc = [\"r\" if ox.simplification._is_endpoint(G, node, None) else \"y\" for node in G.nodes()]\n",
"nc = [\"r\" if ox.simplification._is_endpoint(G, node, None, None) else \"y\" for node in G.nodes()]\n",
"fig, ax = ox.plot_graph(G, node_color=nc)"
]
},
Expand Down Expand Up @@ -182,7 +182,9 @@
"outputs": [],
"source": [
"# turn off strict mode and see what nodes we'd remove\n",
"nc = [\"r\" if ox.simplification._is_endpoint(G, node, [\"osmid\"]) else \"y\" for node in G.nodes()]\n",
"nc = [\n",
" \"r\" if ox.simplification._is_endpoint(G, node, [\"osmid\"], None) else \"y\" for node in G.nodes()\n",
"]\n",
"fig, ax = ox.plot_graph(G, node_color=nc)"
]
},
Expand Down Expand Up @@ -233,7 +235,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
12 changes: 6 additions & 6 deletions notebooks/10-building-footprints.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
"source": [
"# save as a GeoPackage\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\")"
"gdf_save.to_file(\"./data/piedmont_bldgs.gpkg\", driver=\"GPKG\")"
]
},
{
Expand Down Expand Up @@ -110,7 +110,7 @@
"source": [
"# get the total area within Piedmont's admin boundary in sq meters\n",
"place = ox.geocode_to_gdf(\"Piedmont, California, USA\")\n",
"place_proj = ox.project_gdf(place)\n",
"place_proj = ox.projection.project_gdf(place)\n",
"place_proj.area.iloc[0]"
]
},
Expand Down Expand Up @@ -140,7 +140,7 @@
"point = (48.873446, 2.294255)\n",
"dist = 612\n",
"gdf = ox.features_from_point(point, tags, dist=dist)\n",
"gdf_proj = ox.project_gdf(gdf)\n",
"gdf_proj = ox.projection.project_gdf(gdf)\n",
"bbox = ox.utils_geo.bbox_from_point(point=point, dist=dist, project_utm=True)\n",
"fp = f\"./{img_folder}/paris_bldgs.{extension}\"\n",
"fig, ax = ox.plot_footprints(\n",
Expand Down Expand Up @@ -262,9 +262,9 @@
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python (ox)",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "ox"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -276,7 +276,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions notebooks/11-interactive-web-mapping.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,9 @@
"metadata": {
"anaconda-cloud": {},
"kernelspec": {
"display_name": "Python (ox)",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "ox"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -286,7 +286,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions notebooks/12-node-elevations-edge-grades.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -344,9 +344,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python (ox)",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "ox"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -358,7 +358,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions notebooks/13-isolines-isochrones.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -234,9 +234,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python (ox)",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "ox"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -248,7 +248,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions notebooks/14-osmnx-to-igraph.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python (ox)",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "ox"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -223,7 +223,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions notebooks/15-advanced-plotting.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -316,9 +316,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python (ox)",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "ox"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -330,7 +330,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions notebooks/16-download-osm-geospatial-features.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python (ox)",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "ox"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -137,7 +137,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down
6 changes: 3 additions & 3 deletions notebooks/17-street-network-orientations.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,9 @@
],
"metadata": {
"kernelspec": {
"display_name": "Python (ox)",
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "ox"
"name": "python3"
},
"language_info": {
"codemirror_mode": {
Expand All @@ -145,7 +145,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.11.9"
"version": "3.12.3"
}
},
"nbformat": 4,
Expand Down