Skip to content

html_report: place repeat_group as the repeat level (#642) - #643

Merged
guijacquemet merged 1 commit into
mainfrom
claude/repeat-group-figure-642
Nov 23, 2026
Merged

guijacquemet merged 1 commit into
mainfrom
claude/repeat-group-figure-642

Conversation

@guijacquemet

Copy link
Copy Markdown
Contributor

Fixes #642

Problem

html_report (through plots and plots_of_data) raised ValueError: group_cols [...] hold ['repeat_group'], which the figure does not place when given group_cols=("condition", "repeat_group"). Those are the groups MorphoFeature's end-to-end notebook passes in section 4 (default_groups). As a result, the coverage page failed on every run that has repeat groups.

Design

  • One shared notion of "the repeat column": _repeat_groups.repeat_level(group_cols) returns repeat_group when the analysis groups name it, else biological_repeat (the current behaviour). Every place in the figure and HTML code that hard-coded biological_repeat as the repeat level now reads it:

    • plots._layout places the level, labelled by its values. With repeat_col=None it pools the level on request.
    • plots_pairwise.pairwise_contrasts pairs by the level.
    • _html_plotly._observations (the interactive copy of the figure) reads it.
    • _plots_text names repeat_group as "biological repeat", the same as biological_repeat.

    The clusters' output key stays biological_repeat (the level's name in cluster_summaries, the CSVs and the page's script).

  • Both columns in group_cols: refused with a ValueError that names the fix (leave biological_repeat out). A figure has one repeat level, and keeping the folder label apart beside the repeat group would split or pair repeats by folder label. Nothing falls back to biological_repeat without a word.

  • The biological_repeat path is unchanged. Inside the workflows, the tables are already paired by repeat group (BLOCKER: confirmed biological-repeat pairing is lost; contrasts pair by folder label #617), so ("condition", "biological_repeat") and ("condition", "repeat_group") draw the same clusters and the same numbers (tested).

  • The remaining biological_repeat references in the HTML code work on report results (on paired tables) or on the user's own table metadata. None of them is the figure's repeat level, so they are unchanged.

Tests (tests/test_figure_repeat_level.py, 9 tests)

  • repeat_level covers its three cases plus the refusal when both columns are given.
  • plots_of_data with ("condition", "repeat_group") on crossed folder labels: clusters G1–G3, and each cluster holds its group's cells (drug G1 is folder r3).
  • repeat_col=None pools the repeat groups.
  • The biological_repeat path is unchanged, both with explicit group_cols and with none.
  • Both columns are refused by plots_of_data, by pairwise_contrasts and by html_report.
  • The pairwise matrix pairs repeat groups that share no folder label (3 shared repeats; main gives 0).
  • html_report with ("condition", "repeat_group") on tables where folder labels and repeat groups differ: the page is written, the clusters and hover labels show G1–G3, and the clusters and pairwise matrix are identical to the biological_repeat path.
  • The MorphoFeature notebook's section 4 calls are mirrored (MorphoFeature 70d4753): the widget defaults and default_groups, then report and html_report into <output>/report.

Regression proof: on main (209b9be), 8 of the 9 tests fail. Five fail with the original ValueError, two because of the refusal message, one with [0] == [3] shared repeats, and one with an ImportError (repeat_level does not exist on main). Only test_the_biological_repeat_path_is_unchanged passes on main.

Docs: docs/report/figures.md and CHANGELOG.md are updated, and the function index is regenerated.

#640 (the workflows example notebook) is out of scope and left as is.


Generated by Claude Code

html_report, plots and plots_of_data refused group_cols=("condition",
"repeat_group"), the groups MorphoFeature's end-to-end notebook passes
(section 4), with "group_cols [...] hold ['repeat_group'], which the figure
does not place", so the coverage page failed on every run with repeat
groups.

One shared notion of the figures' biological-repeat level,
_repeat_groups.repeat_level(group_cols): repeat_group when the analysis
groups name it, else biological_repeat; both are refused, since a figure
has one repeat level and keeping the folder label apart beside the repeat
group would split or pair repeats by folder. plots._layout places it (and
pools it with repeat_col=None), the pairwise matrix pairs by it, the HTML
report's interactive figure reads it and the figure's words name it as a
biological repeat. Nothing falls back to biological_repeat; the
biological_repeat path is unchanged.

Fixes #642

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3qp9AxjpGPw9xfWAUJNqc
@guijacquemet
guijacquemet marked this pull request as ready for review November 23, 2026 19:35
@guijacquemet
guijacquemet merged commit c25c4e9 into main Nov 23, 2026
2 checks passed
@guijacquemet
guijacquemet deleted the claude/repeat-group-figure-642 branch November 23, 2026 19: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.

html_report refuses group_cols containing repeat_group ("which the figure does not place")

2 participants