pydeps icon indicating copy to clipboard operation
pydeps copied to clipboard

Option to ignore modules in the graph

Open robinderat opened this issue 1 year ago • 1 comments

I have a pretty complex project with many modules and I would like to use pydeps to understand the structure of the code better. However, currently, pydeps is including all modules in the graph, even if they are not imported directly, making it very chaotic and hard to understand.

I would like to have an option to filter out modules that are not directly referenced.

I created a small example project to describe my case

example-project
└── example_project
    ├── __init__.py
    ├── main.py
    └── module
        ├── __init__.py
        └── submodule.py

main.py:

from example_project.module.submodule import bar

bar()

pydeps example_project --reverse --rankdir BT generates the following graph:

example_project

What I would like to see is only 2 nodes and 1 edge, from main to submodule. The edge between main and module only creates confusion, because I would only expect to see it if I had a line like from example_project import module

robinderat avatar Aug 12 '24 08:08 robinderat