Skip to content

Commit 99d2f8b

Browse files
authored
Merge pull request #8 from ParallelDots/update-internal-logic
Fix: Update relative radius calculation logic
2 parents 7aa66ab + 5804e92 commit 99d2f8b

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

.github/workflows/workflow.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
name: Publish RetailTree Python package distribution to PyPI
22

33
on:
4+
push:
5+
branches:
6+
- main
47
workflow_run:
58
workflows: ["Run Tests"]
69
types:

retailtree/retailtree.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,17 +57,13 @@ def build_tree(self, dist_func=euclidean):
5757
def __get_neighbors_radius(self):
5858
"""
5959
Method to get the radius within which neighbors will be searched for.
60-
If number of annotations is greater than 10, random annotations are considered.
61-
6260
Radius is the max of the diagonals of the annotations considered.
6361
"""
6462
radius = self.__neighbors_radius
6563
if not radius:
6664
annotation_bucket = list(self.annotations.values())
67-
if len(annotation_bucket) > 10:
68-
random_annotations = sample(annotation_bucket, 10)
69-
else:
70-
random_annotations = annotation_bucket
65+
66+
random_annotations = annotation_bucket
7167
distance = [math.sqrt(pow(annotation.width, 2) + pow(
7268
annotation.length, 2)) for annotation in random_annotations]
7369
radius = max(distance)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ def read(fname):
99

1010
setup(
1111
name="retailtree",
12-
version="1.2",
12+
version="1.3",
1313
long_description=read("README.md"),
1414
long_description_content_type='text/markdown',
1515
packages=find_packages(),

0 commit comments

Comments
 (0)