Repository navigation
feat: Add an example for Geohash Layer - #1242
Conversation
| { | ||
| "cells": [ | ||
| { | ||
| "cell_type": "markdown", |
There was a problem hiding this comment.
Similar to other examples like https://github.com/developmentseed/lonboard/blob/main/examples/data-filter-extension.ipynb, could you create the example notebook with juv, so that dependencies are automatically managed with uv?
Assuming you have uv installed already, you can use something like uvx juv init [name] to create the notebook, uvx juv add [name] [dependency] to add dependencies, and uvx juv run [name] to run the notebook.
Then you can copy in the markdown instructional cell:
| @@ -0,0 +1,289 @@ | |||
| { | |||
There was a problem hiding this comment.
CI is failing on some formatting and linting on this notebook
| "# /// script\n", | ||
| "# requires-python = \">=3.12\"\n", | ||
| "# dependencies = [\n", | ||
| "# \"geohash2\",\n", |
There was a problem hiding this comment.
geohash2 is 10 years old: https://github.com/dbarthe/geohash/
Can we use another more modern geohash library like https://pypi.org/project/pygeohash/?
| "requests_df[\"geohash\"] = [\n", | ||
| " geohash2.encode(latitude, longitude, precision=6)\n", | ||
| " for latitude, longitude in zip(requests_df[\"latitude\"], requests_df[\"longitude\"], strict=True)\n", | ||
| "]\n", |
There was a problem hiding this comment.
It would be nice if the geohash library provided a vectorized API, so that we could nudge people towards a faster approach. But this is fine.
Thank you for the review. Let me know if any changes are needed. |
|
Thanks |
> [!NOTE] > This PR was written by Claude (Claude Code), not by @kylebarron. Fixes the failing `Python test` workflow on `main`. The `normalize-notebook-kernelspec` pre-commit hook added in #1254 requires every notebook's kernelspec to be exactly `{"display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3"}`. `examples/geohash-layer.ipynb` (added in #1242) has `"display_name": "Python 3"`, so the hook rewrites it and fails the `tests (3.11)` job, which is the job that runs pre-commit. #1254's PR CI passed because its base branch was older than #1242, so the geohash notebook wasn't there to check. The two changes only met after both merged. This PR is the output of running the hook itself: a one-line change to `display_name`. It's the only notebook in the repo that didn't already match. `uv run pre-commit run --all-files` passes locally with this change. The earlier failure on the #1292 push was a separate, transient network error (`uv sync` couldn't download the `pyogrio` wheel from PyPI) and needs no change. 🤖 Written by [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <[email protected]>
This PR adds an example demonstrating the Geohash Layer. Reference: #1232