Skip to content

Commit

Permalink
Fix both acc and judgements specified
Browse files Browse the repository at this point in the history
  • Loading branch information
minisbett authored and cmyui committed Feb 26, 2024
1 parent d570e77 commit 5bcbbbe
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
2 changes: 0 additions & 2 deletions app/objects/score.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,6 @@ def calculate_performance(self, beatmap_id: int) -> tuple[float, float]:
mode=mode_vn,
mods=int(self.mods),
combo=self.max_combo,
# prefer to use the score's specific params that add up to the acc
acc=self.acc,
ngeki=self.ngeki,
n300=self.n300,
nkatu=self.nkatu,
Expand Down
12 changes: 2 additions & 10 deletions app/usecases/performance.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,8 @@ def calculate_performances(
results: list[PerformanceResult] = []

for score in scores:
# assert either acc OR 300/100/50/geki/katu/miss is present, but not both
# if (score.acc is None) == (
# score.n300 is None
# and score.n100 is None
# and score.n50 is None
# and score.ngeki is None
# and score.nkatu is None
# and score.nmiss is None
# ):
# raise ValueError("Either acc OR 300/100/50/geki/katu/miss must be present")
if score.acc and (score.ngeki or score.nkatu or score.n50 or score.n100):
raise ValueError("Must not specify both accuracy and geki/katu/50s/100s.")

# rosupp ignores NC and requires DT
if score.mods is not None:
Expand Down
1 change: 0 additions & 1 deletion tools/recalc.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ async def recalculate_score(
calculator = Calculator(
mode=GameMode(score["mode"]).as_vanilla,
mods=score["mods"],
acc=score["acc"],
combo=score["max_combo"],
n_geki=score["ngeki"], # Mania 320s
n300=score["n300"],
Expand Down

0 comments on commit 5bcbbbe

Please sign in to comment.