Skip to content

ARCHITECTURAL: Split fortplot_figure_core.f90 into logical modules <500 lines each #624

@krystophny

Description

@krystophny

ARCHITECTURAL FOUNDATION ISSUE

ROOT CAUSE: 957-line monolithic module blocks code comprehension and team effectiveness

CURRENT STATE:

  • File: src/fortplot_figure_core.f90
  • Size: 957 lines (91% over 500-line target)
  • Impact: Team cannot comprehend or maintain this massive module

ARCHITECTURAL STRATEGY:
Split along logical functionality boundaries, not arbitrary line counts:

  1. Core Figure Management (~300 lines)

    • Figure initialization, state management
    • Basic properties and configuration
  2. Plotting Operations (~300 lines)

    • Plot methods, data handling
    • Coordinate transformations
  3. Rendering Pipeline (~300 lines)

    • Backend coordination, output generation
    • Format-specific rendering logic

SUCCESS CRITERIA:

  • All resulting modules <500 lines each
  • Logical separation of concerns maintained
  • No functionality regression (full test suite passes)
  • Clean module interfaces with minimal coupling
  • API compatibility preserved for users

VERIFICATION METHOD:

find src/ -name "fortplot_figure_*.f90" -exec wc -l {} \; | awk '{if($1>500) print "VIOLATION: " $2 " has " $1 " lines"}'

ARCHITECTURAL COACHING PRIORITY:
This task teaches team to think in terms of module boundaries and logical separation rather than just completing individual tasks.

MANDATORY: Must maintain backward compatibility - this is refactoring, not rewriting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions