Skip to content

Commit

Permalink
Merge branch 'main' into cicd-improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
tushar1854 authored Jun 2, 2024
2 parents 9315eea + 99d2f8b commit 085aaca
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ name: Publish RetailTree Python package distribution to PyPI

on:
push:
paths:
- "setup.py"
branches:
- "main"


jobs:
build:
Expand Down
8 changes: 2 additions & 6 deletions retailtree/retailtree.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,13 @@ def build_tree(self, dist_func=euclidean):
def __get_neighbors_radius(self):
"""
Method to get the radius within which neighbors will be searched for.
If number of annotations is greater than 10, random annotations are considered.
Radius is the max of the diagonals of the annotations considered.
"""
radius = self.__neighbors_radius
if not radius:
annotation_bucket = list(self.annotations.values())
if len(annotation_bucket) > 10:
random_annotations = sample(annotation_bucket, 10)
else:
random_annotations = annotation_bucket

random_annotations = annotation_bucket
distance = [math.sqrt(pow(annotation.width, 2) + pow(
annotation.length, 2)) for annotation in random_annotations]
radius = max(distance)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def read(fname):

setup(
name="retailtree",
version="1.2",
version="1.3",
long_description=read("README.md"),
long_description_content_type='text/markdown',
packages=find_packages(),
Expand Down

0 comments on commit 085aaca

Please sign in to comment.