chore: project scaffolding for decomposition solver package #23

Open
opened 2026-02-20 22:24:11 +00:00 by forbes · 0 comments
Owner

Summary

Set up the package structure and dependencies for the graph decomposition meta-solver within the solver/ Python package.

Context

The decomposition solver is a Python IKCSolver plugin that decomposes assembly constraint problems into subproblems via graph analysis, dispatches them to backend solvers (Ondsel), and reconciles results. This issue establishes the skeleton that subsequent issues build on.

References:

  • docs/SOLVER_THEORY.md in kindred/create — plugin architecture spec
  • src/Mod/Assembly/Solver/ in kindred/create — KCSolve C++ API (IKCSolver, Types.h, SolverRegistry)
  • src/Mod/Assembly/Solver/bindings/ — pybind11 kcsolve module

Tasks

  • Create solver/decomposition/ package with __init__.py
  • Add empty module files matching the target layout:
    • solver.py — IKCSolver subclass (entry point)
    • constraint_graph.py — SolveContext → graph translation
    • structural_analyzer.py — DOF counting and diagnostics
    • decomposer.py — biconnected decomposition + solve plan
    • dispatcher.py — subproblem routing to backend solvers
    • reconciler.py — sub-solution merging and validation
    • patterns/__init__.py — closed-form pattern solvers
  • Update pyproject.toml with new dependencies:
    • igraph — biconnected components, articulation points (C core, fast)
    • scipy — sparse Jacobian rank checks
    • numpy — numerical operations
  • Add kcsolve type stubs or mock interface for standalone testing (the real kcsolve module requires a FreeCAD build)
  • Add tests/decomposition/ test directory with conftest.py providing shared SolveContext fixtures

File layout target

solver/decomposition/
├── __init__.py
├── solver.py
├── constraint_graph.py
├── structural_analyzer.py
├── decomposer.py
├── dispatcher.py
├── reconciler.py
└── patterns/
    └── __init__.py
tests/decomposition/
├── conftest.py
├── test_graph.py
├── test_analyzer.py
├── test_decomposer.py
└── test_patterns.py

Acceptance criteria

  • import solver.decomposition succeeds
  • pytest tests/decomposition/ runs (even if tests are trivially passing stubs)
  • Dependencies installable via pip install -e .[dev] or pixi
## Summary Set up the package structure and dependencies for the graph decomposition meta-solver within the `solver/` Python package. ## Context The decomposition solver is a Python `IKCSolver` plugin that decomposes assembly constraint problems into subproblems via graph analysis, dispatches them to backend solvers (Ondsel), and reconciles results. This issue establishes the skeleton that subsequent issues build on. References: - `docs/SOLVER_THEORY.md` in `kindred/create` — plugin architecture spec - `src/Mod/Assembly/Solver/` in `kindred/create` — KCSolve C++ API (IKCSolver, Types.h, SolverRegistry) - `src/Mod/Assembly/Solver/bindings/` — pybind11 `kcsolve` module ## Tasks - [ ] Create `solver/decomposition/` package with `__init__.py` - [ ] Add empty module files matching the target layout: - `solver.py` — IKCSolver subclass (entry point) - `constraint_graph.py` — SolveContext → graph translation - `structural_analyzer.py` — DOF counting and diagnostics - `decomposer.py` — biconnected decomposition + solve plan - `dispatcher.py` — subproblem routing to backend solvers - `reconciler.py` — sub-solution merging and validation - `patterns/__init__.py` — closed-form pattern solvers - [ ] Update `pyproject.toml` with new dependencies: - `igraph` — biconnected components, articulation points (C core, fast) - `scipy` — sparse Jacobian rank checks - `numpy` — numerical operations - [ ] Add kcsolve type stubs or mock interface for standalone testing (the real `kcsolve` module requires a FreeCAD build) - [ ] Add `tests/decomposition/` test directory with `conftest.py` providing shared SolveContext fixtures ## File layout target ``` solver/decomposition/ ├── __init__.py ├── solver.py ├── constraint_graph.py ├── structural_analyzer.py ├── decomposer.py ├── dispatcher.py ├── reconciler.py └── patterns/ └── __init__.py tests/decomposition/ ├── conftest.py ├── test_graph.py ├── test_analyzer.py ├── test_decomposer.py └── test_patterns.py ``` ## Acceptance criteria - `import solver.decomposition` succeeds - `pytest tests/decomposition/` runs (even if tests are trivially passing stubs) - Dependencies installable via `pip install -e .[dev]` or pixi
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: kindred/solver#23