__init__.py 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. """
  2. NetworkX
  3. ========
  4. NetworkX is a Python package for the creation, manipulation, and study of the
  5. structure, dynamics, and functions of complex networks.
  6. See https://networkx.org for complete documentation.
  7. """
  8. __version__ = "3.6.1"
  9. # These are imported in order as listed
  10. from networkx.lazy_imports import _lazy_import
  11. from networkx.exception import *
  12. from networkx import utils
  13. from networkx.utils import _clear_cache, _dispatchable
  14. # load_and_call entry_points, set configs
  15. config = utils.backends._set_configs_from_environment()
  16. utils.config = utils.configs.config = config # type: ignore[attr-defined]
  17. from networkx import classes
  18. from networkx.classes import filters
  19. from networkx.classes import *
  20. from networkx import convert
  21. from networkx.convert import *
  22. from networkx import convert_matrix
  23. from networkx.convert_matrix import *
  24. from networkx import relabel
  25. from networkx.relabel import *
  26. from networkx import generators
  27. from networkx.generators import *
  28. from networkx import readwrite
  29. from networkx.readwrite import *
  30. # Need to test with SciPy, when available
  31. from networkx import algorithms
  32. from networkx.algorithms import *
  33. from networkx import linalg
  34. from networkx.linalg import *
  35. from networkx import drawing
  36. from networkx.drawing import *
  37. def __getattr__(name):
  38. if name == "random_tree":
  39. raise AttributeError(
  40. "nx.random_tree was removed in version 3.4. Use `nx.random_labeled_tree` instead.\n"
  41. "See: https://networkx.org/documentation/latest/release/release_3.4.html"
  42. )
  43. raise AttributeError(f"module 'networkx' has no attribute '{name}'")