Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def accuracy(self):
return accuracy(
self.count_300,
self.count_100,
self.count_50,
self.count_miss,
)
)
od = self.od(
easy=easy,
hard_rock=hard_rock,
half_time=half_time,
double_time=double_time,
)
ar = self.ar(
easy=easy,
hard_rock=hard_rock,
half_time=half_time,
double_time=double_time,
)
accuracy_scaled = calculate_accuracy(
count_300,
count_100,
count_50,
count_miss,
)
accuracy = accuracy_scaled * 100
accuracy_bonus = 0.5 + accuracy_scaled / 2
count_hit_objects = len(self.hit_objects)
count_hit_objects_over_2000 = count_hit_objects / 2000
length_bonus = (
0.95 +
0.4 * np.minimum(1.0, count_hit_objects_over_2000) + (
np.log10(count_hit_objects_over_2000) * 0.5
if count_hit_objects > 2000 else
0
count_100 : np.ndarray[int]
The number of 100s.
count_50 : np.ndarray[int]
The number of 50s.
count_miss : np.ndarray[int]
The number of misses.
"""
if count_miss is None:
count_miss = np.full_like(accuracy, 0)
max_300 = len(self.hit_objects) - count_miss
accuracy = np.maximum(
0.0,
np.minimum(
calculate_accuracy(max_300, 0, 0, count_miss) * 100.0,
accuracy * 100,
),
)
count_50 = np.full_like(accuracy, 0)
count_100 = np.round(
-3.0 *
((accuracy * 0.01 - 1.0) * len(self.hit_objects) + count_miss) *
0.5,
)
mask = count_100 > len(self.hit_objects) - count_miss
count_100[mask] = 0
count_50[mask] = np.round(
-6.0 *
((accuracy[mask] * 0.01 - 1.0) * len(self.hit_objects) +
def accuracy(self):
"""The accuracy achieved in the replay in the range [0, 1].
"""
if self.mode != GameMode.standard:
raise NotImplementedError(
'accuracy for non osu!standard replays is not yet supported',
)
return accuracy(
self.count_300,
self.count_100,
self.count_50,
self.count_miss,
)