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
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
from example_project.module.submodule import bar
bar()
pydeps example_project --reverse --rankdir BT generates the following graph:
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
The text was updated successfully, but these errors were encountered:
Hi @robinderat , and thank you for your interest in pydeps.
The behavior you're seeing is (at least partially) an artifact of how the python module system works. The statement from a.b import c imports and executes modules a and b. To see what is going on I've added some print statements to the different files in your example
Pydeps (must) traverse the modules on the path to check for other import statements, so the graph is technically correct, but I can see how the resulting graph is not maximally useful.
I'm not sure I know how to change pydeps to prune the graph correctly, but there should be enough information in the bytecode
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
main.py:
pydeps example_project --reverse --rankdir BT
generates the following graph: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
The text was updated successfully, but these errors were encountered: