Skip to content

[ENH]: Use deterministic solver instead of constrained_layout? #31312

@jklymak

Description

@jklymak

Constrained layout works pretty well for a number of cases, but the code is pretty convoluted. It has bothered me for a while that it uses the constraint solver, but the constraints are so regulated that they really can just be solved with a bit of calculation.

I probably wouldn't have sat down to redo this on my own, but I burnt up some of my Claude tokens and made a new layout engine that is pretty close to feature compatible with constrained layout.

Pros:

  • no kiwisolver dependency: the kiwisolver folks have been great, but it is a C dependency and hence a bit fragile to packaging quirks.
  • the code is less indirect, and I'd say easier to follow.
  • It is faster for large grids (though such grids are perhaps well beyond anything most people should be making anyway)

Cons:

Posting for feedback on strategy here. It could be a standalone package, it could be another layout manager, or we could try and replace constrained layout altogether with it (though I'd want to wait a bit to put it through more tests).

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: geometry managerLayoutEngine, Constrained layout, Tight layout

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions