Yeah this fixed it, but encounter a different issue when tried it with a larger graph…
Lets say:
edges = [(0, 1), (0, 2), (1, 2), (2, 0), (2, 3), (3, 3), (1, 4), (1, 5), (4, 8), (8, 9), (5, 7), (3, 6)]
graph = Graph(edges, 10)
the traceback is:
Traceback (most recent call last):
File "C:/Users/LiorAsis/projects/githubProjects/PythonNumba/main.py", line 260, in <module>
graphs_10()
File "C:/Users/LiorAsis/projects/githubProjects/PythonNumba/main.py", line 68, in graphs_10
graph_numba = GraphNumba(edges, 10)
File "C:\Users\LiorAsis\projects\githubProjects\PythonNumba\Graph.py", line 120, in __init__
self.adjList2.append(inner)
File "C:\Users\LiorAsis\anaconda3\envs\CPyConcurrent\lib\site-packages\numba\typed\typedlist.py", line 344, in append
_append(self, item)
File "C:\Users\LiorAsis\anaconda3\envs\CPyConcurrent\lib\site-packages\numba\core\dispatcher.py", line 482, in _compile_for_args
error_rewrite(e, 'typing')
File "C:\Users\LiorAsis\anaconda3\envs\CPyConcurrent\lib\site-packages\numba\core\dispatcher.py", line 423, in error_rewrite
raise e.with_traceback(None)
numba.core.errors.TypingError: Failed in nopython mode pipeline (step: nopython frontend)
- Resolution failure for literal arguments:
No implementation of function Function(<function impl_append at 0x0000017E59B4C3A0>) found for signature:
>>> impl_append(ListType[array(int32, 1d, C)], array(float64, 1d, C))
There are 2 candidate implementations:
- Of which 2 did not match due to:
Overload in function 'impl_append': File: numba\typed\listobject.py: Line 592.
With argument(s): '(ListType[array(int32, 1d, C)], array(float64, 1d, C))':
Rejected as the implementation raised a specific error:
AssertionError: Failed in nopython mode pipeline (step: native lowering)
raised from C:\Users\LiorAsis\anaconda3\envs\CPyConcurrent\lib\site-packages\numba\np\arrayobj.py:5283
- Resolution failure for non-literal arguments:
None
During: resolving callee type: BoundFunction((<class 'numba.core.types.containers.ListType'>, 'append') for ListType[array(int32, 1d, C)])
During: typing of call at C:\Users\LiorAsis\anaconda3\envs\CPyConcurrent\lib\site-packages\numba\typed\typedlist.py (83)
File "..\..\..\anaconda3\envs\CPyConcurrent\lib\site-packages\numba\typed\typedlist.py", line 83:
def _append(l, item):
l.append(item)
^
Process finished with exit code 1
Will try to debug it alone in the next few days.