Start upgrading grouping algorithm to be more performant in python
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import math
|
import math
|
||||||
|
import numpy as np
|
||||||
|
|
||||||
|
|
||||||
class Group:
|
class Group:
|
||||||
@@ -134,6 +135,17 @@ def calc_groups(scan):
|
|||||||
|
|
||||||
return allGroups
|
return allGroups
|
||||||
|
|
||||||
|
def calc_groups_edge_algorithm(scan):
|
||||||
|
"""
|
||||||
|
Calculates groups using an edge algorithm. This takes advantage of numpy arrays
|
||||||
|
and vectorisation, rather than the primitive python loop grouping, resulting in
|
||||||
|
faster grouping speeds.
|
||||||
|
"""
|
||||||
|
allGroups = []
|
||||||
|
scanArray = np.array(scan)
|
||||||
|
|
||||||
|
def edge_algorithm():
|
||||||
|
pass
|
||||||
|
|
||||||
def find_centre(group):
|
def find_centre(group):
|
||||||
"""
|
"""
|
||||||
|
|||||||
Reference in New Issue
Block a user