-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
snkit has networkx as an optional dependency. If you don't have networkx, but try to use functions that require it, snkit tries to raise an import error. However, there are type hints in function signatures in network.py that use networkx and therefore when importing snkit without networkx, snkit fails on load with the following:
Python 3.10.14 | packaged by conda-forge | (main, Mar 20 2024, 12:45:18) [GCC 12.3.0] on linux
>>> import snkit
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/fred/micromamba/envs/jamaica-infrastructure/lib/python3.10/site-packages/snkit/__init__.py", line 7, in <module>
from snkit.network import Network
File "/home/fred/micromamba/envs/jamaica-infrastructure/lib/python3.10/site-packages/snkit/network.py", line 964, in <module>
) -> Union[nx.Graph, nx.DiGraph]:
NameError: name 'nx' is not defined. Did you mean: 'np'?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels