Skip to content

Commit baf8c60

Browse files
authored
Add prettier json linter for uniformity (#211)
* Add prettier json linter for uniformity * linting * lint again
1 parent 6d977d8 commit baf8c60

30 files changed

Lines changed: 323 additions & 468 deletions

.pre-commit-config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,9 @@ repos:
2323
rev: 5.13.2
2424
hooks:
2525
- id: isort
26+
- repo: https://github.com/pre-commit/mirrors-prettier
27+
rev: v3.1.0
28+
hooks:
29+
- id: prettier
30+
args: [--tab-width=4, --print-width=120]
31+
files: ^configs/.*\.json$

configs/common/svm.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
{
1111
"algorithm": {
1212
"library": "cuml",
13-
"estimator_methods": {"inference": "predict"},
13+
"estimator_methods": { "inference": "predict" },
1414
"estimator_params": { "verbose": false, "multiclass_strategy": "ovr" }
1515
},
1616
"data": { "format": "cupy" }
@@ -27,7 +27,7 @@
2727
{
2828
"algorithm": {
2929
"library": "cuml",
30-
"estimator_methods": {"inference": "predict"},
30+
"estimator_methods": { "inference": "predict" },
3131
"estimator_params": { "multiclass_strategy": "ovr" }
3232
},
3333
"data": { "format": "cupy" }
@@ -43,7 +43,7 @@
4343
{
4444
"algorithm": {
4545
"library": "cuml",
46-
"estimator_methods": {"inference": "predict"}
46+
"estimator_methods": { "inference": "predict" }
4747
},
4848
"data": { "format": "cupy" }
4949
}

configs/common/xgboost.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"algorithm": {
4444
"library": "xgboost",
4545
"estimator": "XGBRegressor",
46-
"estimator_methods": {"inference": "predict"},
46+
"estimator_methods": { "inference": "predict" },
4747
"estimator_params": { "objective": "reg:squarederror" }
4848
}
4949
}

configs/regular/dbscan.json

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,11 @@
33
"PARAMETERS_SETS": {
44
"dbscan datasets": {
55
"data": [
6-
{ "dataset": "cifar", "split_kwargs": { "train_size": 15000 }, "preprocessing_kwargs": { "normalize": "mean" } },
6+
{
7+
"dataset": "cifar",
8+
"split_kwargs": { "train_size": 15000 },
9+
"preprocessing_kwargs": { "normalize": "mean" }
10+
},
711
{ "dataset": "mnist", "split_kwargs": { "train_size": 40000 } },
812
{ "dataset": "sensit", "split_kwargs": { "ignore": true } },
913
{ "dataset": "susy", "split_kwargs": { "train_size": 100000 } },
@@ -35,12 +39,7 @@
3539
]
3640
},
3741
"cuml dbscan": {
38-
"SETS": [
39-
"cuml implementation",
40-
"common dbscan parameters",
41-
"cuml dbscan parameters",
42-
"dbscan datasets"
43-
]
42+
"SETS": ["cuml implementation", "common dbscan parameters", "cuml dbscan parameters", "dbscan datasets"]
4443
}
4544
}
4645
}

configs/regular/kmeans.json

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"split_kwargs": { "ignore": true }
1515
},
1616
{
17-
"dataset" : "gisette",
18-
"split_kwargs" : {"ignore" : true},
17+
"dataset": "gisette",
18+
"split_kwargs": { "ignore": true },
1919
"preprocessing_kwargs": { "normalize": "standard" }
2020
},
2121
{
@@ -51,7 +51,6 @@
5151
"split_kwargs": { "train_size": 0.2, "test_size": null }
5252
}
5353
}
54-
5554
]
5655
},
5756
"TEMPLATES": {
@@ -64,12 +63,7 @@
6463
]
6564
},
6665
"cuml kmeans": {
67-
"SETS": [
68-
"cuml implementation",
69-
"common kmeans parameters",
70-
"cuml kmeans parameters",
71-
"kmeans datasets"
72-
]
66+
"SETS": ["cuml implementation", "common kmeans parameters", "cuml kmeans parameters", "kmeans datasets"]
7367
}
7468
}
7569
}

