-
Notifications
You must be signed in to change notification settings - Fork 1
Built in Functions
This tutorial lists all the built-in functions available in the Embedded console.
open_beatmap(beatmap_filepath)
- Opens and loads specified beatmap file
load_beatmap(beatmap_data)
- Loads provided beatmap data
open_replay(replay_filepath)
- Opens and loads specified replay file
load_beatmap(replay_data)
- Loads provided replay data
get_beatmap()
- Returns a beatmap object of the currently loaded beatmap
get_replays()
- Returns a list of data for currently loaded replays
add_layer_2d_data(name, data_2d)
- Creates a scatter plot layer named name
over the map view
add_graph_2d_data(name, data_2d, temporal, plot_type)
- Creates a graph for data in the graph tab
timeline
- Access to the timeline gui object
CmdUtils.threaded(func, args)
- Runs function func(args)
in a separate thread which won't block the GUI while it's running
CmdUtils.print_numbered_list(lst)
- Takes a list of strings and numbers them
CmdUtils.export_csv(name, data)
- Exports 2D numpy data into csv file
CmdOnline.get_latest_beatmapsets(gamemode, status)
- Gets a list of WebBeatmapset objects representing the latest beatmapsets in with the specified MapStatus in GameMode.
CmdOnline.get_scores(beatmap_id, mode, name)
- Gets a list of WebScore objects representing the top 50 replays for the specified beatmap id in GameMode. Name is the name of the map.
CmdOnline.get_scores_from_beatmap(beatmap)
- Provided a Beatmap object, gets a list of WebScore objects representing the top 50 replays
CmdOsu.open_replay_file(replay_filepath)
- Opens a replay file and returns a Replay object
CmdOsu.save_web_beatmaps(web_beatmaps)
- Given a list of WebBeatmap objects, downloads all the maps into a folder tmp/beatmaps/
CmdOsu.save_web_replays(web_replays)
- Given a list of WebScore objects, downloads all the replays into a folder tmp/replays/
CmdOsu.show_cursor_hit_offset_histogram(score_data, beatmap)
- Given score data and Beatmap object, displays a histogram of distance of hits from center of hitcircles.
CmdOsu.create_score_offset_graph(replay_data)
- Creates a scatter plot of hit offsets from 0ms in the graphs tab
CmdOsu.create_cursor_velocity_graph(replay_data)
- Crates a line graph of cursor velocity over time in the graphs tab
CmdOsu.create_cursor_acceleration_graph(replay_data)
- Crates a line graph of cursor acceleration over time in the graphs tab
CmdOsu.create_cursor_jerk_graph(replay_data)
- Crates a line graph of cursor jerk over time in the graphs tab
StdMapData.get_aimpoint_data(std_hitobject)
- Converts beatmap data into raw aimpoint data. Format of the data is the following numpy array structure:
[
[
[ time, pos ],
[ time, pos ],
... N score points
],
[
[ time, pos ],
[ time, pos ],
... N score points
],
... N hitobjects
]
StdMapData.get_data_before(hitobject_data, time)
-
StdMapData.get_data_after(hitobject_data, time)
-
StdMapData.time_slice(hitobject_data, start_time, end_time)
-
StdMapData.start_times(hitobject_data)
-
StdMapData.end_times(hitobject_data)
-
StdMapData.start_positions(hitobject_data)
-
StdMapData.end_positions(hitobject_data)
-
StdMapData.all_positions(hitobject_data, flat=True)
-
StdMapData.all_times(hitobject_data, flat=True)
-
StdMapData.start_end_times(hitobject_data)
-
StdMapData.get_idx_start_time(hitobject_data, time)
-
StdMapData.get_idx_end_time(hitobject_data, time)
-
StdMapMetrics.calc_tapping_intervals(hitobject_data)
-
StdMapMetrics.calc_notes_per_sec(hitobject_data)
-
StdMapMetrics.calc_distances(hitobject_data)
-
StdMapMetrics.calc_velocity(hitobject_data)
-
StdMapMetrics.calc_velocity_start(hitobject_data)
-
StdMapMetrics.calc_intensity(hitobject_data)
-
StdMapMetrics.calc_angles(hitobject_data)
-
StdMapMetrics.calc_xy_vel(hitobject_data)
-
StdMapMetrics.calc_perp_int(hitobject_data)
-
StdMapMetrics.calc_lin_int(hitobject_data)
-
StdReplayData.get_event_data(replay_events)
- Given replay event data from the Replay object, returns replay data with the following structure:
[
[ time, x_pos, y_pos, m1, m2, k1, k2, smoke ],
[ time, x_pos, y_pos, m1, m2, k1, k2, smoke ],
[ time, x_pos, y_pos, m1, m2, k1, k2, smoke ],
... N events
]
StdReplayData.press_start_times(replay_data, key=None)
- Returns:
[ press_start_idxs, press_start_times ] = [ [ int, int, ... ], [ int, int, ... ] ]
Tuple with indices in event_data where a press ends and timings where press ends. press_start_idxs can be used on original event_data to get full data related to start times like so: event_data[press_start_idxs]
StdReplayData.press_end_times(replay_data, key=None)
- Returns:
[ press_end_idxs, press_end_times ] = [ [ int, int, ... ], [ int, int, ... ] ]
Tuple with indices in event_data where a press ends and timings where press ends. press_end_idxs can be used on original event_data to get full data related to end times like so: event_data[press_end_idxs]
StdReplayData.press_start_end_times(replay_data, key=None)
-
[
[ press_start_idx, press_start_time, press_end_idx, press_end_time ],
[ press_start_idx, press_start_time, press_end_idx, press_end_time ],
...
]
StdReplayData.get_idx_time(replay_data, time)
-
StdReplayData.get_idx_press_start_time(replay_data, time, key=None)
-
StdReplayData.get_idx_press_end_time(replay_data, time, key=None)
-
StdReplayMetrics.cursor_velocity(replay_data)
-
StdReplayMetrics.cursor_acceleration(replay_data)
-
StdReplayMetrics.cursor_jerk(replay_data)
-
StdReplayMetrics.cursor_vel_xy(replay_data)
-
StdReplayMetrics.cursor_accel_xy(replay_data)
-
StdReplayMetrics.cursor_jerk_xy(replay_data)
-
StdReplayMetrics.press_intervals(replay_data)
-
StdScoreData.get_score_data(replay_data, map_data)
-
[
[ time, (cursor_pos_x, cursor_pos_y), hit_offset, (pos_offset_x, pos_offset_y), hitobject_idx ],
[ time, (cursor_pos_x, cursor_pos_y), hit_offset, (pos_offset_x, pos_offset_y), hitobject_idx ],
[ time, (cursor_pos_x, cursor_pos_y), hit_offset, (pos_offset_x, pos_offset_y), hitobject_idx ],
... N events
]
StdScoreData.tap_offset_mean(score_data)
-
StdScoreData.tap_offset_var(score_data)
-
StdScoreData.tap_offset_stdev(score_data)
-
StdScoreData.cursor_pos_offset_mean(score_data)
-
StdScoreData.cursor_pos_offset_var(score_data)
-
StdScoreData.cursor_pos_offset_stdev(score_data)
-
StdScoreData.odds_some_tap_within(score_data, offset)
- Creates a gaussian distribution model using avg and var of tap offsets and calculates the odds that some hit is within the specified offset
Returns: probability one random value [X] is between -offset <= X <= offset
TL;DR: look at all the hits for scores; What are the odds of you picking a random hit that is between -offset and offset?
StdScoreData.odds_some_cursor_within(score_data, offset)
- Creates a 2D gaussian distribution model using avg and var of cursor 2D position offsets and uses it to calculates the odds that some cursor position is within the specified distance from the center of any hitobject
Returns: probability one random value [X, Y] is between (-offset, -offset) <= (X, Y) <= (offset, offset)
TL;DR: look at all the cursor positions for score; What are the odds of you picking a random hit that has a cursor position between an area of (-offset, -offset) and (offset, offset)?
StdScoreData.odds_all_tap_within(score_data, offset)
- Creates a gaussian distribution model using avg and var of tap offsets and calculates the odds that all hits are within the specified offset
Returns: probability all random values [X] are between -offset <= X <= offset
TL;DR: look at all the hits for scores; What are the odds all of them are between -offset and offset?
StdScoreData.odds_all_cursor_within(score_data, offset)
- Creates a 2D gaussian distribution model using avg and var of cursor 2D position offsets and uses it to calculates the odds that all cursor positions are within the specified distance from the center of all hitobject
Returns: probability all random values {[X, Y], ...} are between (-offset, -offset) <= (X, Y) <= (offset, offset)
TL;DR: look at all the cursor positions for score; What are the odds all of them are between an area of (-offset, -offset) and (offset, offset)?
StdScoreData.odds_all_conditions_within(score_data, tap_offset, cursor_offset)
- Creates gaussian distribution models using tap offsets and cursor offsets for hits. That is used to calculate the odds of the player consistently tapping and aiming within those boundaries for the entire play. Be weary of survivorship bias.
StdScoreMetrics.get_per_hitobject_score_data(score_data_array)
- Takes arrays of score data pertaining to various players and transposes it to be an array of per-hitobject score data from various players
[
[
a0 [ time, (cursor_pos_x, cursor_pos_y), hit_offset, (pos_offset_x, pos_offset_y), hitobject_idx ],
a2 [ time, (cursor_pos_x, cursor_pos_y), hit_offset, (pos_offset_x, pos_offset_y), hitobject_idx ],
aN ... N events
],
[
b0 [ time, (cursor_pos_x, cursor_pos_y), hit_offset, (pos_offset_x, pos_offset_y), hitobject_idx ],
b1 [ time, (cursor_pos_x, cursor_pos_y), hit_offset, (pos_offset_x, pos_offset_y), hitobject_idx ],
bN ... N events
],
...
]
gets turned into
[
[
a0 [ time, (cursor_pos_x, cursor_pos_y), hit_offset, (pos_offset_x, pos_offset_y), hitobject_idx ],
b0 [ time, (cursor_pos_x, cursor_pos_y), hit_offset, (pos_offset_x, pos_offset_y), hitobject_idx ],
N0 ... N events
],
[
a1 [ time, (cursor_pos_x, cursor_pos_y), hit_offset, (pos_offset_x, pos_offset_y), hitobject_idx ],
b1 [ time, (cursor_pos_x, cursor_pos_y), hit_offset, (pos_offset_x, pos_offset_y), hitobject_idx ],
N1 ... N events
],
...
]
StdScoreMetrics.get_percent_below_offset(per_hitobject_score_data, hitobject_idx, offset)
-
StdScoreMetrics.trans_percent_players_taps(per_hitobject_score_data, offset)
- Gives the percent of players tapping within the specified offset for each hitobject
StdScoreMetrics.solve_for_hit_offset(per_hitobject_score_data, hitobject_idx, target_percent)
- Solves for the tapping offset for the note that 50% of players are able to do
StdScoreMetrics.trans_solve_for_hit_offset(per_hitobject_score_data)
- Solves for the tapping offset for the note that 50% of players are able to do
ManiaMapData.get_hitobject_data(hitobjects)
-
ManiaMapData.start_times(hitobject_data, column=None)
-
ManiaMapData.end_times(hitobject_data, column=None)
-
ManiaMapData.all_times(flat=True)
-
ManiaMapData.start_end_times(hitobject_data, column)
-
ManiaMapData.get_idx_start_time(hitobject_data, column, time)
-
ManiaMapData.get_idx_end_time(hitobject_data, column, time)
-
ManiaMapMetrics.calc_tapping_intervals(hitobject_data, column)
-
ManiaMapMetrics.calc_notes_per_sec(hitobject_data, column=None)
-
ManiaReplayData.get_replay_data(replay_events, columns)
-
ManiaReplayData.start_times(event_data, column)
-
ManiaReplayData.end_times(event_data, column)
-
ManiaReplayData.all_times(flat=True)
-
ManiaReplayData.start_end_times(event_data, column)
-
ManiaReplayData.get_idx_start_time(event_data, column, time)
-
ManiaReplayData.get_idx_end_time(event_data, column, time)
-
ManiaScoreData.get_score_data(replay_data, map_data)
-
ManiaScoreData.tap_offset_mean(score_data)
-
ManiaScoreData.tap_offset_var(score_data)
-
ManiaScoreData.tap_offset_stdev(score_data)
-
ManiaScoreData.model_offset_prob(mean, stdev, offset)
-
ManiaScoreData.odds_some_tap_within(score_data, offset)
-
ManiaScoreData.odds_all_tap_within(score_data, offset)
-
ManiaScoreData.odds_all_tap_within_trials(score_data, offset, trials)
-
ManiaScoreData.model_ideal_acc(mean, stdev, num_notes, score_point_judgements=None)
-
ManiaScoreData.model_ideal_acc_data(score_data, score_point_judgements=None)
-
ManiaScoreData.model_num_hits(mean, stdev, num_notes)
-