| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,4 @@ | |||
| 1 | + Passing inconsistent ``loc`` and ``nth_coord`` to axisartist helpers | ||
| 2 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 3 | + Trying to construct for example a "top y-axis" or a "left x-axis" is now | ||
| 4 | + deprecated. | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -126,12 +126,17 @@ class Fixed(_Base): | |||
| 126 | 126 | ||
| 127 | 127 | def __init__(self, loc, nth_coord=None): | |
| 128 | 128 | """``nth_coord = 0``: x-axis; ``nth_coord = 1``: y-axis.""" | |
| 129 | - _api.check_in_list(["left", "right", "bottom", "top"], loc=loc) | ||
| 130 | - self._loc = loc | ||
| 131 | - self._pos = {"bottom": 0, "top": 1, "left": 0, "right": 1}[loc] | ||
| 132 | 129 | self.nth_coord = ( | |
| 133 | 130 | nth_coord if nth_coord is not None else | |
| 134 | - {"bottom": 0, "top": 0, "left": 1, "right": 1}[loc]) | ||
| 131 | + _api.check_getitem( | ||
| 132 | + {"bottom": 0, "top": 0, "left": 1, "right": 1}, loc=loc)) | ||
| 133 | + if (nth_coord == 0 and loc not in ["left", "right"] | ||
| 134 | + or nth_coord == 1 and loc not in ["bottom", "top"]): | ||
| 135 | + _api.warn_deprecated( | ||
| 136 | + "3.7", message=f"{loc=!r} is incompatible with " | ||
| 137 | + "{nth_coord=}; support is deprecated since %(since)s") | ||
| 138 | + self._loc = loc | ||
| 139 | + self._pos = {"bottom": 0, "top": 1, "left": 0, "right": 1}[loc] | ||
| 135 | 140 | super().__init__() | |
| 136 | 141 | # axis line in transAxes | |
| 137 | 142 | self._path = Path(self._to_xy((0, 1), const=self._pos)) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments