diff --git a/conda/environment-arm64.yml b/conda/environment-arm64.yml index 15223cae08d1..4f1af3b136b3 100644 --- a/conda/environment-arm64.yml +++ b/conda/environment-arm64.yml @@ -50,7 +50,7 @@ dependencies: - toolz >=0.11 - trino-python-client >=0.321 # geospatial - - leafmap >=0.29.6 + - leafmap >=0.29.6,<0.31 # test dependencies - filelock >=3.7.0,<4 - hypothesis >=6.58.0,<7 @@ -91,4 +91,4 @@ dependencies: - just - pip - pip: - - lonboard>=0.3.0 + - lonboard==0.4.0 diff --git a/conda/environment.yml b/conda/environment.yml index 9316a1dfb3b3..05a10637da87 100644 --- a/conda/environment.yml +++ b/conda/environment.yml @@ -51,7 +51,7 @@ dependencies: - toolz >=0.11 - trino-python-client >=0.321 # geospatial - - leafmap >=0.29.6 + - leafmap >=0.29.6,<0.31 # streaming - kafka-python # test dependencies @@ -93,4 +93,6 @@ dependencies: - taplo - tqdm >=4.66.1 - just - # dependencies for lonboard + - pip + - pip: + - lonboard==0.4.0 diff --git a/docs/posts/ibis-duckdb-geospatial/index.qmd b/docs/posts/ibis-duckdb-geospatial/index.qmd index 8b9e6d2063ab..6271eb7b4df7 100644 --- a/docs/posts/ibis-duckdb-geospatial/index.qmd +++ b/docs/posts/ibis-duckdb-geospatial/index.qmd @@ -90,12 +90,9 @@ broad_station Then convert it to a scalar subquery: ```{python} -broad_station_subquery = broad_station.select("geom").to_array() +broad_station_subquery = broad_station.select("geom").as_scalar() ``` -::: {.callout-note} -The `.to_array()` API will change in version `9.0` to a more convenient alternative: `broad_station.as_scalar()`. -::: ### `geo_equals` (`ST_Equals`) @@ -113,7 +110,7 @@ We can also write this query without using `broad_station` as a variable, and wi API, also known as [the underscore API](../../how-to/analytics/chain_expressions.qmd). ```{python} -subway_stations.filter(_.geom.geo_equals(_.filter(_.NAME == "Broad St")[["geom"]].to_array())) +subway_stations.filter(_.geom.geo_equals(_.filter(_.NAME == "Broad St")[["geom"]].as_scalar())) ``` ### `intersect` (ST_Intersect) @@ -148,8 +145,9 @@ sts_near_broad ``` ::: {.callout-note} -In the previous query, `streets` and `broad_station` are different tables. We use [`to_array()`](../../reference/expression-tables.qmd#ibis.expr.types.relations.Table.to_array) to generate a -scalar subquery from a table with a single column (whose shape is scalar). +In the previous query, `streets` and `broad_station` are different tables. We use +[`as_scalar()`](../../reference/expression-tables.qmd#ibis.expr.types.relations.Table.as_scalar) +to generate a scalar subquery from a table with a single column (whose shape is scalar). ::: To visualize the findings, we will convert the tables to GeoPandas DataFrames. @@ -211,7 +209,7 @@ To find if there were any homicides in that area, we can find where the polygon 200 meters buffer to our "Broad St" station point intersects with the geometry column in our homicides table. ```{python} -h_near_broad = homicides.filter(_.geom.intersects(broad_station.select(_.geom.buffer(200)).to_array())) +h_near_broad = homicides.filter(_.geom.intersects(broad_station.select(_.geom.buffer(200)).as_scalar())) h_near_broad ``` @@ -220,7 +218,7 @@ data we can't tell the street near which it happened. However, we can check if t distance of a street. ```{python} -h_street = streets.filter(_.geom.d_within(h_near_broad.select(_.geom).to_array(), 2)) +h_street = streets.filter(_.geom.d_within(h_near_broad.select(_.geom).as_scalar(), 2)) h_street ``` diff --git a/poetry.lock b/poetry.lock index 20df07601dcf..73944c05817d 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,4 +1,4 @@ -# This file is automatically @generated by Poetry 1.7.1 and should not be changed by hand. +# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. [[package]] name = "aiohttp" @@ -147,13 +147,13 @@ files = [ [[package]] name = "anywidget" -version = "0.9.2" +version = "0.7.1" description = "custom jupyter widgets made easy" optional = false python-versions = ">=3.7" files = [ - {file = "anywidget-0.9.2-py3-none-any.whl", hash = "sha256:f13b351fdf1e5f6188f02efeddc77ef754cbf05a7560a36ad9ed9a1ddd3885c6"}, - {file = "anywidget-0.9.2.tar.gz", hash = "sha256:4ba9c1dc37f5eec0f566bb29fb50e2eba14d79a566135aeab7c86882323fdc8e"}, + {file = "anywidget-0.7.1-py3-none-any.whl", hash = "sha256:17828c6e255a7066c960636cbda045d55b08c996a2fc4e886e4c8507db6e9407"}, + {file = "anywidget-0.7.1.tar.gz", hash = "sha256:1c4cb51063f8ec5172b8c8efb1bfb79861d340c3491220d56b8c2a6aa8db3b3d"}, ] [package.dependencies] @@ -163,7 +163,7 @@ typing-extensions = ">=4.2.0" [package.extras] dev = ["comm (>=0.1.0)", "watchfiles (>=0.18.0)"] -test = ["ipython (<8.13)", "msgspec", "pydantic", "pytest", "pytest-cov", "ruff"] +test = ["black[jupyter]", "ipython (<8.13)", "msgspec", "pydantic", "pytest", "pytest-cov", "ruff"] [[package]] name = "appdirs" @@ -3020,13 +3020,13 @@ files = [ [[package]] name = "leafmap" -version = "0.31.3" +version = "0.30.1" description = "A Python package for geospatial analysis and interactive mapping in a Jupyter environment." optional = false python-versions = ">=3.8" files = [ - {file = "leafmap-0.31.3-py2.py3-none-any.whl", hash = "sha256:19b28cc3adbe3b0e42e918cd48ff86c04b436877fd5545559ea0587f2b7e203d"}, - {file = "leafmap-0.31.3.tar.gz", hash = "sha256:b4447a3ebeca69c11006e084f54736b3f15716082aedcee004ac4deabab67e61"}, + {file = "leafmap-0.30.1-py2.py3-none-any.whl", hash = "sha256:18223679b47d436cebde1d51aa96061de5f033f0da6eb27681325dafdda74eb5"}, + {file = "leafmap-0.30.1.tar.gz", hash = "sha256:980caf9ebbb45c2ead56a73531c5204824154d349186e6e8fec5ae69d4035d9c"}, ] [package.dependencies] @@ -3052,13 +3052,13 @@ whiteboxgui = "*" xyzservices = "*" [package.extras] -ai = ["geopandas", "localtileserver (>=0.10.0)", "osmnx", "pytorch-lightning", "rastervision"] -all = ["PyYAML (==6.0.1)", "black", "black[jupyter]", "bokeh", "boto3", "codespell", "cogeo-mosaic", "deadlink", "earthaccess", "ffmpeg-python", "geopandas", "googledrivedownloader", "gradio", "h5py", "ipygany", "ipysheet", "ipyvtklink", "jupyter-bokeh", "jupyterlab (>=3.0.0)", "keplergl", "laspy", "localtileserver (>=0.10.1)", "lonboard", "mapclassify (>=2.4.0)", "mss", "netcdf4", "osmnx", "owslib", "palettable", "panel", "plotly", "pmtiles", "pre-commit", "psycopg2", "pycrs", "pydeck", "pyntcloud[las]", "pyvista-xarray", "rasterio", "rasterstats", "rio-cogeo", "rioxarray", "sqlalchemy", "streamlit-folium", "xarray-leaflet"] +ai = ["geopandas", "localtileserver", "osmnx", "pytorch-lightning", "rastervision"] +all = ["PyYAML (==6.0.1)", "black", "black[jupyter]", "bokeh", "boto3", "codespell", "cogeo-mosaic", "deadlink", "earthaccess", "ffmpeg-python", "geopandas", "googledrivedownloader", "gradio", "h5py", "ipygany", "ipysheet", "ipyvtklink", "jupyter-bokeh", "jupyterlab (>=3.0.0)", "keplergl", "laspy", "localtileserver", "lonboard", "mapclassify (>=2.4.0)", "mss", "netcdf4", "osmnx", "owslib", "palettable", "panel", "plotly", "pmtiles", "psycopg2", "pycrs", "pydeck", "pyntcloud[las]", "pyvista-xarray", "rasterio", "rasterstats", "rio-cogeo", "rioxarray", "sqlalchemy", "streamlit-folium", "xarray-leaflet"] apps = ["solara", "streamlit-folium", "voila"] backends = ["bokeh", "keplergl", "plotly", "pydeck"] lidar = ["ipygany", "ipyvtklink", "laspy", "panel", "pyntcloud[las]", "pyvista"] pmtiles = ["flask", "flask-cors", "pmtiles"] -raster = ["jupyter-server-proxy", "localtileserver (>=0.10.0)", "netcdf4", "py3dep", "pynhd", "rio-cogeo", "rioxarray"] +raster = ["jupyter-server-proxy", "localtileserver", "netcdf4", "py3dep", "pynhd", "rio-cogeo", "rioxarray"] sql = ["psycopg2", "sqlalchemy"] vector = ["flask", "flask-cors", "geopandas", "lonboard", "mapclassify", "osmnx", "pmtiles"] @@ -3075,17 +3075,17 @@ files = [ [[package]] name = "lonboard" -version = "0.6.0" +version = "0.4.0" description = "Python library for fast, interactive geospatial vector data visualization in Jupyter." optional = false python-versions = ">=3.8,<4.0" files = [ - {file = "lonboard-0.6.0-py3-none-any.whl", hash = "sha256:31e0db50593587188895d47d5322e97300fb7f8eb5420f97eac40658a6fa84a9"}, - {file = "lonboard-0.6.0.tar.gz", hash = "sha256:1cfb38c52b26c4f61be7565b76fb0500e44c118651be06748189234a6ec0422f"}, + {file = "lonboard-0.4.0-py3-none-any.whl", hash = "sha256:2c521805c05db4c8efdbd7cb19174d3f5e1c43723b7c6db358b2f158d96e671f"}, + {file = "lonboard-0.4.0.tar.gz", hash = "sha256:c60ccaa5ac06ad2fdad88e146cc2206389d59e0dd4d53bd6de8bab26cae81e7c"}, ] [package.dependencies] -anywidget = ">=0.9.0,<0.10.0" +anywidget = ">=0.7.1,<0.8.0" geopandas = ">=0.13" matplotlib = ">=3.7,<4.0" palettable = ">=3.3.3,<4.0.0" @@ -7324,4 +7324,4 @@ visualization = ["graphviz"] [metadata] lock-version = "2.0" python-versions = "^3.9" -content-hash = "74f81f7be9e04491689736c492631936d0a539f5dc85b3ae50d7cbf7b7d7de05" +content-hash = "76aecbe03f4837aead8d786cc1d92a8be643c33a00bf7bde77d39864684a27ca" diff --git a/pyproject.toml b/pyproject.toml index 939589ee2077..19f6dac38741 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -135,8 +135,8 @@ quartodoc = { version = ">=0.6.1,<1", python = ">=3.10,<3.13" } requests = { version = ">=2,<3", python = ">=3.10,<3.13" } scikit-learn = { version = ">=1.3,<2", python = ">=3.10,<3.13" } seaborn = { version = ">=0.12.2,<1", python = ">=3.10,<3.13" } -leafmap = { version = ">=0.29.6,<1", python = ">=3.10,<3.13" } -lonboard = { version = ">=0.5.0,<1", python = ">=3.10,<3.13" } +leafmap = { version = ">=0.29.6,<0.31", python = ">=3.10,<3.13" } +lonboard = { version = "==0.4.0", python = ">=3.10,<3.13" } [tool.poetry.extras] # generate the `all` extra using nix run '.#gen-all-extras' diff --git a/requirements-dev.txt b/requirements-dev.txt index 43cb6cf7b3d5..2fe0d3bb3c6c 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -2,7 +2,7 @@ aiohttp==3.9.3 ; python_version >= "3.9" and python_version < "4.0" aiosignal==1.3.1 ; python_version >= "3.9" and python_version < "4.0" altair==5.2.0 ; python_version >= "3.10" and python_version < "3.13" annotated-types==0.6.0 ; python_version >= "3.10" and python_version < "3.13" -anywidget==0.9.2 ; python_version >= "3.10" and python_version < "3.13" +anywidget==0.7.1 ; python_version >= "3.10" and python_version < "3.13" appdirs==1.4.4 ; python_version >= "3.9" and python_version < "4.0" appnope==0.1.4 ; python_version >= "3.10" and python_version < "3.13" and platform_system == "Darwin" asn1crypto==1.5.1 ; python_version >= "3.9" and python_version < "4.0" @@ -111,9 +111,9 @@ jupyter-core==5.7.1 ; python_version >= "3.10" and python_version < "3.13" jupyterlab-widgets==3.0.10 ; python_version >= "3.10" and python_version < "3.13" keyring==24.3.1 ; python_version >= "3.9" and python_version < "4.0" kiwisolver==1.4.5 ; python_version >= "3.10" and python_version < "3.13" -leafmap==0.31.3 ; python_version >= "3.10" and python_version < "3.13" +leafmap==0.30.1 ; python_version >= "3.10" and python_version < "3.13" locket==1.0.0 ; python_version >= "3.9" and python_version < "4.0" -lonboard==0.6.0 ; python_version >= "3.10" and python_version < "3.13" +lonboard==0.4.0 ; python_version >= "3.10" and python_version < "3.13" lz4==4.3.3 ; python_version >= "3.9" and python_version < "4.0" markdown-it-py==3.0.0 ; python_version >= "3.9" and python_version < "4.0" markupsafe==2.1.5 ; python_version >= "3.9" and python_version < "4.0"