Skip to content

Commit e438e2e

Browse files
committed
chore: fix python linting issues
--- type: pre_commit_static_analysis_report description: Results of running static analysis checks when committing changes. report: - task: lint_filenames status: passed - task: lint_editorconfig status: passed - task: lint_markdown status: na - task: lint_package_json status: na - task: lint_repl_help status: na - task: lint_javascript_src status: na - task: lint_javascript_cli status: na - task: lint_javascript_examples status: na - task: lint_javascript_tests status: na - task: lint_javascript_benchmarks status: na - task: lint_python status: missing_dependencies - task: lint_r status: na - task: lint_c_src status: na - task: lint_c_examples status: na - task: lint_c_benchmarks status: na - task: lint_c_tests_fixtures status: na - task: lint_shell status: na - task: lint_typescript_declarations status: na - task: lint_typescript_tests status: na - task: lint_license_headers status: passed --- --- type: pre_push_report description: Results of running various checks prior to pushing changes. report: - task: run_javascript_examples status: na - task: run_c_examples status: na - task: run_cpp_examples status: na - task: run_javascript_readme_examples status: na - task: run_c_benchmarks status: na - task: run_cpp_benchmarks status: na - task: run_fortran_benchmarks status: na - task: run_javascript_benchmarks status: na - task: run_julia_benchmarks status: na - task: run_python_benchmarks status: na - task: run_r_benchmarks status: na - task: run_javascript_tests status: na ---
1 parent 7d81383 commit e438e2e

File tree

1 file changed

+68
-42
lines changed
  • lib/node_modules/@stdlib/math/base/special/hyp2f1/test/fixtures/python

1 file changed

+68
-42
lines changed

lib/node_modules/@stdlib/math/base/special/hyp2f1/test/fixtures/python/runner.py

Lines changed: 68 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -34,37 +34,58 @@
3434

3535
# Outliers:
3636
outliers = [
37-
(-1.8, 7.4, 20.4, -10),
38-
(1.8, -2.5, 20.4, -10),
39-
(1.8, 1, 20.4, -10),
40-
(1.8, 7.4, -1.8, -10),
41-
(1.8, 7.4, 20.4, -10),
42-
(5, 7.4, 20.4, -10),
43-
(10, 7.4, 20.4, -10),
44-
(10, 7.4, 20.4, 0.95),
45-
(2, 3, 5, 0.99),
46-
(2, 2.5, -3.25, 0.999),
47-
(-1.8, -2.5, 20.4, -10),
48-
(1.8, 7.4, -1.8, -1.01),
49-
(10, 1, -1.8, -0.99),
50-
(10, 7.4, -1.8, -0.99),
51-
(-8, 18.016500331508873, 10.805295997850628, 0.90875647507),
52-
(-0.1156544430516313, 12.722140489351698, -0.6030985338257255, -0.0005448214561780684),
53-
(-27.911722328444608, 14.018736008860946, -1.0168630024136034, 0.6228483452847298),
54-
(-10.184355055477743, 6.5450429328481174, -0.44051751620383994, 0.6555896492302491),
55-
(-5.0083982772911, 171.09919289684245, -1.4923865283013589, 0.7073764056574465),
56-
(-0.7429095709749414, 11.725525989335528, -7.299203351011158, 0.11534401417791407),
57-
(-14.55029516886238, 0.46553367087834685, -0.5349901418098844, 0.6086682776938632),
58-
(-5.428179853908536, 26.782963689614604, -4.162402828198655, 0.10047548647104909),
59-
(-1.8190858888165087, 21.025202609254364, -0.6960141045675334, 0.2570211738060222),
60-
(-0.9534205693212994, 10.024920055648606, -0.23845367675425955, 0.4419851803780206),
61-
(-31.70680212982947, 0.11445767340979862, -0.5570625216964069, 0.020574313007314604),
62-
(-0.18350917503602782, 14.696533286274349, -6.338990250643928, -0.9003519736816863),
63-
(-200.19574300099214, 1.9444493115386567, -0.6933677849479691, 0.24492811068225362),
64-
(-8.837706832399117, 0.19096384651567044, -2.3808990396202425, -0.27624718180517105),
65-
(-3.2052905962805456, 0.3048596186043564, -0.7039276707364683, 0.8496565195400692),
66-
(-13.37614633859299, 1.337786902832312, -0.05015281580946018, -0.0022109253176725296)
67-
]
37+
(-1.8, 7.4, 20.4, -10),
38+
(1.8, -2.5, 20.4, -10),
39+
(1.8, 1, 20.4, -10),
40+
(1.8, 7.4, -1.8, -10),
41+
(1.8, 7.4, 20.4, -10),
42+
(5, 7.4, 20.4, -10),
43+
(10, 7.4, 20.4, -10),
44+
(10, 7.4, 20.4, 0.95),
45+
(2, 3, 5, 0.99),
46+
(2, 2.5, -3.25, 0.999),
47+
(-1.8, -2.5, 20.4, -10),
48+
(1.8, 7.4, -1.8, -1.01),
49+
(10, 1, -1.8, -0.99),
50+
(10, 7.4, -1.8, -0.99),
51+
(-8, 18.016500331508873, 10.805295997850628, 0.90875647507),
52+
(
53+
-0.1156544430516313,
54+
12.722140489351698,
55+
-0.6030985338257255,
56+
-0.0005448214561780684,
57+
),
58+
(-27.911722328444608, 14.018736008860946, -1.0168630024136034, 0.6228483452847298),
59+
(-10.184355055477743, 6.5450429328481174, -0.44051751620383994, 0.6555896492302491),
60+
(-5.0083982772911, 171.09919289684245, -1.4923865283013589, 0.7073764056574465),
61+
(-0.7429095709749414, 11.725525989335528, -7.299203351011158, 0.11534401417791407),
62+
(-14.55029516886238, 0.46553367087834685, -0.5349901418098844, 0.6086682776938632),
63+
(-5.428179853908536, 26.782963689614604, -4.162402828198655, 0.10047548647104909),
64+
(-1.8190858888165087, 21.025202609254364, -0.6960141045675334, 0.2570211738060222),
65+
(-0.9534205693212994, 10.024920055648606, -0.23845367675425955, 0.4419851803780206),
66+
(
67+
-31.70680212982947,
68+
0.11445767340979862,
69+
-0.5570625216964069,
70+
0.020574313007314604,
71+
),
72+
(-0.18350917503602782, 14.696533286274349, -6.338990250643928, -0.9003519736816863),
73+
(-200.19574300099214, 1.9444493115386567, -0.6933677849479691, 0.24492811068225362),
74+
(
75+
-8.837706832399117,
76+
0.19096384651567044,
77+
-2.3808990396202425,
78+
-0.27624718180517105,
79+
),
80+
(-3.2052905962805456, 0.3048596186043564, -0.7039276707364683, 0.8496565195400692),
81+
(
82+
-13.37614633859299,
83+
1.337786902832312,
84+
-0.05015281580946018,
85+
-0.0022109253176725296,
86+
),
87+
]
88+
6889

