Skip to content

Fix composition rendering broken by plotnine 0.15.x API changes#25

Merged
mdmanurung merged 2 commits into
mainfrom
copilot/fix-notebooks-github-actions-job
Jul 15, 2026
Merged

Fix composition rendering broken by plotnine 0.15.x API changes#25
mdmanurung merged 2 commits into
mainfrom
copilot/fix-notebooks-github-actions-job

Conversation

Copilot AI commented Jul 14, 2026

Copy link
Copy Markdown

The notebooks CI job fails because plotnine_extra's composition code calls two APIs removed/changed in plotnine 0.15.x: p9GridSpec.from_layout() (class method no longer exists) and theme._setup() (renamed to theme.setup(plot)).

Changes

  • composition/_compose.py_generate_gridspecs: Replace p9GridSpec.from_layout(self.layout, ...) with a direct constructor call using the layout's nrow, ncol, widths, and heights:
# Before (broken in 0.15.x):
self._sub_gridspec = p9GridSpec.from_layout(
    self.layout, figure=figure, nest_into=container_gs[0]
)

# After:
self._sub_gridspec = p9GridSpec(
    self.layout.nrow,
    self.layout.ncol,
    figure,
    width_ratios=self.layout.widths,
    height_ratios=self.layout.heights,
    nest_into=container_gs[0],
)
  • composition/_compose.pydraw: Replace theme._setup(figure, None, title, subtitle) with the current theme.setup(plot) API, using a SimpleNamespace mock that satisfies the interface (figure, axs, labels):
from types import SimpleNamespace
_mock_plot = SimpleNamespace(
    figure=self.figure,
    axs=[],
    labels={
        "title": self.annotation.title or "",
        "subtitle": self.annotation.subtitle or "",
    },
)
self.theme.setup(_mock_plot)

Copilot AI changed the title [WIP] Fix failing GitHub Actions job notebooks Fix composition rendering broken by plotnine 0.15.x API changes Jul 14, 2026
Copilot AI requested a review from mdmanurung July 14, 2026 21:22
@mdmanurung mdmanurung marked this pull request as ready for review July 15, 2026 08:34
@mdmanurung mdmanurung merged commit fcbd88f into main Jul 15, 2026
5 of 6 checks passed
@mdmanurung mdmanurung deleted the copilot/fix-notebooks-github-actions-job branch July 15, 2026 08:35
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.

2 participants