configs/regular/knn.json

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,28 @@
1818
"source": "make_classification",
1919
"generation_kwargs": [
2020
{
21-
"n_classes": 5, "n_samples": 400000, "n_features": 4,
22-
"n_redundant": 0, "n_repeated": 0, "n_informative": 4
21+
"n_classes": 5,
22+
"n_samples": 400000,
23+
"n_features": 4,
24+
"n_redundant": 0,
25+
"n_repeated": 0,
26+
"n_informative": 4
2327
},
2428
{
25-
"n_classes": 5, "n_samples": 200000, "n_features": 8,
26-
"n_redundant": 2, "n_repeated": 2, "n_informative": 4
29+
"n_classes": 5,
30+
"n_samples": 200000,
31+
"n_features": 8,
32+
"n_redundant": 2,
33+
"n_repeated": 2,
34+
"n_informative": 4
2735
},
2836
{
29-
"n_classes": 5, "n_samples": 100000, "n_features": 16,
30-
"n_redundant": 6, "n_repeated": 6, "n_informative": 4
37+
"n_classes": 5,
38+
"n_samples": 100000,
39+
"n_features": 16,
40+
"n_redundant": 6,
41+
"n_repeated": 6,
42+
"n_informative": 4
3143
}
3244
],
3345
"split_kwargs": { "train_size": 0.5, "test_size": 0.5 }
@@ -48,7 +60,7 @@
4860
},
4961
{
5062
"source": "make_regression",
51-
"generation_kwargs":[
63+
"generation_kwargs": [
5264
{ "n_samples": 400000, "n_features": 4, "noise": 1.0 },
5365
{ "n_samples": 200000, "n_features": 8, "noise": 1.5 },
5466
{ "n_samples": 100000, "n_features": 16, "noise": 2.0 }

configs/regular/lightgbm.json

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,15 @@
11
{
2-
"INCLUDE": [
3-
"../common/lightgbm.json",
4-
"xgboost_binary.json",
5-
"xgboost_multi.json",
6-
"xgboost_regression.json"
7-
],
2+
"INCLUDE": ["../common/lightgbm.json", "xgboost_binary.json", "xgboost_multi.json", "xgboost_regression.json"],
83
"PARAMETERS_SETS": {},
94
"TEMPLATES": {
105
"lightgbm binary classification": {
11-
"SETS": [
12-
"lightgbm binary classification",
13-
"lightgbm implementations",
14-
"gbt binary classification data"
15-
]
6+
"SETS": ["lightgbm binary classification", "lightgbm implementations", "gbt binary classification data"]
167
},
178
"lightgbm multi classification": {
18-
"SETS": [
19-
"lightgbm multi classification",
20-
"lightgbm implementations",
21-
"gbt multi classification data"
22-
]
9+
"SETS": ["lightgbm multi classification", "lightgbm implementations", "gbt multi classification data"]
2310
},
2411
"lightgbm regression": {
25-
"SETS": [
26-
"lightgbm regression",
27-
"lightgbm implementations",
28-
"gbt regression data"
29-
]
12+
"SETS": ["lightgbm regression", "lightgbm implementations", "gbt regression data"]
3013
}
3114
}
3215
}

configs/regular/linear_model.json

Lines changed: 18 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,22 @@
88
"split_kwargs": { "train_size": 0.2, "test_size": 0.8 },
99
"generation_kwargs": [
1010
{
11-
"n_samples": 5000000, "n_features": 50,
12-
"n_informative": 5, "noise": 20.0
11+
"n_samples": 5000000,
12+
"n_features": 50,
13+
"n_informative": 5,
14+
"noise": 20.0
1315
},
1416
{
15-
"n_samples": 500000, "n_features": 400,
16-
"n_informative": 5, "noise": 40.0
17+
"n_samples": 500000,
18+
"n_features": 400,
19+
"n_informative": 5,
20+
"noise": 40.0
1721
},
1822
{
19-
"n_samples": 100000, "n_features": 2000,
20-
"n_informative": 5, "noise": 60.0
23+
"n_samples": 100000,
24+
"n_features": 2000,
25+
"n_informative": 5,
26+
"noise": 60.0
2127
}
2228
]
2329
}
@@ -55,50 +61,22 @@
5561
]
5662
},
5763
"sklearn lasso": {
58-
"SETS": [
59-
"sklearn-ex[cpu] implementations",
60-
"common lasso parameters",
61-
"regression datasets"
62-
]
64+
"SETS": ["sklearn-ex[cpu] implementations", "common lasso parameters", "regression datasets"]
6365
},
6466
"sklearn elasticnet": {
65-
"SETS": [
66-
"sklearn-ex[cpu] implementations",
67-
"common elasticnet parameters",
68-
"regression datasets"
69-
]
67+
"SETS": ["sklearn-ex[cpu] implementations", "common elasticnet parameters", "regression datasets"]
7068
},
7169
"cuml linear": {
72-
"SETS": [
73-
"cuml implementation",
74-
"common linear parameters",
75-
"cuml L2 parameters",
76-
"regression datasets"
77-
]
70+
"SETS": ["cuml implementation", "common linear parameters", "cuml L2 parameters", "regression datasets"]
7871
},
7972
"cuml ridge": {
80-
"SETS": [
81-
"cuml implementation",
82-
"common ridge parameters",
83-
"cuml L2 parameters",
84-
"regression datasets"
85-
]
73+
"SETS": ["cuml implementation", "common ridge parameters", "cuml L2 parameters", "regression datasets"]
8674
},
8775
"cuml lasso": {
88-
"SETS": [
89-
"cuml implementation",
90-
"common lasso parameters",
91-
"cuml L1 parameters",
92-
"regression datasets"
93-
]
76+
"SETS": ["cuml implementation", "common lasso parameters", "cuml L1 parameters", "regression datasets"]
9477
},
9578
"cuml elasticnet": {
96-
"SETS": [
97-
"cuml implementation",
98-
"common elasticnet parameters",
99-
"cuml L1 parameters",
100-
"regression datasets"
101-
]
79+
"SETS": ["cuml implementation", "common elasticnet parameters", "cuml L1 parameters", "regression datasets"]
10280
}
10381
}
10482
}

