8000 Privatize cbook.format_approx. by QuLogic · Pull Request #18090 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

Privatize cbook.format_approx. #18090

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/matplotlib/cbook/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2385,7 +2385,7 @@ def _setup_new_guiapp():
"matplotlib")


def format_approx(number, precision):
def _format_approx(number, precision):
"""
Format the number with at most the number of decimals given as precision.
Remove trailing zeros and possibly the decimal point.
Expand Down
2 changes: 1 addition & 1 deletion lib/matplotlib/tests/test_cbook.py
8000
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ def verify_pre_post_state(obj):


def test_format_approx():
f = cbook.format_approx
f = cbook._format_approx
assert f(0, 1) == '0'
assert f(0, 2) == '0'
assert f(0, 3) == '0'
Expand Down
4 changes: 2 additions & 2 deletions lib/matplotlib/type1font.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

import numpy as np

from matplotlib.cbook import format_approx
from matplotlib.cbook import _format_approx


# token types
Expand Down Expand Up @@ -271,7 +271,7 @@ def fontmatrix(array):
array[::2] = newmatrix[0:3, 0]
array[1::2] = newmatrix[0:3, 1]
return (
'[%s]' % ' '.join(format_approx(x, 6) for x in array)
'[%s]' % ' '.join(_format_approx(x, 6) for x in array)
).encode('ascii')

def replace(fun):
Expand Down
0