MCPcopy Index your code
hub / github.com/matplotlib/matplotlib / value_formatter

Class value_formatter

tools/boilerplate.py:82–105  ·  view source on GitHub ↗

Format function default values as needed for inspect.formatargspec. The interesting part is a hard-coded list of functions used as defaults in pyplot methods.

Source from the content-addressed store, hash-verified

80
81
82class value_formatter:
83 """
84 Format function default values as needed for inspect.formatargspec.
85 The interesting part is a hard-coded list of functions used
86 as defaults in pyplot methods.
87 """
88
89 def __init__(self, value):
90 if value is mlab.detrend_none:
91 self._repr = "mlab.detrend_none"
92 elif value is mlab.window_hanning:
93 self._repr = "mlab.window_hanning"
94 elif value is np.mean:
95 self._repr = "np.mean"
96 elif value is _api.deprecation._deprecated_parameter:
97 self._repr = "_api.deprecation._deprecated_parameter"
98 elif isinstance(value, Enum):
99 # Enum str is Class.Name whereas their repr is <Class.Name: value>.
100 self._repr = f'{type(value).__name__}.{value.name}'
101 else:
102 self._repr = repr(value)
103
104 def __repr__(self):
105 return self._repr
106
107
108class direct_repr:

Callers 1

generate_functionFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…