configs/regular/logreg.json

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,41 +45,41 @@
4545
"test_size": 0.95
4646
}
4747
},
48-
"algorithm": {"estimator_params": {"C": 1e-6}}
48+
"algorithm": { "estimator_params": { "C": 1e-6 } }
4949
},
5050
{
5151
"data": { "dataset": "mnist", "split_kwargs": { "train_size": 10000, "test_size": null } },
52-
"algorithm": {"estimator_params": {"C": 1e-8}}
52+
"algorithm": { "estimator_params": { "C": 1e-8 } }
5353
},
5454
{
5555
"data": {
5656
"dataset": "susy",
5757
"split_kwargs": { "train_size": 0.1, "test_size": null }
5858
},
59-
"algorithm": { "estimator_params": {"C": 1e-2} }
59+
"algorithm": { "estimator_params": { "C": 1e-2 } }
6060
},
6161
{
6262
"data": {
6363
"dataset": "hepmass",
6464
"split_kwargs": { "train_size": 0.1, "test_size": null }
6565
},
66-
"algorithm": { "estimator_params": {"C": 1e-5} }
66+
"algorithm": { "estimator_params": { "C": 1e-5 } }
6767
},
6868
{
6969
"data": {
7070
"dataset": "cifar",
7171
"split_kwargs": { "train_size": 0.1, "test_size": null },
7272
"preprocessing_kwargs": { "normalize": "mean" }
7373
},
74-
"algorithm": { "estimator_params": {"C": 1e-9} }
74+
"algorithm": { "estimator_params": { "C": 1e-9 } }
7575
},
7676
{
7777
"data": {
7878
"dataset": "gisette",
7979
"split_kwargs": { "train_size": 2000, "test_size": null },
8080
"preprocessing_kwargs": { "normalize": "standard" }
8181
},
82-
"algorithm": { "estimator_params": {"C": 1e1} }
82+
"algorithm": { "estimator_params": { "C": 1e1 } }
8383
}
8484
]
8585
},
@@ -93,12 +93,7 @@
9393
]
9494
},
9595
"cuml logreg": {
96-
"SETS": [
97-
"cuml implementation",
98-
"common logreg parameters",
99-
"cuml logreg parameters",
100-
"logreg datasets"
101-
]
96+
"SETS": ["cuml implementation", "common logreg parameters", "cuml logreg parameters", "logreg datasets"]
10297
}
10398
}
10499
}

configs/regular/pca.json

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,10 @@
2828
},
2929
"TEMPLATES": {
3030
"sklearn pca": {
31-
"SETS": [
32-
"sklearn-ex[cpu,gpu] implementations",
33-
"pca parameters",
34-
"pca datasets"
35-
]
31+
"SETS": ["sklearn-ex[cpu,gpu] implementations", "pca parameters", "pca datasets"]
3632
},
3733
"cuml pca": {
38-
"SETS": [
39-
"cuml implementation",
40-
"pca parameters",
41-
"cuml pca parameters",
42-
"pca datasets"
43-
]
34+
"SETS": ["cuml implementation", "pca parameters", "cuml pca parameters", "pca datasets"]
4435
}
4536
}
4637
}

0 commit comments

Comments
 (0)