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

Skip to content

Commit b542961

Browse files
committed
Remove mlab.Format... classes
1 parent ff137b6 commit b542961

2 files changed

Lines changed: 3 additions & 97 deletions

File tree

doc/api/next_api_changes/2018-09-18-DS.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,7 @@ in Matplotlib 2.2 has been removed. See below for a list:
4545
- `mlab.get_formatd`
4646
- `mlab.FormatDatetime` (use datetime.strftime instead)
4747
- `mlab.FormatDate` (use date.strftime instead)
48+
- `mlab.FormatMillions`, `mlab.FormatThousands`, `mlab.FormatPercent`,
49+
`mlab.FormatBool`, `mlab.FormatInt`, `mlab.FormatFloat`,
50+
`mlab.FormatFormatStr`, `mlab.FormatString`, `mlab.FormatObj`
4851
- `mlab.donothing_callback`

lib/matplotlib/mlab.py

Lines changed: 0 additions & 97 deletions
Original file line numberDiff line numberDiff line change
@@ -2161,103 +2161,6 @@ def get_converters(reader, comments):
21612161
return r
21622162

21632163

2164-
# a series of classes for describing the format intentions of various rec views
2165-
@cbook.deprecated("2.2")
2166-
class FormatObj(object):
2167-
def tostr(self, x):
2168-
return self.toval(x)
2169-
2170-
def toval(self, x):
2171-
return str(x)
2172-
2173-
def fromstr(self, s):
2174-
return s
2175-
2176-
def __hash__(self):
2177-
"""
2178-
override the hash function of any of the formatters, so that we don't
2179-
create duplicate excel format styles
2180-
"""
2181-
return hash(self.__class__)
2182-
2183-
2184-
@cbook.deprecated("2.2")
2185-
class FormatString(FormatObj):
2186-
def tostr(self, x):
2187-
val = repr(x)
2188-
return val[1:-1]
2189-
2190-
2191-
@cbook.deprecated("2.2")
2192-
class FormatFormatStr(FormatObj):
2193-
def __init__(self, fmt):
2194-
self.fmt = fmt
2195-
2196-
def tostr(self, x):
2197-
if x is None:
2198-
return 'None'
2199-
return self.fmt % self.toval(x)
2200-
2201-
2202-
@cbook.deprecated("2.2")
2203-
class FormatFloat(FormatFormatStr):
2204-
def __init__(self, precision=4, scale=1.):
2205-
FormatFormatStr.__init__(self, '%%1.%df' % precision)
2206-
self.precision = precision
2207-
self.scale = scale
2208-
2209-
def __hash__(self):
2210-
return hash((self.__class__, self.precision, self.scale))
2211-
2212-
def toval(self, x):
2213-
if x is not None:
2214-
x = x * self.scale
2215-
return x
2216-
2217-
def fromstr(self, s):
2218-
return float(s)/self.scale
2219-
2220-
2221-
@cbook.deprecated("2.2")
2222-
class FormatInt(FormatObj):
2223-
2224-
def tostr(self, x):
2225-
return '%d' % int(x)
2226-
2227-
def toval(self, x):
2228-
return int(x)
2229-
2230-
def fromstr(self, s):
2231-
return int(s)
2232-
2233-
2234-
@cbook.deprecated("2.2")
2235-
class FormatBool(FormatObj):
2236-
def toval(self, x):
2237-
return str(x)
2238-
2239-
def fromstr(self, s):
2240-
return bool(s)
2241-
2242-
2243-
@cbook.deprecated("2.2")
2244-
class FormatPercent(FormatFloat):
2245-
def __init__(self, precision=4):
2246-
FormatFloat.__init__(self, precision, scale=100.)
2247-
2248-
2249-
@cbook.deprecated("2.2")
2250-
class FormatThousands(FormatFloat):
2251-
def __init__(self, precision=4):
2252-
FormatFloat.__init__(self, precision, scale=1e-3)
2253-
2254-
2255-
@cbook.deprecated("2.2")
2256-
class FormatMillions(FormatFloat):
2257-
def __init__(self, precision=4):
2258-
FormatFloat.__init__(self, precision, scale=1e-6)
2259-
2260-
22612164
class GaussianKDE(object):
22622165
"""
22632166
Representation of a kernel-density estimate using Gaussian kernels.

0 commit comments

Comments
 (0)