def test_relax_map(self):
        settings = StdScoreData.Settings()
        settings.neg_hit_miss_range = 100   # ms point of early miss window
        settings.neg_hit_range      = 100   # ms point of early hit window
        settings.pos_hit_range      = 100   # ms point of late hit window
        settings.pos_hit_miss_range = 100   # ms point of late miss window

        settings.require_tap_press   = False
        settings.require_tap_hold    = False
        settings.require_tap_release = False

        beatmap = BeatmapIO.open_beatmap('unit_tests/maps/osu/test/relax_map.osu')
        map_data = StdMapData.get_map_data(beatmap)

        replay = ReplayIO.open_replay('unit_tests/replays/osu/score_test/relax_map_fc.osr')
        replay_data = StdReplayData.get_replay_data(replay)
        score_data = StdScoreData.get_score_data(replay_data, map_data, settings)

        # No misses in this play
        self.assertTrue(not any(score_data['type'] == StdScoreData.TYPE_MISS))

        beatmap = BeatmapIO.open_beatmap('unit_tests/maps/osu/test/relax_map2.osu')
        map_data = StdMapData.get_map_data(beatmap)

        replay = ReplayIO.open_replay('unit_tests/replays/osu/score_test/relax_map2_fc.osr')
        replay_data = StdReplayData.get_replay_data(replay)
        score_data = StdScoreData.get_score_data(replay_data, map_data, settings)

        # This play has 1 miss aim
        miss_count = np.count_nonzero(score_data['type'].values == StdScoreData.TYPE_MISS)
        self.assertTrue(miss_count == 1)
    def test_nm_map(self):
        settings = StdScoreData.Settings()
        settings.neg_hit_miss_range = 100   # ms point of early miss window
        settings.neg_hit_range      = 100   # ms point of early hit window
        settings.pos_hit_range      = 100   # ms point of late hit window
        settings.pos_hit_miss_range = 100   # ms point of late miss window

        beatmap = BeatmapIO.open_beatmap('unit_tests/maps/osu/test/score_test_basic_AR8,OD5,CS2.osu')
        map_data = StdMapData.get_map_data(beatmap)

        # The map is SS'd in this replay
        replay = ReplayIO.open_replay('unit_tests/replays/osu/score_test_new/score_test_basic_AR8,OD5,CS2_7,1,0,0,0,0,100p.osr')
        replay_data = StdReplayData.get_replay_data(replay)
        score_data = StdScoreData.get_score_data(replay_data, map_data)

        offsets = score_data['map_t'] - score_data['replay_t']

        self.assertTrue(not any(score_data['type'] == StdScoreData.TYPE_MISS))
        self.assertTrue(all(abs(offsets) <= 50))
 def test_get_releases(self):
     map_data = StdMapData.get_map_data(self.beatmap)
     presses = StdMapData.get_releases(map_data)
 def test_get_num_hitobjects(self):
     map_data = StdMapData.get_map_data(self.beatmap)
     num_hitobjects = StdMapData.get_num_hitobjects(map_data)
 def test_get_map_data(self):
     map_data = StdMapData.get_map_data(self.beatmap)
 def test_end_times(self):
     map_data = StdMapData.get_map_data(self.beatmap)
     end_times = StdMapData.end_times(map_data)
 def test_start_times(self):
     map_data = StdMapData.get_map_data(self.beatmap)
     start_times = StdMapData.start_times(map_data)
    def test_time_slice(self):
        map_data = StdMapData.get_map_data(self.beatmap)
        map_data = StdMapData.time_slice(map_data, 1000, 2000, True)

        self.assertGreaterEqual(map_data['time'].values[0], 1000)
        self.assertLessEqual(map_data['time'].values[0], 2000)
 def setUpClass(cls):
     cls.beatmap = BeatmapIO.open_beatmap(
         'unit_tests\\maps\\osu\\test\\abraker - unknown (abraker) [250ms].osu'
     )
     cls.map_data = StdMapData.get_map_data(cls.beatmap)