Commit cd2608e
committed
Avoid temporaries when preparing step plots.
The previous implementation of `pts_to_{pre,mid,post}`step was fairly
unefficient: it allocated a large array during validation (`vstack`),
then a second array to build the return tuple, then converted the
columns to a tuple, then immediately converted the tuple back to a new
array at the call site (to construct a Path). Instead, just create a
single array and work with it all along.
Also some minor related cleanups (moving imports in lines.py, in
particular not exposing the individual `pts_to_*step` functions anymore
(they are not directly used, only via the `STEP_LOOKUP_MAP` mapping).1 parent 8515322 commit cd2608eCopy full SHA for cd2608e
File tree
Expand file treeCollapse file tree
4 files changed
+78
-114
lines changedOpen diff view settings
Filter options
- doc/api/api_changes
- lib/matplotlib
- tests
Expand file treeCollapse file tree
4 files changed
+78
-114
lines changedOpen diff view settings
Collapse file
doc/api/api_changes/lines_removed_api.rst
Copy file name to clipboard+6Lines changed: 6 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
Collapse file
+54-89Lines changed: 54 additions & 89 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
2302 | 2302 | |
2303 | 2303 | |
2304 | 2304 | |
2305 | | - |
2306 | | - |
2307 | | - |
2308 | | - |
2309 | | - |
2310 | | - |
2311 | | - |
2312 | | - |
2313 | | - |
2314 | | - |
2315 | | - |
2316 | | - |
2317 | | - |
2318 | | - |
2319 | | - |
2320 | | - |
2321 | | - |
2322 | | - |
2323 | | - |
2324 | 2305 | |
2325 | 2306 | |
2326 | | - |
| 2307 | + |
2327 | 2308 | |
2328 | | - |
2329 | | - |
2330 | | - |
| 2309 | + |
| 2310 | + |
| 2311 | + |
2331 | 2312 | |
2332 | 2313 | |
2333 | 2314 | |
2334 | 2315 | |
2335 | | - |
| 2316 | + |
2336 | 2317 | |
2337 | | - |
2338 | | - |
2339 | | - |
| 2318 | + |
| 2319 | + |
2340 | 2320 | |
2341 | 2321 | |
2342 | 2322 | |
2343 | | - |
2344 | | - |
2345 | | - |
2346 | | - |
2347 | | - |
| 2323 | + |
| 2324 | + |
| 2325 | + |
| 2326 | + |
2348 | 2327 | |
2349 | 2328 | |
2350 | 2329 | |
2351 | 2330 | |
2352 | 2331 | |
2353 | | - |
2354 | | - |
2355 | | - |
2356 | | - |
2357 | | - |
2358 | | - |
2359 | | - |
2360 | | - |
2361 | | - |
| 2332 | + |
| 2333 | + |
| 2334 | + |
| 2335 | + |
| 2336 | + |
| 2337 | + |
| 2338 | + |
| 2339 | + |
2362 | 2340 | |
2363 | 2341 | |
2364 | 2342 | |
2365 | 2343 | |
2366 | | - |
| 2344 | + |
2367 | 2345 | |
2368 | | - |
2369 | | - |
2370 | | - |
| 2346 | + |
| 2347 | + |
| 2348 | + |
2371 | 2349 | |
2372 | 2350 | |
2373 | 2351 | |
2374 | 2352 | |
2375 | | - |
| 2353 | + |
2376 | 2354 | |
2377 | | - |
2378 | | - |
2379 | | - |
| 2355 | + |
| 2356 | + |
2380 | 2357 | |
2381 | 2358 | |
2382 | 2359 | |
2383 | | - |
2384 | | - |
2385 | | - |
2386 | | - |
2387 | | - |
| 2360 | + |
| 2361 | + |
| 2362 | + |
| 2363 | + |
2388 | 2364 | |
2389 | 2365 | |
2390 | 2366 | |
2391 | 2367 | |
2392 | 2368 | |
2393 | | - |
2394 | | - |
2395 | | - |
2396 | | - |
2397 | | - |
2398 | | - |
2399 | | - |
2400 | | - |
2401 | | - |
2402 | | - |
| 2369 | + |
| 2370 | + |
| 2371 | + |
| 2372 | + |
| 2373 | + |
| 2374 | + |
2403 | 2375 | |
2404 | 2376 | |
2405 | 2377 | |
2406 | 2378 | |
2407 | | - |
| 2379 | + |
2408 | 2380 | |
2409 | | - |
2410 | | - |
2411 | | - |
| 2381 | + |
| 2382 | + |
| 2383 | + |
2412 | 2384 | |
2413 | 2385 | |
2414 | 2386 | |
2415 | 2387 | |
2416 | | - |
| 2388 | + |
2417 | 2389 | |
2418 | | - |
2419 | | - |
2420 | | - |
| 2390 | + |
| 2391 | + |
2421 | 2392 | |
2422 | 2393 | |
2423 | 2394 | |
2424 | | - |
2425 | | - |
2426 | | - |
2427 | | - |
2428 | | - |
| 2395 | + |
| 2396 | + |
| 2397 | + |
| 2398 | + |
2429 | 2399 | |
2430 | 2400 | |
2431 | 2401 | |
2432 | 2402 | |
2433 | 2403 | |
2434 | | - |
2435 | | - |
2436 | | - |
2437 | | - |
2438 | | - |
2439 | | - |
2440 | | - |
2441 | | - |
2442 | | - |
2443 | | - |
2444 | | - |
2445 | | - |
| 2404 | + |
| 2405 | + |
| 2406 | + |
| 2407 | + |
| 2408 | + |
| 2409 | + |
| 2410 | + |
2446 | 2411 | |
2447 | 2412 | |
2448 | 2413 | |
|
Collapse file
+11-14Lines changed: 11 additions & 14 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
12 | 12 | |
13 | 13 | |
14 | 14 | |
15 | | - |
16 | | - |
17 | | - |
18 | | - |
19 | | - |
20 | | - |
21 | 15 | |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
22 | 22 | |
23 | 23 | |
24 | 24 | |
25 | | - |
26 | | - |
27 | | - |
28 | | - |
29 | 25 | |
30 | 26 | |
31 | | - |
32 | | - |
| 27 | + |
| 28 | + |
| 29 | + |
33 | 30 | |
34 | | - |
35 | | - |
| 31 | + |
| 32 | + |
36 | 33 | |
37 | 34 | |
38 | 35 | |
|
Collapse file
lib/matplotlib/tests/test_cbook.py
Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_cbook.py+7-11Lines changed: 7 additions & 11 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
460 | 460 | |
461 | 461 | |
462 | 462 | |
463 | | - |
| 463 | + |
| 464 | + |
| 465 | + |
| 466 | + |
| 467 | + |
| 468 | + |
464 | 469 | |
465 | | - |
466 | | - |
467 | | - |
468 | | - |
469 | | - |
470 | | - |
471 | | - |
472 | | - |
473 | | - |
474 | | - |
| 470 | + |
475 | 471 | |
476 | 472 | |
477 | 473 | |
|
0 commit comments