Skip to content

Commit 89e54d2

Browse files
STY: canonicalize 0.00 / 0.000 zero literals to 0.0
Apply pylint bad-number-notation's "unconventional zero literal" suggestion in two test files: trailing-zero forms (0.00, 0.000) are rewritten as 0.0. Identical floats; only the textual form changes.
1 parent 62a64d2 commit 89e54d2

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎astropy/stats/tests/test_funcs.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ def test_binom_conf_interval():
161161
conf = 0.95
162162
result = funcs.binom_conf_interval(k, n, confidence_level=conf, interval="jeffreys")
163163
table = np.array(
164-
[[0.000, 0.016, 0.065, 0.139, 0.234], [0.292, 0.501, 0.648, 0.766, 0.861]]
164+
[[0.0, 0.016, 0.065, 0.139, 0.234], [0.292, 0.501, 0.648, 0.766, 0.861]]
165165
)
166166
assert_allclose(result, table, atol=1.0e-3, rtol=0.0)
167167

@@ -685,10 +685,10 @@ def test_scipy_poisson_limit():
685685
@pytest.mark.skipif(not HAS_MPMATH, reason="requires mpmath")
686686
def test_mpmath_poisson_limit():
687687
assert_allclose(
688-
funcs._mpmath_kraft_burrows_nousek(1.0, 0.1, 0.99), (0.00, 6.54), rtol=5e-3
688+
funcs._mpmath_kraft_burrows_nousek(1.0, 0.1, 0.99), (0.0, 6.54), rtol=5e-3
689689
)
690690
assert_allclose(
691-
funcs._mpmath_kraft_burrows_nousek(1.0, 0.5, 0.95), (0.00, 4.36), rtol=5e-3
691+
funcs._mpmath_kraft_burrows_nousek(1.0, 0.5, 0.95), (0.0, 4.36), rtol=5e-3
692692
)
693693
assert_allclose(
694694
funcs._mpmath_kraft_burrows_nousek(5.0, 0.0, 0.99), (1.17, 13.32), rtol=5e-3

‎astropy/visualization/tests/test_stretch.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
SquaredStretch,
2121
)
2222

23-
DATA = np.array([0.00, 0.25, 0.50, 0.75, 1.00])
23+
DATA = np.array([0.0, 0.25, 0.50, 0.75, 1.00])
2424

2525
RESULTS = {}
26-
RESULTS[LinearStretch()] = np.array([0.00, 0.25, 0.50, 0.75, 1.00])
26+
RESULTS[LinearStretch()] = np.array([0.0, 0.25, 0.50, 0.75, 1.00])
2727
RESULTS[LinearStretch(intercept=0.5) + LinearStretch(slope=0.5)] = np.array(
2828
[0.5, 0.625, 0.75, 0.875, 1.0]
2929
)
@@ -155,7 +155,7 @@ def test_sinh_a():
155155

156156

157157
def test_histeqstretch_invalid():
158-
data = np.array([-np.inf, 0.00, 0.25, 0.50, 0.75, 1.00, np.inf])
158+
data = np.array([-np.inf, 0.0, 0.25, 0.50, 0.75, 1.00, np.inf])
159159
result = np.array([0.0, 0.0, 0.25, 0.5, 0.75, 1.0, 1.0])
160160
assert_equal(HistEqStretch(data)(data), result)
161161
assert_equal(InvertedHistEqStretch(data)(data), result)

0 commit comments

Comments
 (0)