Skip to content

pyreverse: Add option to show method names without signatures in UML diagrams #10772

@drbenvincent

Description

@drbenvincent

Current problem

When generating UML class diagrams with pyreverse, the class boxes include full method signatures with all parameters. For projects with methods that have many parameters or long type annotations, this creates very wide class boxes that make the diagrams difficult to read and require excessive horizontal space.

Currently, the available options are:

  • Show full method signatures (default behavior)
  • Hide methods entirely using --only-classnames / -k

There is no middle-ground option to display method names without their parameter signatures.

Desired solution

Add a new option (e.g., --no-signatures or --hide-signatures) that displays method names in the class boxes but omits their parameter lists and return type annotations.

For example, instead of:

+ fit(X: DataFrame, y: Series, coords: dict[str, list]) -> Self
+ predict(X: DataFrame) -> DataArray

The diagram would show:

+ fit()
+ predict()

This would provide a useful middle-ground between full verbosity and completely hiding methods, making diagrams more readable while still conveying the class interface at a high level.

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Enhancement ✨Improvement to a componentNeeds PRThis issue is accepted, sufficiently specified and now needs an implementationpyreverseRelated to pyreverse component

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions