Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fecfa1a

Browse files
authored
Merge pull request #18090 from QuLogic/private-format_approx
Privatize cbook.format_approx.
2 parents b5eca56 + 019537f commit fecfa1a

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/matplotlib/cbook/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2385,7 +2385,7 @@ def _setup_new_guiapp():
23852385
"matplotlib")
23862386

23872387

2388-
def format_approx(number, precision):
2388+
def _format_approx(number, precision):
23892389
"""
23902390
Format the number with at most the number of decimals given as precision.
23912391
Remove trailing zeros and possibly the decimal point.

lib/matplotlib/tests/test_cbook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -744,7 +744,7 @@ def verify_pre_post_state(obj):
744744

745745

746746
def test_format_approx():
747-
f = cbook.format_approx
747+
f = cbook._format_approx
748748
assert f(0, 1) == '0'
749749
assert f(0, 2) == '0'
750750
assert f(0, 3) == '0'

lib/matplotlib/type1font.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
import numpy as np
3131

32-
from matplotlib.cbook import format_approx
32+
from matplotlib.cbook import _format_approx
3333

3434

3535
# token types
@@ -271,7 +271,7 @@ def fontmatrix(array):
271271
array[::2] = newmatrix[0:3, 0]
272272
array[1::2] = newmatrix[0:3, 1]
273273
return (
274-
'[%s]' % ' '.join(format_approx(x, 6) for x in array)
274+
'[%s]' % ' '.join(_format_approx(x, 6) for x in array)
275275
).encode('ascii')
276276

277277
def replace(fun):

0 commit comments

Comments
 (0)