You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Pyreverse: Aggregations aren't filtered according to filter mode (PUB_ONLY, etc.) #10373
When using Pyreverse with filter modes like PUB_ONLY, relationships between classes (arrows in diagrams) are still shown even when the attributes themselves are filtered out due to visibility settings.
For example, with this code:
classP:
passclassA:
x: P=P()
classB:
__x: P=P()
And running with default settings (PUB_ONLY), the diagram shows:
classDiagram
class A {
x
}
class B {
}
class P {
}
P --* A : x
P --* B : __x
Now __x is correctly filtered out from class B's attributes due to being private, but the relationship arrow P --* B : __x is still displayed.
When using --filter-mode=ALL, both attributes and relationships are shown correctly:
classDiagram
class A {
x
}
class B {
__x
}
class P {
}
P --* A : x
P --* B : __x
The relationships (arrows) should be filtered according to the same visibility rules as attributes for consistency.
I’m working on a fix for the issue where aggregations and associations aren’t being filtered according to the selected filter mode (PUB_ONLY, ALL, etc.) in Pyreverse.
To fix this, I added a check in the extract_relationships() method to filter out aggregations and associations based on visibility before adding them to the diagram. I used self.show_attr(name) to handle this filtering.
Before I submit a PR, I wanted to check if this is the right approach. Does this look good, or is there something else I should consider for filtering these relationships based on the filter mode?
Activity
pavan-msys commentedon May 14, 2025
Hi @Julfried
I’m working on a fix for the issue where aggregations and associations aren’t being filtered according to the selected filter mode (PUB_ONLY, ALL, etc.) in Pyreverse.
To fix this, I added a check in the extract_relationships() method to filter out aggregations and associations based on visibility before adding them to the diagram. I used
self.show_attr(name)to handle this filtering.Before I submit a PR, I wanted to check if this is the right approach. Does this look good, or is there something else I should consider for filtering these relationships based on the filter mode?
chore(deps): update dependency pylint to v4 (#302)
chore(deps): update root dev dependencies (minor) (minor)
Merge branch 'renovate/root-dev-dependencies' into 'main'