| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent f3938be commit 2b54261
12 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1511,13 +1511,13 @@ def get_ticklocs(self, *, minor=False): | |||
| 1511 | 1511 | ||
| 1512 | 1512 | Returns | |
| 1513 | 1513 | ------- | |
| 1514 | - numpy array of tick locations | ||
| 1514 | + array of tick locations | ||
| 1515 | 1515 | """ | |
| 1516 | 1516 | return self.get_minorticklocs() if minor else self.get_majorticklocs() | |
| 1517 | 1517 | ||
| 1518 | 1518 | def get_ticks_direction(self, minor=False): | |
| 1519 | 1519 | """ | |
| 1520 | - Get the tick directions as a numpy array | ||
| 1520 | + Return an array of this Axis' tick directions. | ||
| 1521 | 1521 | ||
| 1522 | 1522 | Parameters | |
| 1523 | 1523 | ---------- | |
@@ -1527,7 +1527,7 @@ def get_ticks_direction(self, minor=False): | |||
| 1527 | 1527 | ||
| 1528 | 1528 | Returns | |
| 1529 | 1529 | ------- | |
| 1530 | - numpy array of tick directions | ||
| 1530 | + array of tick directions | ||
| 1531 | 1531 | """ | |
| 1532 | 1532 | if minor: | |
| 1533 | 1533 | return np.array( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -694,7 +694,6 @@ def points_to_pixels(self, points): | |||
| 694 | 694 | Parameters | |
| 695 | 695 | ---------- | |
| 696 | 696 | points : float or array-like | |
| 697 | - a float or a numpy array of float | ||
| 698 | 697 | ||
| 699 | 698 | Returns | |
| 700 | 699 | ------- | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2237,7 +2237,7 @@ def _unpack_to_numpy(x): | |||
| 2237 | 2237 | # If numpy, return directly | |
| 2238 | 2238 | return x | |
| 2239 | 2239 | if hasattr(x, 'to_numpy'): | |
| 2240 | - # Assume that any function to_numpy() do actually return a numpy array | ||
| 2240 | + # Assume that any to_numpy() method actually returns a numpy array | ||
| 2241 | 2241 | return x.to_numpy() | |
| 2242 | 2242 | if hasattr(x, 'values'): | |
| 2243 | 2243 | xtmp = x.values | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2050,8 +2050,7 @@ def inverse(self, value): | |||
| 2050 | 2050 | ||
| 2051 | 2051 | def rgb_to_hsv(arr): | |
| 2052 | 2052 | """ | |
| 2053 | - Convert float RGB values (in the range [0, 1]), in a numpy array to HSV | ||
| 2054 | - values. | ||
| 2053 | + Convert an array of float RGB values (in the range [0, 1]) to HSV values. | ||
| 2055 | 2054 | ||
| 2056 | 2055 | Parameters | |
| 2057 | 2056 | ---------- | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -383,8 +383,6 @@ def _from_ordinalf(x, tz=None): | |||
| 383 | 383 | ||
| 384 | 384 | # a version of _from_ordinalf that can operate on numpy arrays | |
| 385 | 385 | _from_ordinalf_np_vectorized = np.vectorize(_from_ordinalf, otypes="O") | |
| 386 | - | ||
| 387 | - | ||
| 388 | 386 | # a version of dateutil.parser.parse that can operate on numpy arrays | |
| 389 | 387 | _dateutil_parser_parse_np_vectorized = np.vectorize(dateutil.parser.parse) | |
| 390 | 388 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1928,13 +1928,11 @@ def _make_array(inp): | |||
| 1928 | 1928 | ||
| 1929 | 1929 | We need to have this internal function rather than | |
| 1930 | 1930 | ``np.asarray(..., dtype=object)`` so that a list of lists | |
| 1931 | - of lists does not get converted to an array of dimension > | ||
| 1932 | - 2 | ||
| 1931 | + of lists does not get converted to an array of dimension > 2. | ||
| 1933 | 1932 | ||
| 1934 | 1933 | Returns | |
| 1935 | 1934 | ------- | |
| 1936 | 1935 | 2D object array | |
| 1937 | - | ||
| 1938 | 1936 | """ | |
| 1939 | 1937 | r0, *rest = inp | |
| 1940 | 1938 | if isinstance(r0, str): | |
@@ -1960,13 +1958,13 @@ def _identify_keys_and_nested(mosaic): | |||
| 1960 | 1958 | ||
| 1961 | 1959 | Parameters | |
| 1962 | 1960 | ---------- | |
| 1963 | - mosaic : 2D numpy object array | ||
| 1961 | + mosaic : 2D object array | ||
| 1964 | 1962 | ||
| 1965 | 1963 | Returns | |
| 1966 | 1964 | ------- | |
| 1967 | 1965 | unique_ids : tuple | |
| 1968 | 1966 | The unique non-sub mosaic entries in this mosaic | |
| 1969 | - nested : dict[tuple[int, int]], 2D object array | ||
| 1967 | + nested : dict[tuple[int, int], 2D object array] | ||
| 1970 | 1968 | """ | |
| 1971 | 1969 | # make sure we preserve the user supplied order | |
| 1972 | 1970 | unique_ids = cbook._OrderedSet() | |
@@ -1990,7 +1988,7 @@ def _do_layout(gs, mosaic, unique_ids, nested): | |||
| 1990 | 1988 | ---------- | |
| 1991 | 1989 | gs : GridSpec | |
| 1992 | 1990 | mosaic : 2D object array | |
| 1993 | - The input converted to a 2D numpy array for this level. | ||
| 1991 | + The input converted to a 2D array for this level. | ||
| 1994 | 1992 | unique_ids : tuple | |
| 1995 | 1993 | The identified scalar labels at this level of nesting. | |
| 1996 | 1994 | nested : dict[tuple[int, int]], 2D object array | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1125,7 +1125,7 @@ def get_xy(self): | |||
| 1125 | 1125 | ||
| 1126 | 1126 | Returns | |
| 1127 | 1127 | ------- | |
| 1128 | - (N, 2) numpy array | ||
| 1128 | + (N, 2) array | ||
| 1129 | 1129 | The coordinates of the vertices. | |
| 1130 | 1130 | """ | |
| 1131 | 1131 | return self._path.vertices | |
@@ -1164,7 +1164,7 @@ def set_xy(self, xy): | |||
| 1164 | 1164 | self.stale = True | |
| 1165 | 1165 | ||
| 1166 | 1166 | xy = property(get_xy, set_xy, | |
| 1167 | - doc='The vertices of the path as (N, 2) numpy array.') | ||
| 1167 | + doc='The vertices of the path as a (N, 2) array.') | ||
| 1168 | 1168 | ||
| 1169 | 1169 | ||
| 1170 | 1170 | class Wedge(Patch): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -166,8 +166,8 @@ def _fast_from_codes_and_verts(cls, verts, codes, internals_from=None): | |||
| 166 | 166 | ||
| 167 | 167 | Parameters | |
| 168 | 168 | ---------- | |
| 169 | - verts : numpy array | ||
| 170 | - codes : numpy array | ||
| 169 | + verts : array-like | ||
| 170 | + codes : array | ||
| 171 | 171 | internals_from : Path or None | |
| 172 | 172 | If not None, another `Path` from which the attributes | |
| 173 | 173 | ``should_simplify``, ``simplify_threshold``, and | |
@@ -223,12 +223,12 @@ def vertices(self, vertices): | |||
| 223 | 223 | @property | |
| 224 | 224 | def codes(self): | |
| 225 | 225 | """ | |
| 226 | - The list of codes in the `Path` as a 1D numpy array. Each | ||
| 227 | - code is one of `STOP`, `MOVETO`, `LINETO`, `CURVE3`, `CURVE4` | ||
| 228 | - or `CLOSEPOLY`. For codes that correspond to more than one | ||
| 229 | - vertex (`CURVE3` and `CURVE4`), that code will be repeated so | ||
| 230 | - that the length of `vertices` and `codes` is always | ||
| 231 | - the same. | ||
| 226 | + The list of codes in the `Path` as a 1D array. | ||
| 227 | + | ||
| 228 | + Each code is one of `STOP`, `MOVETO`, `LINETO`, `CURVE3`, `CURVE4` or | ||
| 229 | + `CLOSEPOLY`. For codes that correspond to more than one vertex | ||
| 230 | + (`CURVE3` and `CURVE4`), that code will be repeated so that the length | ||
| 231 | + of `vertices` and `codes` is always the same. | ||
| 232 | 232 | """ | |
| 233 | 233 | return self._codes | |
| 234 | 234 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -78,19 +78,15 @@ def get_text_path(self, prop, s, ismath=False): | |||
| 78 | 78 | ---------- | |
| 79 | 79 | prop : `~matplotlib.font_manager.FontProperties` | |
| 80 | 80 | The font properties for the text. | |
| 81 | - | ||
| 82 | 81 | s : str | |
| 83 | 82 | The text to be converted. | |
| 84 | - | ||
| 85 | 83 | ismath : {False, True, "TeX"} | |
| 86 | 84 | If True, use mathtext parser. If "TeX", use tex for rendering. | |
| 87 | 85 | ||
| 88 | 86 | Returns | |
| 89 | 87 | ------- | |
| 90 | 88 | verts : list | |
| 91 | - A list of numpy arrays containing the x and y coordinates of the | ||
| 92 | - vertices. | ||
| 93 | - | ||
| 89 | + A list of arrays containing the (x, y) coordinates of the vertices. | ||
| 94 | 90 | codes : list | |
| 95 | 91 | A list of path codes. | |
| 96 | 92 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -830,11 +830,10 @@ def from_extents(*args, minpos=None): | |||
| 830 | 830 | ---------- | |
| 831 | 831 | left, bottom, right, top : float | |
| 832 | 832 | The four extents of the bounding box. | |
| 833 | - | ||
| 834 | 833 | minpos : float or None | |
| 835 | - If this is supplied, the Bbox will have a minimum positive value | ||
| 836 | - set. This is useful when dealing with logarithmic scales and other | ||
| 837 | - scales where negative bounds result in floating point errors. | ||
| 834 | + If this is supplied, the Bbox will have a minimum positive value | ||
| 835 | + set. This is useful when dealing with logarithmic scales and other | ||
| 836 | + scales where negative bounds result in floating point errors. | ||
| 838 | 837 | """ | |
| 839 | 838 | bbox = Bbox(np.reshape(args, (2, 2))) | |
| 840 | 839 | if minpos is not None: | |
@@ -858,11 +857,10 @@ def ignore(self, value): | |||
| 858 | 857 | by subsequent calls to :meth:`update_from_data_xy`. | |
| 859 | 858 | ||
| 860 | 859 | value : bool | |
| 861 | - - When ``True``, subsequent calls to :meth:`update_from_data_xy` | ||
| 862 | - will ignore the existing bounds of the `Bbox`. | ||
| 863 | - | ||
| 864 | - - When ``False``, subsequent calls to :meth:`update_from_data_xy` | ||
| 865 | - will include the existing bounds of the `Bbox`. | ||
| 860 | + - When ``True``, subsequent calls to `update_from_data_xy` will | ||
| 861 | + ignore the existing bounds of the `Bbox`. | ||
| 862 | + - When ``False``, subsequent calls to `update_from_data_xy` will | ||
| 863 | + include the existing bounds of the `Bbox`. | ||
| 866 | 864 | """ | |
| 867 | 865 | self._ignore = value | |
| 868 | 866 | ||
@@ -875,12 +873,10 @@ def update_from_path(self, path, ignore=None, updatex=True, updatey=True): | |||
| 875 | 873 | Parameters | |
| 876 | 874 | ---------- | |
| 877 | 875 | path : `~matplotlib.path.Path` | |
| 878 | - | ||
| 879 | 876 | ignore : bool, optional | |
| 880 | - - when ``True``, ignore the existing bounds of the `Bbox`. | ||
| 881 | - - when ``False``, include the existing bounds of the `Bbox`. | ||
| 882 | - - when ``None``, use the last value passed to :meth:`ignore`. | ||
| 883 | - | ||
| 877 | + - When ``True``, ignore the existing bounds of the `Bbox`. | ||
| 878 | + - When ``False``, include the existing bounds of the `Bbox`. | ||
| 879 | + - When ``None``, use the last value passed to :meth:`ignore`. | ||
| 884 | 880 | updatex, updatey : bool, default: True | |
| 885 | 881 | When ``True``, update the x/y values. | |
| 886 | 882 | """ | |
@@ -912,7 +908,6 @@ def update_from_data_x(self, x, ignore=None): | |||
| 912 | 908 | ---------- | |
| 913 | 909 | x : `~numpy.ndarray` | |
| 914 | 910 | Array of x-values. | |
| 915 | - | ||
| 916 | 911 | ignore : bool, optional | |
| 917 | 912 | - When ``True``, ignore the existing bounds of the `Bbox`. | |
| 918 | 913 | - When ``False``, include the existing bounds of the `Bbox`. | |
@@ -932,34 +927,32 @@ def update_from_data_y(self, y, ignore=None): | |||
| 932 | 927 | ---------- | |
| 933 | 928 | y : `~numpy.ndarray` | |
| 934 | 929 | Array of y-values. | |
| 935 | - | ||
| 936 | 930 | ignore : bool, optional | |
| 937 | - - When ``True``, ignore the existing bounds of the `Bbox`. | ||
| 938 | - - When ``False``, include the existing bounds of the `Bbox`. | ||
| 939 | - - When ``None``, use the last value passed to :meth:`ignore`. | ||
| 931 | + - When ``True``, ignore the existing bounds of the `Bbox`. | ||
| 932 | + - When ``False``, include the existing bounds of the `Bbox`. | ||
| 933 | + - When ``None``, use the last value passed to :meth:`ignore`. | ||
| 940 | 934 | """ | |
| 941 | 935 | y = np.ravel(y) | |
| 942 | 936 | self.update_from_data_xy(np.column_stack([np.ones(y.size), y]), | |
| 943 | 937 | ignore=ignore, updatex=False) | |
| 944 | 938 | ||
| 945 | 939 | def update_from_data_xy(self, xy, ignore=None, updatex=True, updatey=True): | |
| 946 | 940 | """ | |
| 947 | - Update the bounds of the `Bbox` based on the passed in data. After | ||
| 948 | - updating, the bounds will have positive *width* and *height*; | ||
| 941 | + Update the `Bbox` bounds based on the passed in *xy* coordinates. | ||
| 942 | + | ||
| 943 | + After updating, the bounds will have positive *width* and *height*; | ||
| 949 | 944 | *x0* and *y0* will be the minimal values. | |
| 950 | 945 | ||
| 951 | 946 | Parameters | |
| 952 | 947 | ---------- | |
| 953 | - xy : `~numpy.ndarray` | ||
| 954 | - A numpy array of 2D points. | ||
| 955 | - | ||
| 948 | + xy : (N, 2) array-like | ||
| 949 | + The (x, y) coordinates. | ||
| 956 | 950 | ignore : bool, optional | |
| 957 | - - When ``True``, ignore the existing bounds of the `Bbox`. | ||
| 958 | - - When ``False``, include the existing bounds of the `Bbox`. | ||
| 959 | - - When ``None``, use the last value passed to :meth:`ignore`. | ||
| 960 | - | ||
| 951 | + - When ``True``, ignore the existing bounds of the `Bbox`. | ||
| 952 | + - When ``False``, include the existing bounds of the `Bbox`. | ||
| 953 | + - When ``None``, use the last value passed to :meth:`ignore`. | ||
| 961 | 954 | updatex, updatey : bool, default: True | |
| 962 | - When ``True``, update the x/y values. | ||
| 955 | + When ``True``, update the x/y values. | ||
| 963 | 956 | """ | |
| 964 | 957 | if len(xy) == 0: | |
| 965 | 958 | return | |
@@ -1051,17 +1044,17 @@ def minposy(self): | |||
| 1051 | 1044 | ||
| 1052 | 1045 | def get_points(self): | |
| 1053 | 1046 | """ | |
| 1054 | - Get the points of the bounding box directly as a numpy array | ||
| 1055 | - of the form: ``[[x0, y0], [x1, y1]]``. | ||
| 1047 | + Get the points of the bounding box as an array of the form | ||
| 1048 | + ``[[x0, y0], [x1, y1]]``. | ||
| 1056 | 1049 | """ | |
| 1057 | 1050 | self._invalid = 0 | |
| 1058 | 1051 | return self._points | |
| 1059 | 1052 | ||
| 1060 | 1053 | def set_points(self, points): | |
| 1061 | 1054 | """ | |
| 1062 | - Set the points of the bounding box directly from a numpy array | ||
| 1063 | - of the form: ``[[x0, y0], [x1, y1]]``. No error checking is | ||
| 1064 | - performed, as this method is mainly for internal use. | ||
| 1055 | + Set the points of the bounding box directly from an array of the form | ||
| 1056 | + ``[[x0, y0], [x1, y1]]``. No error checking is performed, as this | ||
| 1057 | + method is mainly for internal use. | ||
| 1065 | 1058 | """ | |
| 1066 | 1059 | if np.any(self._points != points): | |
| 1067 | 1060 | self._points = points | |
@@ -1483,14 +1476,14 @@ def transform(self, values): | |||
| 1483 | 1476 | ||
| 1484 | 1477 | Parameters | |
| 1485 | 1478 | ---------- | |
| 1486 | - values : array | ||
| 1487 | - The input values as NumPy array of length :attr:`input_dims` or | ||
| 1479 | + values : array-like | ||
| 1480 | + The input values as an array of length :attr:`input_dims` or | ||
| 1488 | 1481 | shape (N, :attr:`input_dims`). | |
| 1489 | 1482 | ||
| 1490 | 1483 | Returns | |
| 1491 | 1484 | ------- | |
| 1492 | 1485 | array | |
| 1493 | - The output values as NumPy array of length :attr:`output_dims` or | ||
| 1486 | + The output values as an array of length :attr:`output_dims` or | ||
| 1494 | 1487 | shape (N, :attr:`output_dims`), depending on the input. | |
| 1495 | 1488 | """ | |
| 1496 | 1489 | # Ensure that values is a 2d array (but remember whether | |
@@ -1529,13 +1522,13 @@ def transform_affine(self, values): | |||
| 1529 | 1522 | Parameters | |
| 1530 | 1523 | ---------- | |
| 1531 | 1524 | values : array | |
| 1532 | - The input values as NumPy array of length :attr:`input_dims` or | ||
| 1525 | + The input values as an array of length :attr:`input_dims` or | ||
| 1533 | 1526 | shape (N, :attr:`input_dims`). | |
| 1534 | 1527 | ||
| 1535 | 1528 | Returns | |
| 1536 | 1529 | ------- | |
| 1537 | 1530 | array | |
| 1538 | - The output values as NumPy array of length :attr:`output_dims` or | ||
| 1531 | + The output values as an array of length :attr:`output_dims` or | ||
| 1539 | 1532 | shape (N, :attr:`output_dims`), depending on the input. | |
| 1540 | 1533 | """ | |
| 1541 | 1534 | return self.get_affine().transform(values) | |
@@ -1554,13 +1547,13 @@ def transform_non_affine(self, values): | |||
| 1554 | 1547 | Parameters | |
| 1555 | 1548 | ---------- | |
| 1556 | 1549 | values : array | |
| 1557 | - The input values as NumPy array of length :attr:`input_dims` or | ||
| 1550 | + The input values as an array of length :attr:`input_dims` or | ||
| 1558 | 1551 | shape (N, :attr:`input_dims`). | |
| 1559 | 1552 | ||
| 1560 | 1553 | Returns | |
| 1561 | 1554 | ------- | |
| 1562 | 1555 | array | |
| 1563 | - The output values as NumPy array of length :attr:`output_dims` or | ||
| 1556 | + The output values as an array of length :attr:`output_dims` or | ||
| 1564 | 1557 | shape (N, :attr:`output_dims`), depending on the input. | |
| 1565 | 1558 | """ | |
| 1566 | 1559 | return values | |
@@ -1932,7 +1925,7 @@ def from_values(a, b, c, d, e, f): | |||
| 1932 | 1925 | ||
| 1933 | 1926 | def get_matrix(self): | |
| 1934 | 1927 | """ | |
| 1935 | - Get the underlying transformation matrix as a 3x3 numpy array:: | ||
| 1928 | + Get the underlying transformation matrix as a 3x3 array:: | ||
| 1936 | 1929 | ||
| 1937 | 1930 | a c e | |
| 1938 | 1931 | b d f | |
@@ -1947,7 +1940,7 @@ def get_matrix(self): | |||
| 1947 | 1940 | ||
| 1948 | 1941 | def set_matrix(self, mtx): | |
| 1949 | 1942 | """ | |
| 1950 | - Set the underlying transformation matrix from a 3x3 numpy array:: | ||
| 1943 | + Set the underlying transformation matrix from a 3x3 array:: | ||
| 1951 | 1944 | ||
| 1952 | 1945 | a c e | |
| 1953 | 1946 | b d f | |
| Back | FazBrowse Home | New Git URL |
0 commit comments