Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option to output the number of unique dependency #386

Open
MarcBresson opened this issue Jul 1, 2024 · 2 comments
Open

Add option to output the number of unique dependency #386

MarcBresson opened this issue Jul 1, 2024 · 2 comments

Comments

@MarcBresson
Copy link

Describe the feature

This would give the number of library we could lose if we delete one dependency. For instance:

captum==0.7.0 (unique, 10 unique dependencies)
├── matplotlib [required: Any, installed: 3.8.4] (unique, 6 unique dependencies)
│   ├── contourpy [required: >=1.0.1, installed: 1.2.1] (unique)
│   │   └── numpy [required: >=1.20, installed: 1.24.4]
│   ├── cycler [required: >=0.10, installed: 0.12.1] (unique)
│   ├── fonttools [required: >=4.22.0, installed: 4.53.0] (unique)
│   ├── kiwisolver [required: >=1.3.1, installed: 1.4.5] (unique)
│   ├── numpy [required: >=1.21, installed: 1.24.4]
│   ├── packaging [required: >=20.0, installed: 24.1]
│   ├── Pillow [required: >=8, installed: 9.5.0] (unique)
│   ├── pyparsing [required: >=2.3.1, installed: 3.1.2] (unique)
│   └── python-dateutil [required: >=2.7, installed: 2.9.0.post0]
│       └── six [required: >=1.5, installed: 1.16.0]
├── numpy [required: Any, installed: 1.24.4]
├── torch [required: >=1.6, installed: 1.13.0] (unique, 1 unique dependency)
│   └── typing_extensions [required: Any, installed: 4.12.2] (unique)
└── tqdm [required: Any, installed: 4.66.4] (unique)
category-encoders==2.6.0 (unique, 8 unique dependencies)  # patsy, pytz, pandas, scipy are only defined in this one
├── numpy [required: >=1.14.0, installed: 1.24.4]
├── pandas [required: >=1.0.5, installed: 1.5.3]
│   ├── numpy [required: >=1.21.0, installed: 1.24.4]
│   ├── python-dateutil [required: >=2.8.1, installed: 2.9.0.post0]
│   │   └── six [required: >=1.5, installed: 1.16.0]
│   └── pytz [required: >=2020.1, installed: 2024.1]
├── patsy [required: >=0.5.1, installed: 0.5.6]
│   ├── numpy [required: >=1.4, installed: 1.24.4]
│   └── six [required: Any, installed: 1.16.0]
├── scikit-learn [required: >=0.20.0, installed: 1.1.3] (unique, 2 unique dependencies)
│   ├── joblib [required: >=1.0.0, installed: 1.2.0] (unique)
│   ├── numpy [required: >=1.17.3, installed: 1.24.4]
│   ├── scipy [required: >=1.3.2, installed: 1.8.1]
│   │   └── numpy [required: >=1.17.3,<1.25.0, installed: 1.24.4]
│   └── threadpoolctl [required: >=2.0.0, installed: 3.5.0] (unique)
├── scipy [required: >=1.0.0, installed: 1.8.1]
│   └── numpy [required: >=1.17.3,<1.25.0, installed: 1.24.4]
└── statsmodels [required: >=0.9.0, installed: 0.14.2] (unique)
    ├── numpy [required: >=1.22.3, installed: 1.24.4]
    ├── packaging [required: >=21.3, installed: 24.1]
    ├── pandas [required: >=1.4,!=2.1.0, installed: 1.5.3]
    │   ├── numpy [required: >=1.21.0, installed: 1.24.4]
    │   ├── python-dateutil [required: >=2.8.1, installed: 2.9.0.post0]
    │   │   └── six [required: >=1.5, installed: 1.16.0]
    │   └── pytz [required: >=2020.1, installed: 2024.1]
    ├── patsy [required: >=0.5.6, installed: 0.5.6]
    │   ├── numpy [required: >=1.4, installed: 1.24.4]
    │   └── six [required: Any, installed: 1.16.0]
    └── scipy [required: >=1.8,!=1.9.2, installed: 1.8.1]
        └── numpy [required: >=1.17.3,<1.25.0, installed: 1.24.4]

It can be simply calculated : at each node, we take the set of libraries under the node and we subtract it to the set of libraries in the other nodes. The difference in length between the result of the operation and the length of the set of libraries under the node gives the number of unique dependencies.

@MarcBresson MarcBresson added enhancement tobeconfirmed To be confirmed after more investigation labels Jul 1, 2024
@kemzeb
Copy link
Collaborator

kemzeb commented Jul 5, 2024

I wouldn't have a problem with this.

@kemzeb kemzeb added help-wanted and removed tobeconfirmed To be confirmed after more investigation labels Jul 5, 2024
@siddarth-patil
Copy link

Hi, I can help with this. Can this issue be assigned to me, please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants