Skip to content

Commit b2e8ea6

Browse files
committed
MAINT: Rework master to main throughout
1 parent edd0630 commit b2e8ea6

22 files changed

+143
-143
lines changed

.github/workflows/pre-commit.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: pre-commit
33
on:
44
pull_request:
55
push:
6-
branches: [master]
6+
branches: [main]
77

88
concurrency:
99
group: ${{ github.workflow }}-${{ github.ref }}

asv.conf.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
// project being benchmarked
1414
"repo": ".",
1515

16-
// List of branches to benchmark. If not provided, defaults to "master"
16+
// List of branches to benchmark. If not provided, defaults to "main"
1717
// (for git) or "default" (for mercurial).
18-
"branches": ["master"],
18+
"branches": ["main"],
1919

2020
// The DVCS being used. If not set, it will be automatically
2121
// determined from "repo" by looking at the protocol in the URL

asv/commands/profiling.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def run(cls, conf, benchmark, revision=None, gui=None, output=None,
169169
if env.python != "{0}.{1}".format(*sys.version_info[:2]):
170170
raise util.UserError(
171171
"Profiles must be run in the same version of Python as the "
172-
"asv master process")
172+
"asv main process")
173173

174174
benchmarks = Benchmarks.discover(conf, repo, environments,
175175
[commit_hash],

asv/commands/run.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ def setup_arguments(cls, subparsers):
5959
Run a benchmark suite.
6060
6161
examples:
62-
asv run master run for one branch
63-
asv run master^! run for one commit (git)
64-
asv run "--merges master" run for only merge commits (git)
62+
asv run main run for one branch
63+
asv run main^! run for one commit (git)
64+
asv run "--merges main" run for only merge commits (git)
6565
"""))
6666

6767
cls._setup_arguments(parser)

asv/repo.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ def get_new_range_spec(self, latest_result, branch=None):
9595
"""
9696
Returns a formatted string giving the results between the
9797
latest result and the newest hash in a given branch.
98-
If no branch given, use the 'master' branch.
98+
If no branch given, use the 'main' branch.
9999
"""
100100
raise NotImplementedError()
101101

@@ -230,7 +230,7 @@ class NoRepository(Repo):
230230
"""
231231

232232
dvcs = "none"
233-
_default_branch = "master"
233+
_default_branch = "main"
234234

235235
def __init__(self, url=None, path=None):
236236
self.url = None

asv/template/asv.conf.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,9 @@
3737
// "install_command": ["in-dir={env_dir} python -mpip install {wheel_file}"],
3838
// "uninstall_command": ["return-code=any python -mpip uninstall -y {project}"],
3939

40-
// List of branches to benchmark. If not provided, defaults to "master"
40+
// List of branches to benchmark. If not provided, defaults to "main"
4141
// (for git) or "default" (for mercurial).
42-
// "branches": ["master"], // for git
42+
// "branches": ["main"], // for git
4343
// "branches": ["default"], // for mercurial
4444

4545
// The DVCS being used. If not set, it will be automatically

asv/util.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1279,8 +1279,8 @@ def git_default_branch():
12791279
[which('git'), 'config', '--system', 'init.defaultBranch'],
12801280
display_error=False).strip()
12811281
except ProcessError:
1282-
# Default to master when global and system are not set
1283-
default_branch = 'master'
1282+
# Default to main when global and system are not set
1283+
default_branch = 'main'
12841284
return default_branch
12851285

12861286

asv/www/asv.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
$(document).ready(function() {
44
/* GLOBAL STATE */
55
/* The index.json content as returned from the server */
6-
var master_timestamp = '';
7-
var master_json = {};
6+
var main_timestamp = '';
7+
var main_json = {};
88
/* Extra pages: {name: show_function} */
99
var loaded_pages = {};
1010
/* Previous window scroll positions */
@@ -284,7 +284,7 @@ $(document).ready(function() {
284284
}
285285
else {
286286
$.ajax({
287-
url: url + '?timestamp=' + $.asv.master_timestamp,
287+
url: url + '?timestamp=' + $.asv.main_timestamp,
288288
dataType: "json",
289289
cache: true
290290
}).done(function(data) {
@@ -417,17 +417,17 @@ $(document).ready(function() {
417417
}
418418

419419
function get_commit_hash(revision) {
420-
var commit_hash = master_json.revision_to_hash[revision];
420+
var commit_hash = main_json.revision_to_hash[revision];
421421
if (commit_hash) {
422422
// Return printable commit hash
423-
commit_hash = commit_hash.slice(0, master_json.hash_length);
423+
commit_hash = commit_hash.slice(0, main_json.hash_length);
424424
}
425425
return commit_hash;
426426
}
427427

428428
function get_revision(commit_hash) {
429429
var rev = null;
430-
$.each(master_json.revision_to_hash, function(revision, full_commit_hash) {
430+
$.each(main_json.revision_to_hash, function(revision, full_commit_hash) {
431431
if (full_commit_hash.startsWith(commit_hash)) {
432432
rev = revision;
433433
// break the $.each loop
@@ -438,15 +438,15 @@ $(document).ready(function() {
438438
}
439439

440440
function init_index() {
441-
/* Fetch the master index.json and then set up the page elements
441+
/* Fetch the main index.json and then set up the page elements
442442
based on it. */
443443
$.ajax({
444-
url: "index.json" + '?timestamp=' + $.asv.master_timestamp,
444+
url: "index.json" + '?timestamp=' + $.asv.main_timestamp,
445445
dataType: "json",
446446
cache: true
447447
}).done(function (index) {
448-
master_json = index;
449-
$.asv.master_json = index;
448+
main_json = index;
449+
$.asv.main_json = index;
450450

451451
/* Page title */
452452
var project_name = $("#project-name")[0];
@@ -475,8 +475,8 @@ $(document).ready(function() {
475475
dataType: "json",
476476
cache: false
477477
}).done(function (info) {
478-
master_timestamp = info['timestamp'];
479-
$.asv.master_timestamp = master_timestamp;
478+
main_timestamp = info['timestamp'];
479+
$.asv.main_timestamp = main_timestamp;
480480
init_index();
481481
}).fail(function () {
482482
$.asv.ui.network_error();
@@ -503,8 +503,8 @@ $(document).ready(function() {
503503
this.get_commit_hash = get_commit_hash;
504504
this.get_revision = get_revision;
505505

506-
this.master_timestamp = master_timestamp; /* Updated after info.json loads */
507-
this.master_json = master_json; /* Updated after index.json loads */
506+
this.main_timestamp = main_timestamp; /* Updated after info.json loads */
507+
this.main_json = main_json; /* Updated after index.json loads */
508508

509509
this.format_date_yyyymmdd = format_date_yyyymmdd;
510510
this.format_date_yyyymmdd_hhmm = format_date_yyyymmdd_hhmm;

asv/www/asv_ui.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ $(document).ready(function() {
106106
$.asv.load_graph_data(
107107
graph_url
108108
).done(function (data) {
109-
var params = $.asv.master_json.benchmarks[benchmark_basename].params;
109+
var params = $.asv.main_json.benchmarks[benchmark_basename].params;
110110
data = $.asv.filter_graph_data_idx(data, 0, parameter_idx, params);
111111
var options = {
112112
colors: ['#000'],

asv/www/graphdisplay.js

+24-24
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ $(document).ready(function() {
8383

8484
function get_x_from_revision(rev) {
8585
if (date_scale) {
86-
return $.asv.master_json.revision_to_date[rev];
86+
return $.asv.main_json.revision_to_date[rev];
8787
} else {
8888
return rev;
8989
}
@@ -150,12 +150,12 @@ $(document).ready(function() {
150150
var stack = [tree];
151151

152152
/* Sort keys for tree construction */
153-
var benchmark_keys = Object.keys($.asv.master_json.benchmarks);
153+
var benchmark_keys = Object.keys($.asv.main_json.benchmarks);
154154
benchmark_keys.sort();
155155

156156
/* Build tree */
157157
$.each(benchmark_keys, function(i, bm_name) {
158-
var bm = $.asv.master_json.benchmarks[bm_name];
158+
var bm = $.asv.main_json.benchmarks[bm_name];
159159
var parts = bm_name.split('.');
160160
var i = 0;
161161
var j;
@@ -299,7 +299,7 @@ $(document).ready(function() {
299299
var y = item.datapoint[1];
300300
var commit_hash = get_commit_hash(item.datapoint[0]);
301301
if (commit_hash) {
302-
var unit = $.asv.master_json.benchmarks[current_benchmark].unit;
302+
var unit = $.asv.main_json.benchmarks[current_benchmark].unit;
303303
showTooltip(
304304
item.pageX, item.pageY,
305305
$.asv.pretty_unit(y, unit) + " @ " + commit_hash);
@@ -328,7 +328,7 @@ $(document).ready(function() {
328328
if (previous_hash !== commit_hash) {
329329
previous_hash = commit_hash;
330330
window.open(
331-
$.asv.master_json.show_commit_url + previous_hash,
331+
$.asv.main_json.show_commit_url + previous_hash,
332332
'_blank');
333333
}
334334
}
@@ -348,7 +348,7 @@ $(document).ready(function() {
348348
/*
349349
Generic parameter selections
350350
*/
351-
var index = $.asv.master_json;
351+
var index = $.asv.main_json;
352352
if (!state || state_selection !== null) {
353353
/*
354354
Setup the default configuration on first load,
@@ -428,7 +428,7 @@ $(document).ready(function() {
428428

429429
function update_state_url(params) {
430430
var info = $.asv.parse_hash_string(window.location.hash);
431-
$.each($.asv.master_json.params, function(param, values) {
431+
$.each($.asv.main_json.params, function(param, values) {
432432
if (values.length > 1) {
433433
if (state[param].length != values.length || param == 'branch') {
434434
info.params[param] = state[param];
@@ -445,7 +445,7 @@ $(document).ready(function() {
445445
}
446446

447447
function replace_params_ui() {
448-
var index = $.asv.master_json;
448+
var index = $.asv.main_json;
449449

450450
var nav = $('#graphdisplay-state-params');
451451
nav.empty();
@@ -521,8 +521,8 @@ $(document).ready(function() {
521521
}
522522

523523
function replace_benchmark_params_ui() {
524-
var params = $.asv.master_json.benchmarks[current_benchmark].params;
525-
var param_names = $.asv.master_json.benchmarks[current_benchmark].param_names;
524+
var params = $.asv.main_json.benchmarks[current_benchmark].params;
525+
var param_names = $.asv.main_json.benchmarks[current_benchmark].param_names;
526526

527527
/* Parameter selection UI */
528528
var nav = $('#graphdisplay-navigation-params');
@@ -574,7 +574,7 @@ $(document).ready(function() {
574574
if (rev === null) {
575575
button.text("last");
576576
} else {
577-
var date_fmt = new Date($.asv.master_json.revision_to_date[rev]);
577+
var date_fmt = new Date($.asv.main_json.revision_to_date[rev]);
578578
button.text($.asv.get_commit_hash(rev)
579579
+ " "
580580
+ date_fmt.toUTCString());
@@ -659,7 +659,7 @@ $(document).ready(function() {
659659
return;
660660
}
661661

662-
var params = $.asv.master_json.benchmarks[current_benchmark].params;
662+
var params = $.asv.main_json.benchmarks[current_benchmark].params;
663663
x_coordinate_is_category = false;
664664
if (x_coordinate_axis != 0) {
665665
for (var j = 0; j < params[x_coordinate_axis-1].length; ++j) {
@@ -754,7 +754,7 @@ $(document).ready(function() {
754754
if (current_benchmark) {
755755
/* For the current set of enabled parameters, generate a
756756
list of all the permutations we need to load. */
757-
var state_permutations = $.grep($.asv.master_json.graph_param_list, function (params) {
757+
var state_permutations = $.grep($.asv.main_json.graph_param_list, function (params) {
758758
var ok = true;
759759
$.each(state, function (key, values) {
760760
if ($.inArray(params[key], values) == -1) {
@@ -767,14 +767,14 @@ $(document).ready(function() {
767767
/* Find where the parameters are different. */
768768
var different = find_different_properties(state_permutations);
769769
/* For parameterized tests: names of benchmark parameters */
770-
var params = $.asv.master_json.benchmarks[current_benchmark].params;
771-
var param_names = $.asv.master_json.benchmarks[current_benchmark].param_names;
770+
var params = $.asv.main_json.benchmarks[current_benchmark].params;
771+
var param_names = $.asv.main_json.benchmarks[current_benchmark].param_names;
772772
/* Selected permutations of benchmark parameters, omitting x-axis */
773773
var selection = obj_copy(param_selection);
774774
selection[x_coordinate_axis] = [null]; /* value not referenced, set to null */
775775
var param_permutations = permutations(selection);
776776

777-
/* Generate a master list of URLs and legend labels for
777+
/* Generate a main list of URLs and legend labels for
778778
the graphs. */
779779
var all = [];
780780
$.each(state_permutations, function (i, perm) {
@@ -852,7 +852,7 @@ $(document).ready(function() {
852852
series = $.asv.filter_graph_data(data,
853853
x_coordinate_axis,
854854
graph_content[0],
855-
$.asv.master_json.benchmarks[current_benchmark].params);
855+
$.asv.main_json.benchmarks[current_benchmark].params);
856856
orig_graphs.push({
857857
data: series,
858858
label: graph_content[1],
@@ -980,11 +980,11 @@ $(document).ready(function() {
980980
options.yaxis.max = Math.pow(10, max) * reference;
981981

982982
if (!reference_scale) {
983-
options.yaxis.axisLabel = $.asv.master_json.benchmarks[current_benchmark].unit;
983+
options.yaxis.axisLabel = $.asv.main_json.benchmarks[current_benchmark].unit;
984984
}
985985
}
986986
else {
987-
var unit = $.asv.master_json.benchmarks[current_benchmark].unit;
987+
var unit = $.asv.main_json.benchmarks[current_benchmark].unit;
988988
var unit_list = null;
989989

990990
if (unit == "seconds") {
@@ -1080,7 +1080,7 @@ $(document).ready(function() {
10801080
date_to_revision = {};
10811081
$.each(graphs, function(i, graph) {
10821082
$.each(graph.data, function(j, point) {
1083-
var date = $.asv.master_json.revision_to_date[point[0]];
1083+
var date = $.asv.main_json.revision_to_date[point[0]];
10841084
date_to_revision[date] = point[0];
10851085
point[0] = date;
10861086
});
@@ -1110,7 +1110,7 @@ $(document).ready(function() {
11101110
else {
11111111
graphs = orig_graphs;
11121112
}
1113-
var param_names = $.asv.master_json.benchmarks[current_benchmark].param_names;
1113+
var param_names = $.asv.main_json.benchmarks[current_benchmark].param_names;
11141114
options.xaxis.axisLabel = param_names[x_coordinate_axis-1];
11151115
}
11161116
}
@@ -1125,7 +1125,7 @@ $(document).ready(function() {
11251125
var markings = [];
11261126

11271127
if (x_coordinate_axis == 0) {
1128-
$.each($.asv.master_json.tags, function(tag, revision) {
1128+
$.each($.asv.main_json.tags, function(tag, revision) {
11291129
var x = get_x_from_revision(revision);
11301130
markings.push(
11311131
{ color: "#ddd", lineWidth: 1, xaxis: { from: x, to: x } }
@@ -1157,7 +1157,7 @@ $(document).ready(function() {
11571157
if (reference_scale) {
11581158
unit = 'relative';
11591159
} else {
1160-
unit = $.asv.master_json.benchmarks[current_benchmark].unit;
1160+
unit = $.asv.main_json.benchmarks[current_benchmark].unit;
11611161
}
11621162

11631163
var options = {
@@ -1342,7 +1342,7 @@ $(document).ready(function() {
13421342
var canvas = plot.getCanvas();
13431343
var xmin = plot.getAxes().xaxis.min;
13441344
var xmax = plot.getAxes().xaxis.max;
1345-
$.each($.asv.master_json.tags, function(tag, revision) {
1345+
$.each($.asv.main_json.tags, function(tag, revision) {
13461346
var x = get_x_from_revision(revision);
13471347
if (x >= xmin && x <= xmax) {
13481348
var p = plot.pointOffset({x: x, y: 0});

0 commit comments

Comments
 (0)