6990
def gen(a, b, c, x, name):
7091
"""Generate fixture data and write to file.
@@ -87,7 +108,11 @@ def gen(a, b, c, x, name):
87108
python> gen(a, b, c, x, './data.json')
88109
```
89110
"""
90-
filtered_data = [(ai, bi, ci, xi) for ai, bi, ci, xi in zip(a, b, c, x) if (ai, bi, ci, xi) not in outliers]
111+
filtered_data = [
112+
(ai, bi, ci, xi)
113+
for ai, bi, ci, xi in zip(a, b, c, x)
114+
if (ai, bi, ci, xi) not in outliers
115+
]
91116
a_f, b_f, c_f, x_f = map(np.array, zip(*filtered_data))
92117
y = hyp2f1(a_f, b_f, c_f, x_f)
93118
y_f = ["PINF" if np.isinf(val) else val for val in y]
@@ -96,7 +121,7 @@ def gen(a, b, c, x, name):
96121
"b": b_f.tolist(),
97122
"c": c_f.tolist(),
98123
"x": x_f.tolist(),
99-
"expected": y_f
124+
"expected": y_f,
100125
}
101126

102127
# Based on the script directory, create an output filepath:
@@ -106,6 +131,7 @@ def gen(a, b, c, x, name):
106131
with open(filepath, "w", encoding="utf-8") as outfile:
107132
json.dump(data, outfile)
108133

134+
109135
def gen_outliers(name):
110136
"""Generate a test fixture including only outlier points.
111137
@@ -130,7 +156,7 @@ def gen_outliers(name):
130156
"b": b.tolist(),
131157
"c": c.tolist(),
132158
"x": x.tolist(),
133-
"expected": y
159+
"expected": y,
134160
}
135161

136162
# Based on the script directory, create an output filepath:
@@ -154,17 +180,17 @@ def main():
154180
# Edge Cases #1
155181
pts = [
156182
(1, 2, 3, 0),
157-
(1./3, 2./3, 5./6, 27./32),
158-
(1./4, 1./2, 3./4, 80./81),
159-
(2,-2, -3, 3),
183+
(1.0 / 3, 2.0 / 3, 5.0 / 6, 27.0 / 32),
184+
(1.0 / 4, 1.0 / 2, 3.0 / 4, 80.0 / 81),
185+
(2, -2, -3, 3),
160186
(2, -3, -2, 3),
161187
(2, -1.5, -1.5, 3),
162188
(1, 2, 3, 0),
163189
(0.7235, -1, -5, 0.3),
164-
(0.25, 1./3, 2, 0.999),
165-
(0.25, 1./3, 2, -1),
190+
(0.25, 1.0 / 3, 2, 0.999),
191+
(0.25, 1.0 / 3, 2, -1),
166192
(2, 3, 5, 0.99),
167-
(3./2, -0.5, 3, 0.99),
193+
(3.0 / 2, -0.5, 3, 0.99),
168194
(2, 2.5, -3.25, 0.999),
169195
(-8, 18.016500331508873, 10.805295997850628, 0.90875647507000001),
170196
(-10, 900, -10.5, 0.99),
@@ -185,8 +211,8 @@ def main():
185211
# Edge Cases #2
186212
pts = [
187213
(112, 5.1, -0.9, -0.99999),
188-
(10,-900,10.5,0.99),
189-
(10,-900,-10.5,0.99),
214+
(10, -900, 10.5, 0.99),
215+
(10, -900, -10.5, 0.99),
190216
]
191217
a, b, c, x = zip(*pts)
192218
a = np.array(a)

0 commit comments

Comments
 (0)