Commit 2a4566f
committed
Fix test failures: dtype guards and preconditioner/callback_type validation order
- _iterative.py: raise NotImplementedError for M != None *before* the
_HOST_N_THRESHOLD SciPy fast-path in cg() and gmres(), so the contract
is enforced regardless of system size (fixes test_cg_preconditioner_unsupported_raises,
test_gmres_preconditioner_unsupported_raises).
- _iterative.py: validate callback_type and raise NotImplementedError for
'pr_norm' *before* the _HOST_N_THRESHOLD branch in gmres(), so small-n
systems also see the error (fixes test_gmres_callback_type_pr_norm_raises).
- _iterative.py: pass callback_type='legacy' to scipy.sparse.linalg.gmres
when delegating on the fast path to suppress SciPy DeprecationWarning.
- test_scipy_sparse_linalg.py: add dtype=numpy.float64 to expected arange()
calls in test_identity_operator and test_gmres_happy_breakdown so strict
NumPy 2.0 dtype-equality checks pass (float64 result vs int64 expected).1 parent 6910332 commit 2a4566f
2 files changed
Lines changed: 47 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
| 254 | + | |
255 | 255 | | |
256 | 256 | | |
257 | 257 | | |
| |||
260 | 260 | | |
261 | 261 | | |
262 | 262 | | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
263 | 270 | | |
264 | 271 | | |
265 | 272 | | |
| |||
350 | 357 | | |
351 | 358 | | |
352 | 359 | | |
353 | | - | |
354 | | - | |
355 | | - | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
356 | 364 | | |
357 | 365 | | |
358 | 366 | | |
359 | 367 | | |
360 | 368 | | |
361 | 369 | | |
362 | 370 | | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
363 | 389 | | |
364 | 390 | | |
365 | 391 | | |
| |||
374 | 400 | | |
375 | 401 | | |
376 | 402 | | |
377 | | - | |
378 | | - | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
379 | 407 | | |
380 | 408 | | |
381 | 409 | | |
| |||
384 | 412 | | |
385 | 413 | | |
386 | 414 | | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
| 415 | + | |
391 | 416 | | |
392 | 417 | | |
393 | 418 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
| 24 | + | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | | - | |
371 | | - | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
372 | 373 | | |
373 | 374 | | |
374 | 375 | | |
| |||
505 | 506 | | |
506 | 507 | | |
507 | 508 | | |
| 509 | + | |
508 | 510 | | |
509 | 511 | | |
510 | 512 | | |
| |||
610 | 612 | | |
611 | 613 | | |
612 | 614 | | |
613 | | - | |
| 615 | + | |
| 616 | + | |
614 | 617 | | |
615 | 618 | | |
616 | 619 | | |
| |||
672 | 675 | | |
673 | 676 | | |
674 | 677 | | |
| 678 | + | |
675 | 679 | | |
676 | 680 | | |
677 | 681 | | |
| |||
680 | 684 | | |
681 | 685 | | |
682 | 686 | | |
| 687 | + | |
683 | 688 | | |
684 | 689 | | |
685 | 690 | | |
| |||
715 | 720 | | |
716 | 721 | | |
717 | 722 | | |
718 | | - | |
| 723 | + | |
| 724 | + | |
719 | 725 | | |
720 | 726 | | |
721 | 727 | | |
| |||
0 commit comments