Skip to content

feat: library usability improvements, hierarchy support, and cleanup#4

Merged
randomvariable merged 6 commits intomainfrom
usability
Mar 8, 2026
Merged

feat: library usability improvements, hierarchy support, and cleanup#4
randomvariable merged 6 commits intomainfrom
usability

Conversation

@randomvariable
Copy link
Owner

@randomvariable randomvariable commented Mar 8, 2026

Summary

  • Remove deprecated types: Drop GraphFormat, GraphSourceType, GraphDataset, RunConfiguration — superseded by types in core::config / core::backend with no published release to maintain compatibility for
  • Remove unused refinement_gamma: Parameter was accepted but ignored (_refinement_gamma). Removed from RunConfig, multilevel_leiden, refine_singleton_merge, CLI, and all test call sites. Subsumes PR remove unused refinement_gamma #3 with additional missed sites fixed
  • Usability improvements: Conditional serde derives, Optional<GraphSource> in RunConfig, builder methods (with_mode, with_resolution, etc.), run_simple() entry point, crate-root re-exports, CLI gated behind feature flag
  • CommunityState with hierarchy: New CommunityState type for persistent incremental community detection with full hierarchy support — hierarchy_levels(), community_tree() for parent-child derivation via majority vote, into_parts()/from_parts() for decomposed storage
  • Integration tests: 6 tests covering hierarchy population, preservation across updates, community tree validation, and parts roundtrip
  • README: Quick Start with library/CLI examples including hierarchy access for DRIFT search

Test Plan

  • cargo test — all 27 tests + 3 doc-tests pass
  • No compiler warnings
  • Review hierarchy behaviour with larger graphs (ca-HepTh benchmark)

🤖 Generated with Claude Code

randomvariable and others added 6 commits March 8, 2026 16:35
…t, RunConfiguration

These types were superseded by GraphSource, RunConfig, and RunMode in
core::config/backend but never removed. Since there is no published
release, drop them without deprecation period.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The refinement_gamma parameter was accepted but unused (prefixed with _)
in refine_singleton_merge. Remove it from RunConfig, multilevel_leiden,
refine_singleton_merge, CLI, and all test call sites.

Incorporates the intent of PR #3 with additional missed call sites fixed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add conditional serde derives behind "serde" feature flag
- Make graph_source Optional in RunConfig (library users don't need it)
- Add builder methods: with_mode, with_resolution, with_max_iterations,
  with_quality_tolerance
- Add run_simple() entry point for edges-in, partition-out usage
- Re-export PartitionResult, PartitionState, CommunityRelation,
  CommunityState from crate root
- Gate CLI module behind "cli" feature

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
CommunityState wraps PartitionState to provide a persistent,
serializable community detection state that supports incremental
graph updates via delta edge lists.

Key features:
- initial() runs full Leiden and captures hierarchy levels
- update() applies delta edges incrementally, updating level 0
- hierarchy_levels() exposes the multi-level community structure
- community_tree() derives parent-child relationships via majority vote
- into_parts()/from_parts() for decomposed storage and restoration

Hierarchy support enables DRIFT search (top-down traversal of community
tree for progressive query refinement).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Tests cover:
- hierarchy_levels populated after initial()
- hierarchy_levels preserved and extended after update()
- community_tree() returns valid parent-child relations
- into_parts/from_parts roundtrip preserves hierarchy
- incremental update works after restore from parts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add Quick Start sections covering:
- Simple edges-in/partition-out usage with run_simple()
- Configured runs with RunConfig builders
- Weighted edges and dataset identifiers
- Incremental updates with CommunityState
- Hierarchy access for DRIFT search
- CLI usage

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@randomvariable randomvariable merged commit 9247424 into main Mar 8, 2026
2 checks passed
@randomvariable randomvariable deleted the usability branch March 8, 2026 16:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant