Skip to content

Commit

Permalink
Fix docstrings of dispatchable functions (#7679)
Browse files Browse the repository at this point in the history
  • Loading branch information
eriknw authored Oct 15, 2024
1 parent c107d25 commit 2f45b4d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 4 additions & 5 deletions networkx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@
from networkx import utils
from networkx.utils import _clear_cache, _dispatchable

# load_and_call entry_points, set configs
config = utils.backends._set_configs_from_environment()
utils.config = utils.configs.config = config # type: ignore[attr-defined]

from networkx import classes
from networkx.classes import filters
from networkx.classes import *
Expand Down Expand Up @@ -47,8 +51,3 @@

from networkx import drawing
from networkx.drawing import *


# load_and_call entry_points, set configs
config = utils.backends._set_configs_from_environment()
utils.config = utils.configs.config = config # type: ignore[attr-defined]
2 changes: 2 additions & 0 deletions networkx/utils/backends.py
Original file line number Diff line number Diff line change
Expand Up @@ -2310,6 +2310,8 @@ def _make_doc(self):

lines.pop() # Remove last empty line
to_add = "\n ".join(lines)
if not self._orig_doc:
return f"The original docstring for {self.name} was empty.\n\n {to_add}"
return f"{self._orig_doc.rstrip()}\n\n {to_add}"

def __reduce__(self):
Expand Down

0 comments on commit 2f45b4d

Please sign in to comment.