|
43 | 43 |
|
44 | 44 | if sys.version_info[0] >= 3: |
45 | 45 | def unicode_safe(s): |
46 | | - import matplotlib |
47 | | - |
48 | 46 | try: |
49 | 47 | preferredencoding = locale.getpreferredencoding( |
50 | 48 | matplotlib.rcParams['axes.formatter.use_locale']).strip() |
@@ -274,12 +272,14 @@ class CallbackRegistry: |
274 | 272 | functions). This technique was shared by Peter Parente on his |
275 | 273 | `"Mindtrove" blog |
276 | 274 | <http://mindtrove.info/articles/python-weak-references/>`_. |
| 275 | +
|
| 276 | + .. deprecated:: 1.3.0 |
277 | 277 | """ |
278 | 278 | def __init__(self, *args): |
279 | 279 | if len(args): |
280 | 280 | warnings.warn( |
281 | | - 'CallbackRegistry no longer requires a list of callback types.' |
282 | | - ' Ignoring arguments', |
| 281 | + "CallbackRegistry no longer requires a list of callback " |
| 282 | + "types. Ignoring arguments. *args will be removed in 1.5", |
283 | 283 | mplDeprecation) |
284 | 284 | self.callbacks = dict() |
285 | 285 | self._cid = 0 |
@@ -538,7 +538,6 @@ def to_filehandle(fname, flag='rU', return_opened=False): |
538 | 538 | """ |
539 | 539 | if is_string_like(fname): |
540 | 540 | if fname.endswith('.gz'): |
541 | | - import gzip |
542 | 541 | # get rid of 'U' in flag for gzipped files. |
543 | 542 | flag = flag.replace('U', '') |
544 | 543 | fh = gzip.open(fname, flag) |
@@ -831,6 +830,7 @@ def append(self, x): |
831 | 830 | if len(self.data) == self.max: |
832 | 831 | self.cur = 0 |
833 | 832 | # Permanently change self's class from non-full to full |
| 833 | + # FIXME __Full is not defined |
834 | 834 | self.__class__ = __Full |
835 | 835 |
|
836 | 836 | def get(self): |
@@ -1298,7 +1298,7 @@ def xy(self, i0=0, isub=1): |
1298 | 1298 |
|
1299 | 1299 | def plot(self, i0=0, isub=1, fig=None): |
1300 | 1300 | if fig is None: |
1301 | | - from pylab import figure, show |
| 1301 | + from pylab import figure |
1302 | 1302 | fig = figure() |
1303 | 1303 |
|
1304 | 1304 | ax = fig.add_subplot(111) |
@@ -1608,8 +1608,9 @@ def delete_masked_points(*args): |
1608 | 1608 | return margs |
1609 | 1609 |
|
1610 | 1610 |
|
| 1611 | +# FIXME I don't think this is used anywhere |
1611 | 1612 | def unmasked_index_ranges(mask, compressed=True): |
1612 | | - ''' |
| 1613 | + """ |
1613 | 1614 | Find index ranges where *mask* is *False*. |
1614 | 1615 |
|
1615 | 1616 | *mask* will be flattened if it is not already 1-D. |
@@ -1639,8 +1640,7 @@ def unmasked_index_ranges(mask, compressed=True): |
1639 | 1640 |
|
1640 | 1641 | Prior to the transforms refactoring, this was used to support |
1641 | 1642 | masked arrays in Line2D. |
1642 | | -
|
1643 | | - ''' |
| 1643 | + """ |
1644 | 1644 | mask = mask.reshape(mask.size) |
1645 | 1645 | m = np.concatenate(((1,), mask, (1,))) |
1646 | 1646 | indices = np.arange(len(mask) + 1) |
@@ -1668,79 +1668,6 @@ def unmasked_index_ranges(mask, compressed=True): |
1668 | 1668 | ls_mapper.update([(ls[1], ls[0]) for ls in _linestyles]) |
1669 | 1669 |
|
1670 | 1670 |
|
1671 | | -def less_simple_linear_interpolation(x, y, xi, extrap=False): |
1672 | | - """ |
1673 | | - This function has been moved to matplotlib.mlab -- please import |
1674 | | - it from there |
1675 | | - """ |
1676 | | - # deprecated from cbook in 0.98.4 |
1677 | | - warnings.warn('less_simple_linear_interpolation has been moved to ' |
1678 | | - 'matplotlib.mlab -- please import it from there', |
1679 | | - mplDeprecation) |
1680 | | - import matplotlib.mlab as mlab |
1681 | | - return mlab.less_simple_linear_interpolation(x, y, xi, extrap=extrap) |
1682 | | - |
1683 | | - |
1684 | | -def vector_lengths(X, P=2.0, axis=None): |
1685 | | - """ |
1686 | | - This function has been moved to matplotlib.mlab -- please import |
1687 | | - it from there |
1688 | | - """ |
1689 | | - # deprecated from cbook in 0.98.4 |
1690 | | - warnings.warn('vector_lengths has been moved to matplotlib.mlab -- ' |
1691 | | - 'please import it from there', mplDeprecation) |
1692 | | - import matplotlib.mlab as mlab |
1693 | | - return mlab.vector_lengths(X, P=2.0, axis=axis) |
1694 | | - |
1695 | | - |
1696 | | -def distances_along_curve(X): |
1697 | | - """ |
1698 | | - This function has been moved to matplotlib.mlab -- please import |
1699 | | - it from there |
1700 | | - """ |
1701 | | - # deprecated from cbook in 0.98.4 |
1702 | | - warnings.warn('distances_along_curve has been moved to matplotlib.mlab ' |
1703 | | - '-- please import it from there', mplDeprecation) |
1704 | | - import matplotlib.mlab as mlab |
1705 | | - return mlab.distances_along_curve(X) |
1706 | | - |
1707 | | - |
1708 | | -def path_length(X): |
1709 | | - """ |
1710 | | - This function has been moved to matplotlib.mlab -- please import |
1711 | | - it from there |
1712 | | - """ |
1713 | | - # deprecated from cbook in 0.98.4 |
1714 | | - warnings.warn('path_length has been moved to matplotlib.mlab ' |
1715 | | - '-- please import it from there', mplDeprecation) |
1716 | | - import matplotlib.mlab as mlab |
1717 | | - return mlab.path_length(X) |
1718 | | - |
1719 | | - |
1720 | | -def is_closed_polygon(X): |
1721 | | - """ |
1722 | | - This function has been moved to matplotlib.mlab -- please import |
1723 | | - it from there |
1724 | | - """ |
1725 | | - # deprecated from cbook in 0.98.4 |
1726 | | - warnings.warn('is_closed_polygon has been moved to matplotlib.mlab ' |
1727 | | - '-- please import it from there', mplDeprecation) |
1728 | | - import matplotlib.mlab as mlab |
1729 | | - return mlab.is_closed_polygon(X) |
1730 | | - |
1731 | | - |
1732 | | -def quad2cubic(q0x, q0y, q1x, q1y, q2x, q2y): |
1733 | | - """ |
1734 | | - This function has been moved to matplotlib.mlab -- please import |
1735 | | - it from there |
1736 | | - """ |
1737 | | - # deprecated from cbook in 0.98.4 |
1738 | | - warnings.warn('quad2cubic has been moved to matplotlib.mlab -- please ' |
1739 | | - 'import it from there', mplDeprecation) |
1740 | | - import matplotlib.mlab as mlab |
1741 | | - return mlab.quad2cubic(q0x, q0y, q1x, q1y, q2x, q2y) |
1742 | | - |
1743 | | - |
1744 | 1671 | def align_iterators(func, *iterables): |
1745 | 1672 | """ |
1746 | 1673 | This generator takes a bunch of iterables that are ordered by func |
|
0 commit comments