Skip to content

Commit

Permalink
updating backend.get_info
Browse files Browse the repository at this point in the history
  • Loading branch information
Schefflera-Arboricola committed Feb 15, 2024
1 parent 2207bfc commit 9c0f36d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions nx_parallel/utils/backend.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import nx_parallel.algorithms as algorithms
import inspect


__all__ = ["get_info"]
Expand All @@ -20,6 +21,13 @@ def get_funcs_info():
if callable(getattr(file_module, name, None))
]
for function in functions:
try:
func_line = inspect.getsourcelines(
getattr(file_module, function)
)[1]
except Exception as e:
print(e)
func_line = None
try:
# Extracting docstring
docstring = getattr(file_module, function).__doc__
Expand Down Expand Up @@ -55,8 +63,9 @@ def get_funcs_info():
par_docs = None

funcs[function] = {
"extra_docstring": par_docs,
"extra_parameters": par_params,
"backend_func_url": f"https://github.com/networkx/nx-parallel/blob/main/nx_parallel/algorithms/{file_name}.py#{func_line}",
"backend_func_docs": par_docs,
"additional_parameters": par_params,
}
return funcs

Expand Down

0 comments on commit 9c0f36d

Please sign in to comment.