graph-modeling-io
Manipulate OSMnx NetworkX/GeoPandas graph data structures and persist or restore them safely.
- License 许可
- MIT
- 最近更新
- 2026-09-03
- Stars
- ★ 351
- Forks
- 27
01 前言 Front Matter
- name
- graph-modeling-io
- license
- MIT
- metadata
- { "disco-role": "operating" }
- description
- Manipulate OSMnx NetworkX/GeoPandas graph data structures and persist or restore them safely.
- disable-model-invocation
- true
02 资源文件 4
- 参考文档references/data-model.md13.4 KB
- 参考文档references/io-reference.md8.6 KB
- 参考文档references/troubleshooting.md12.0 KB
- 脚本scripts/validate_graph_io_smoke.py4.6 KB
03 SKILL.md 正文
Graph Modeling and I/O
Use this sub-skill when the task is about an existing OSMnx graph or GeoDataFrame: validating its schema, converting between NetworkX and GeoPandas representations, projecting CRS, simplifying or consolidating topology, truncating components, or saving/loading graph files.
Route here
- Validate OSMnx graph, node/edge GeoDataFrame, or features GeoDataFrame invariants.
- Convert
MultiDiGraph/MultiGraphobjects to/from node and edge GeoDataFrames. - Create directed/undirected graph views with
to_digraphorto_undirected. - Project geometries, GeoDataFrames, or graphs with
project_geometry,project_gdf, orproject_graph. - Simplify topology, consolidate intersections, truncate by distance/bbox/polygon, or keep the largest weak/strong component.
- Persist or restore graph data with GraphML, GeoPackage, or OSM XML.
Route elsewhere
- Downloading, geocoding, Overpass/Nominatim settings, OSM tag queries, or local XML acquisition belong to
data-acquisition. - Nearest-node/edge search, route computation, network statistics, bearings, orientation entropy, speeds, or travel times belong to
routing-analysis. - Elevation, grade calculation, and plotting belong to
elevation-visualization.
Operating references
Read these before acting:
- Data model and transformations for graph/GDF invariants, validation, conversion, projection, simplification, consolidation, truncation, and difficult recovery patterns.
- Persistence and file formats for GraphML, GeoPackage, OSM XML, dtype restoration, and format-choice rules.
- Troubleshooting graph modeling and I/O for predictable validation, CRS, simplification, truncation, and save/load failures.
Bundled smoke script:
- Graph/GDF/GraphML smoke test creates a tiny graph, validates it, round-trips through GeoDataFrames, saves/loads GraphML in a temporary directory, and prints a concise success summary.
Minimal workflow
- Identify the object type: OSMnx
networkx.MultiDiGraph, node/edge GeoDataFrames, features GeoDataFrame, geometry, or file path. - Validate early with
osmnx.convert.validate_graph,validate_node_edge_gdfs, orvalidate_features_gdf. - Normalize the data model before analysis or persistence: ensure CRS, node
x/y, edge(u, v, key)index, edgeosmid, and edgelengthare present with compatible types. - Use projection before distance/tolerance operations that require metric units, then project back to lat-long only when needed for geographic output.
- Choose persistence format deliberately: GraphML for future OSMnx work, GeoPackage for GIS layer exchange, OSM XML only for unsimplified/unprojected OSM-style export.
- Run the bundled smoke script when an environment or installation may be suspect.
04 同仓库更多 Skills
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.
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.
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.
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.
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.
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).