AGENT SKILL

h3-py

Use Uber's h3 Python bindings for hierarchical hexagonal geospatial indexing, cell/grid/edge operations, polygon and GeoJSON conversion, and string/integer/NumPy API selection.

License 许可
Apache-2.0
最近更新
2026-09-03
Stars
★ 351
Forks
27

01 前言 Front Matter

name
h3-py
license
Apache 2.0
metadata
{ "disco-role": "operating" }
description
Use Uber's h3 Python bindings for hierarchical hexagonal geospatial indexing, cell/grid/edge operations, polygon and GeoJSON conversion, and string/integer/NumPy API selection.
disable-model-invocation
true

02 资源文件 5

03 SKILL.md 正文

h3-py

Use this skill when a task needs H3 geospatial indexing from Python: map a latitude/longitude to a cell, inspect or navigate cells, measure spherical quantities, index polygons, convert GeoJSON-like objects, or choose between H3's string, integer, memoryview, and NumPy interfaces.

Install and verify

The public distribution is h3 and requires Python 3.10 or newer. It has no runtime dependency for the default string or memoryview APIs:

python -m pip install h3
python -c "import h3; print(h3.versions())"

Install the optional NumPy API explicitly when downstream code needs h3.api.numpy_int:

python -m pip install 'h3[numpy]'

For a fuller deterministic check, run the bundled helper check_h3_environment.py. Read installation.md for source-build, version, and optional-dependency details. Read troubleshooting.md before treating an import or input error as an H3 algorithm failure.

Route the task

  • Point, cell, hierarchy, grid, measurement, edge, vertex, or local-IJ work: read core-indexing.
  • Polygon, hole, multipolygon, GeoJSON, __geo_interface__, or CRS work: read polygon-geospatial.
  • String versus integer indexes, NumPy arrays, memoryview buffers, conversions, or API performance trade-offs: read api-variants.

A task can use multiple routes. For example, index a polygon with polygon-geospatial, then use core-indexing to inspect or compact the returned cells; choose api-variants only at a representation boundary.

Shared operating contract

  1. Treat geographic pairs as (lat, lng) in degrees for H3 calls. GeoJSON positions are (lng, lat) and must be swapped exactly once at the boundary.
  2. Make the resolution explicit. H3 resolutions are integers 0..15; larger values represent finer cells.
  3. Validate the kind of every index before passing it to an operation. A cell, directed edge, and vertex are different H3 index types.
  4. Do not assume enumeration order. Normalize unordered cell, edge, vertex, or pentagon results before comparison or serialization.
  5. Record package version, API variant, resolution, coordinate order, units, and containment mode when a result must be reproducible.
  6. Keep the original repository out of runtime workflows; use only the references and safe helpers bundled in this skill.

High-value entry points

  • h3.latlng_to_cell(lat, lng, res) creates a cell from a point.
  • h3.cell_to_latlng, cell_to_boundary, cell_area, and great_circle_distance recover geometry or measurements.
  • h3.cell_to_parent, cell_to_children, compact_cells, and uncompact_cells handle hierarchy.
  • h3.grid_disk, grid_ring, grid_distance, and grid_path_cells handle neighborhood and path operations.
  • h3.LatLngPoly, h3.h3shape_to_cells, h3.geo_to_cells, and h3.cells_to_geo handle polygon workflows.
  • h3.versions() reports the Python wrapper and wrapped C library versions; their major and minor versions should match.

The route-specific references contain signatures, output types, recipes, and failure recovery. Do not infer a missing argument or unit from a neighboring H3 language binding.

04 同仓库更多 Skills

VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-triton-opt

Make a single PassNet Triton kernel fast AND numerically faithful: performance model (when a replacement can win at all), block/grid/warp tuning, autotune policy, launch overhead, and per-op numeric recipes to pass the dtype baseline tolerances. Use when a pass matches and is correct but speedup below expected, or when correctness fails by small numeric margins.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-solve

END-TO-END playbook for solving one PassNet sample: analyze the computation graphs, decide the optimization strategy (what to fuse, what to replace, what to leave alone), drive the iteration loop, and maximize the sample score. This is the ENTRY skill — invoke it first for any PassNet optimization task; it tells you when to use passnet-pattern-fusion, passnet-triton-opt and passnet-feedback.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-skill

PassNet GPU kernel optimization via compiler passes. Design and implement Triton-based optimization passes, create pass files under ./pass_dir/, self-evaluate with pass_evaluator, and iterate to maximize GPU speedup.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-pattern-fusion

Author PassNet pass files: write patterns that actually MATCH the FX graph, pick fusion regions (which ops to absorb into one Triton kernel), and structure multi-pass submissions with the mandatory shared-dispatch architecture. Use when creating or fixing pattern()/replacement_args()/replacement_func() files, when a pass "failed to match", or when deciding how to fuse multiple kernels/ops.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-orchestrate

Round/batch planning and decision support for PassNet graph optimization. Use for multi-sample triage, worker allocation, eval-budget policy, and post-eval keep/revert decisions. For solving one concrete sample end to end, use passnet-solve as the entry skill; consult this skill only when you need broader planning or a specific decision gate.

★ 351
VectorSpaceLab
VectorSpaceLab/AREX-Skill

passnet-feedback

Fast, deterministic feedback for PassNet work: pre-flight pattern/match verification WITHOUT burning a GPU evaluation, per-node bottleneck analysis of a sample's graphs, and eval-log parsing into per-variant status + estimated score + failure classification. Use BEFORE every GPU evaluation (check_pattern), at the START of a sample (analyze_graph), and AFTER every evaluation (parse_eval_log).

★ 351