| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -170,7 +170,7 @@ def __init__(self, hatch, density): | |||
| 170 | 170 | path = Path.unit_regular_star(5) | |
| 171 | 171 | self.shape_vertices = path.vertices | |
| 172 | 172 | self.shape_codes = np.full(len(self.shape_vertices), Path.LINETO, | |
| 173 | - dtype=np.int32) | ||
| 173 | + dtype=Path.code_type) | ||
| 174 | 174 | self.shape_codes[0] = Path.MOVETO | |
| 175 | 175 | Shapes.__init__(self, hatch, density) | |
| 176 | 176 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -231,7 +231,7 @@ def create_artists(self, legend, orig_handle, | |||
| 231 | 231 | xdata, xdata_marker = self.get_xdata(legend, xdescent, ydescent, | |
| 232 | 232 | width, height, fontsize) | |
| 233 | 233 | ||
| 234 | - ydata = np.full(xdata.shape, ((height - ydescent) / 2), float) | ||
| 234 | + ydata = np.full_like(xdata, ((height - ydescent) / 2)) | ||
| 235 | 235 | legline = Line2D(xdata, ydata) | |
| 236 | 236 | ||
| 237 | 237 | self.update_prop(legline, orig_handle, legend) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -552,7 +552,7 @@ def interpolated(self, steps): | |||
| 552 | 552 | vertices = simple_linear_interpolation(self.vertices, steps) | |
| 553 | 553 | codes = self.codes | |
| 554 | 554 | if codes is not None: | |
| 555 | - new_codes = np.full(((len(codes) - 1) * steps + 1, ), Path.LINETO, | ||
| 555 | + new_codes = np.full((len(codes) - 1) * steps + 1, Path.LINETO, | ||
| 556 | 556 | dtype=self.code_type) | |
| 557 | 557 | new_codes[0::steps] = codes | |
| 558 | 558 | else: | |
@@ -865,7 +865,7 @@ def arc(cls, theta1, theta2, n=None, is_wedge=False): | |||
| 865 | 865 | if is_wedge: | |
| 866 | 866 | length = n * 3 + 4 | |
| 867 | 867 | vertices = np.zeros((length, 2), float) | |
| 868 | - codes = np.full((length, ), cls.CURVE4, dtype=cls.code_type) | ||
| 868 | + codes = np.full(length, cls.CURVE4, dtype=cls.code_type) | ||
| 869 | 869 | vertices[1] = [xA[0], yA[0]] | |
| 870 | 870 | codes[0:2] = [cls.MOVETO, cls.LINETO] | |
| 871 | 871 | codes[-2:] = [cls.LINETO, cls.CLOSEPOLY] | |
@@ -874,7 +874,7 @@ def arc(cls, theta1, theta2, n=None, is_wedge=False): | |||
| 874 | 874 | else: | |
| 875 | 875 | length = n * 3 + 1 | |
| 876 | 876 | vertices = np.empty((length, 2), float) | |
| 877 | - codes = np.full((length, ), cls.CURVE4, dtype=cls.code_type) | ||
| 877 | + codes = np.full(length, cls.CURVE4, dtype=cls.code_type) | ||
| 878 | 878 | vertices[0] = [xA[0], yA[0]] | |
| 879 | 879 | codes[0] = cls.MOVETO | |
| 880 | 880 | vertex_offset = 1 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -238,12 +238,8 @@ def _refine_triangulation_once(triangulation, ancestors=None): | |||
| 238 | 238 | # (can be -1 if border edge) | |
| 239 | 239 | # For slave and master we will identify the apex pointing to the edge | |
| 240 | 240 | # start | |
| 241 | - edge_elems = np.ravel(np.vstack([np.arange(ntri, dtype=np.int32), | ||
| 242 | - np.arange(ntri, dtype=np.int32), | ||
| 243 | - np.arange(ntri, dtype=np.int32)])) | ||
| 244 | - edge_apexes = np.ravel(np.vstack([np.zeros(ntri, dtype=np.int32), | ||
| 245 | - np.ones(ntri, dtype=np.int32), | ||
| 246 | - np.full(ntri, 2, dtype=np.int32)])) | ||
| 241 | + edge_elems = np.tile(np.arange(3, dtype=np.int32), ntri) | ||
| 242 | + edge_apexes = np.repeat(np.arange(3, dtype=np.int32), ntri) | ||
| 247 | 243 | edge_neighbors = neighbors[edge_elems, edge_apexes] | |
| 248 | 244 | mask_masters = (edge_elems > edge_neighbors) | |
| 249 | 245 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments