Skip to content

fix: complete truncated ranking logic in set_rarity_ranks (closes #141)#149

Open
botbikamordehai2-sketch wants to merge 1 commit into
OpenRarity:mainfrom
botbikamordehai2-sketch:fix/issue-141-1779954404
Open

fix: complete truncated ranking logic in set_rarity_ranks (closes #141)#149
botbikamordehai2-sketch wants to merge 1 commit into
OpenRarity:mainfrom
botbikamordehai2-sketch:fix/issue-141-1779954404

Conversation

@botbikamordehai2-sketch

Copy link
Copy Markdown

What

The set_rarity_ranks method in rarity_ranker.py was truncated, missing the rank assignment logic inside the loop and the return statement.

Fix

  • When scores are equal (math.isclose), assign the same rank as the previous token
  • Otherwise, use i + 1 as the rank
  • Set token_rarity.rank = rank for each token
  • Return sorted_token_rarities

Closes #141

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Nowayout247

1 participant