-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
1,645 additions
and
9 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,17 @@ | ||
from decimal import Decimal | ||
from typing import List, Tuple | ||
|
||
from app.constants import LOW_UQ_SCORE, MAX_UQ_SCORE | ||
from app.infrastructure.database.uniqueness_quotient import get_all_uqs_by_epoch | ||
|
||
|
||
def calculate_uq(gp_score: float, uq_threshold: int) -> Decimal: | ||
if gp_score >= uq_threshold: | ||
return MAX_UQ_SCORE | ||
|
||
return LOW_UQ_SCORE | ||
|
||
|
||
def get_all_uqs(epoch_num: int) -> List[Tuple[str, Decimal]]: | ||
all_uqs = get_all_uqs_by_epoch(epoch_num) | ||
return [(uq.user.address, uq.validated_score) for uq in all_uqs] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.