Skip to content

Commit

Permalink
Modify use of sparse array (using lil_array instead of csr_array)
Browse files Browse the repository at this point in the history
  • Loading branch information
justinefricou committed Jun 12, 2024
1 parent 337eaad commit db85caf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions geotrek/core/path_router.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import numpy as np
from scipy.sparse.csgraph import dijkstra
from scipy.sparse import csr_array
from scipy.sparse import lil_array

from geotrek.common.utils import sqlfunction
from .models import Path
Expand Down Expand Up @@ -111,7 +111,7 @@ def set_cs_graph(self):
return

nb_of_nodes = len(self.nodes)
self.dijk_matrix = csr_array((nb_of_nodes, nb_of_nodes), dtype=np.float32)
self.dijk_matrix = lil_array((nb_of_nodes, nb_of_nodes), dtype=np.float32)

nodes_list = list(self.nodes.items())
for i, (key1, value1) in enumerate(nodes_list[:-1]):
Expand Down

0 comments on commit db85caf

Please sign in to comment.