feat!: ObjectNat 2.0 — UrbanGraph migration, structured provision, clustering removal - #16
Merged
Conversation
… layout Full ObjectNat 2.0 migration off NetworkX onto the IduEdu 2.0 UrbanGraph model, plus a build-system and repository overhaul aligned with IduEdu. Accessibility (isochrones + coverage) - New objectnat/methods/accessibility/ package (coverage, isochrones, radius, shared _utils) built directly on iduedu.UrbanGraph and its Numba Dijkstra (multi_source / nearest_source / parallel), replacing the deleted methods/isochrones/ and methods/coverage_zones/ NetworkX code. - "ways" geometry uses pedestrian (type=="walk") edges only on intermodal/walk graphs so transit legs no longer distort the shape. Build system & packaging - poetry -> uv + hatchling; version is dynamic from objectnat/_version.py. - PEP 621 [project] + PEP 735 [dependency-groups]; python-semantic-release. - CI split into quality.yml / release.yml / docs.yml (mirrors IduEdu), uv-based; test-image publishing to the assets branch preserved. - src/objectnat + src/tests -> flat objectnat/ + tests/ (tests no longer a package). Cleanup - Removed objectnat.gdf_to_graph, dead graph utils (reverse_graph, remove_weakly_connected_nodes, get_closest_nodes_from_gdf) and math_utils; dropped the dead commented get_visibilities_from_points block in visibility. - Exported get_air_resist_ratio from objectnat.methods.noise. - Added AGENTS.md, CONTRIBUTING.md, CHANGELOG.md, .editorconfig, .gitattributes. Tests validated on a live intermodal graph: accessibility 14/14 and noise 5/5 green under pandas 3.0. Known issue: clustering (HDBSCAN cluster_selection_epsilon) fails on numpy 2.4 — upstream scikit-learn bug (#33219), tracked separately. BREAKING CHANGE: graph-based methods now take an iduedu.UrbanGraph, not a networkx.Graph. get_accessibility_isochrones -> get_graph_isochrones and get_accessibility_isochrone_stepped -> get_stepped_graph_isochrones; isochrones return a single GeoDataFrame instead of (isochrones, pt_stops, pt_routes). Arguments are keyword-only and renamed: nx_graph -> urban_graph, points/point -> gdf_origins, gdf_to -> gdf_destinations, weight_value -> weight_value_cutoff, isochrone_type/step_type -> geometry_type. Removed objectnat.gdf_to_graph and the math_utils module. Requires iduedu>=2.0.0, pandas>=3.0, numpy>=2.4.
Refactor service provision to return a ProvisionResult with sparse flow storage, separate demand/capacity summaries, and helper functions for materializing buildings, services, and link GeoDataFrames. Split provision calculation and result formatting into dedicated modules, remove the old Provision model, export the new provision helpers, and update provision tests, docs, and example notebook for the new API. Improve noise propagation through vegetation by using layered tree attenuation, robust signed-angle shadow sectors, and an optional source_position_buffer_r for sources located inside buildings or trees. Add ObjectNat 2.0 migration planning notes and allow lock files to be tracked. BREAKING CHANGE: get_service_provision now a returns ProvisionResult instead of a tuple of GeoDataFrames. recalculate_links now accepts and returns ProvisionResult.
- remove point clustering from the public API and runtime dependencies - drop networkx and scikit-learn from project dependencies - add focused unit coverage for provision, noise, geom utils, and config - make provision allocation seed configurable and document ProvisionResult - update CI quality workflow with lint and Python 3.11/3.12 test matrix - refresh README, Sphinx docs, migration guide, and ObjectNat 2.0 examples - update notebooks for UrbanGraph, OD matrix parquet export, coverage joins, noise edges, and visibility API
|
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BREAKING CHANGE: get_service_provision returns ProvisionResult; graph methods
consume iduedu.UrbanGraph; get_clusters_polygon removed; networkx and
scikit-learn are no longer direct dependencies.