Skip to content

[ENH]: Rename Bbox.from_extents / Bbox.extents to "corners" #26805

Open
@anntzer

Description

@anntzer

Problem

I always find it difficult when working on internals to remember which of Bbox.extents and Bbox.bounds is (x0, y0), (x1, y1) and which is x0, y0, w, h (perhaps there's a clear mnemonic as to why one should be called extents and one should be called bounds, but I never found it :/)
A possible improvement would be to rename extents ((x0, y0), (x1, y1)) to "corners", as that seems to be a more transparent name (at least to me...); I can't think of a less ambiguous name for bounds, but if we slowly get rid of "extents" in the codebase, bounds will just remain as "the one that's not "corners"".
(We can also debate whether that's an opportunity to have Bbox.corners return the structured ((x0, y0), (x1, y1)) whereas Bbox.extents currently returns the unstructured (x0, y0, x1, y1), but that's a secondary question.)

Note that unlike #22515 this doesn't really address the confusion that exists at the level of user-facing APIs; this issue is mostly about what we use internally.

Proposed solution

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions