Skip to content

feat(array_glyph): group facet parameters — PanelLabels + figure_size #281

Description

@MAfarrag

Context

Part of the grouped render-parameter refactor (branch `refactor/grouped-render-params`, PR #274). ArrayGlyph.facet
carried two separate coordinate-label sequences and a matplotlib-style figsize.

Problem / Current Behaviour

facet took col_coords and row_coords as two parallel arguments (pushing the signature over SonarCloud's
python:S107 parameter cap), and used figsize for the shared-figure size.

Affected locations

File Symbol Notes
src/cleopatra/glyphs/gridded/array_glyph.py PanelLabels (new) bundles col / row panel-title labels
src/cleopatra/glyphs/gridded/array_glyph.py ArrayGlyph.facet labels=PanelLabels(...), figsize -> figure_size

Motivation Example

from cleopatra.glyphs.gridded.array_glyph import ArrayGlyph, PanelLabels
glyph.facet(col="month", labels=PanelLabels(col=["Jan", "Feb", "Mar"]), figure_size=(12, 4))

Proposed Solution

Introduce PanelLabels(col=, row=) for the per-panel titles and rename figsize -> figure_size. Drops
facet back under the S107 parameter cap.

Out of Scope

Renaming the constructor-level figsize option (shared across the Glyph base and every glyph) — deliberately
left unchanged; facet(figure_size=) is currently inconsistent with ArrayGlyph(figsize=).

Effort Estimate

Size: S
Rationale: one small object plus a parameter rename in a single method.

Definition of Done

  • PanelLabels exists and facet consumes labels=
  • facet uses figure_size
  • tests cover titles / name_dicts / length mismatch / figure sizing
  • docstrings / docs updated
  • all existing tests continue to pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestfeaturepythonPull requests that update python code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions