Skip to content

Refactor: Move plot_venn into a dedicated VennComparisonReport class #209

Description

@dyrpsf

Problem or use case

I want to standardize the visualization logic for model comparisons because currently, the plot_venn function resides as a standalone function in analysis.comparison. As refineGEMs moves toward a more modular, object-oriented reporting architecture, leaving standalone plotting functions scattered across analysis modules creates architectural inconsistency and makes maintenance harder.

Proposed solution

Create a new VennComparisonReport class inside the classes.reports module. Migrate the plot_venn logic into this new class so that it perfectly aligns with the rest of the updated reporting architecture.

Affected area

  • Python API
  • Developer architecture
  • Command-line interface
  • Sphinx / Read the Docs documentation
  • Existing media workflow or media documentation
  • Tests
  • Packaging, installation, or optional dependencies

Example usage

from refinegems.classes.reports import VennComparisonReport

venn_report = VennComparisonReport(models=[model1, model2, model3])
venn_report.visualise()

Alternatives considered

We considered leaving plot_venn in its current location within analysis.comparison. While this avoids breaking changes in the short term, it leaves the reporting pipeline fragmented and prevents the reporting classes from being fully unified.

Compatibility considerations

This will affect existing APIs and workflows. Scripts that currently import plot_venn directly from analysis.comparison will experience a breaking change. To mitigate this, we can either leave a deprecation wrapper function in the old location that redirects to the new class, or simply note the breaking API change clearly in the documentation and release notes.

Additional context

This refactoring was explicitly discussed and agreed upon with @cb-Hades during the review and merge of PR #190

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions