Repository navigation
Commit c7078c7
TST: carry #1177's interrupt tests onto the reseeded serial loop
The rebase onto develop was clean in three files and left one add/add
conflict in __run_in_serial: both sides bind a name before the try so the
handlers cannot meet it unbound. #1177 binds inputs_json for the
KeyboardInterrupt handler, this branch binds sim_idx for the Exception one.
Both are kept; dropping either puts back the UnboundLocalError the other
side had just removed.
Keeping both then pushed the function to 27 statements, two over
max-statements, so the error-file append the two handlers had copies of
moved into __record_failed_inputs. The guard travels with it: the error
file is created in __setup_files, so appending "" to it was already a
no-op, and the unconditional copy and the guarded one did the same thing.
What the merge could not show is that #1177's tests were written against
the loop this branch replaces:
- _InterruptingMonteCarlo stubs only what __run_in_serial touched, and the
loop now also calls __seed_this_simulation, which reads models the double
has none of. Stubbed, like the other name-mangled members; seeding is
pinned by test_monte_carlo_seeding.py.
- Its rows carried no run_root, so the append test tripped the guard for
studies written before that check existed instead of exercising the
continuation. The double now writes the root the way the real row
builders do, the inputs file whole and the outputs file by digest.
- _SimMonitor.keep_simulating is now claim_next_index, and one test
monkeypatches it by name.
- Serial numbering now starts at zero, as the parallel path always did, so
the three tests reading indices off disk expected 1, 2, 3 where a run
writes 0, 1, 2.
tests/unit/simulation: 322 passed, 8 skipped. ruff clean, pylint 10.00.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent a5a47c4 commit c7078c7
2 files changed
Lines changed: 65 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
656 | 656 | | |
657 | 657 | | |
658 | 658 | | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
659 | 681 | | |
660 | 682 | | |
661 | 683 | | |
| |||
692 | 714 | | |
693 | 715 | | |
694 | 716 | | |
695 | | - | |
696 | | - | |
697 | | - | |
| 717 | + | |
698 | 718 | | |
699 | 719 | | |
700 | 720 | | |
701 | 721 | | |
702 | | - | |
703 | | - | |
| 722 | + | |
704 | 723 | | |
705 | 724 | | |
706 | 725 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
797 | 797 | | |
798 | 798 | | |
799 | 799 | | |
800 | | - | |
| 800 | + | |
| 801 | + | |
| 802 | + | |
801 | 803 | | |
802 | 804 | | |
803 | 805 | | |
| |||
814 | 816 | | |
815 | 817 | | |
816 | 818 | | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
817 | 822 | | |
818 | 823 | | |
819 | 824 | | |
820 | 825 | | |
821 | 826 | | |
822 | 827 | | |
823 | 828 | | |
824 | | - | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
| 833 | + | |
| 834 | + | |
| 835 | + | |
| 836 | + | |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
| 842 | + | |
825 | 843 | | |
826 | 844 | | |
827 | | - | |
| 845 | + | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
828 | 859 | | |
829 | 860 | | |
830 | 861 | | |
| |||
871 | 902 | | |
872 | 903 | | |
873 | 904 | | |
874 | | - | |
| 905 | + | |
875 | 906 | | |
876 | 907 | | |
877 | 908 | | |
| |||
892 | 923 | | |
893 | 924 | | |
894 | 925 | | |
895 | | - | |
| 926 | + | |
896 | 927 | | |
897 | 928 | | |
898 | 929 | | |
899 | 930 | | |
900 | 931 | | |
901 | 932 | | |
902 | 933 | | |
903 | | - | |
| 934 | + | |
904 | 935 | | |
905 | 936 | | |
906 | 937 | | |
907 | 938 | | |
908 | 939 | | |
909 | 940 | | |
910 | 941 | | |
911 | | - | |
| 942 | + | |
912 | 943 | | |
913 | 944 | | |
914 | 945 | | |
| |||
1131 | 1162 | | |
1132 | 1163 | | |
1133 | 1164 | | |
1134 | | - | |
| 1165 | + | |
1135 | 1166 | | |
1136 | 1167 | | |
1137 | 1168 | | |
| |||
1141 | 1172 | | |
1142 | 1173 | | |
1143 | 1174 | | |
1144 | | - | |
| 1175 | + | |
1145 | 1176 | | |
1146 | 1177 | | |
1147 | 1178 | | |
| |||
1226 | 1257 | | |
1227 | 1258 | | |
1228 | 1259 | | |
1229 | | - | |
| 1260 | + | |
1230 | 1261 | | |
0 commit comments