Commit 424c93f
committed
Validate GridSpecParams on construction
Move the validate() check into __post_init__ and rename it to
_validate so that every GridSpecParams instance is guaranteed valid
at construction. Switch _reduce_height/_reduce_width to build a new
instance via dataclasses.replace instead of copy+mutate so the
invariant survives aspect-ratio adjustment.1 parent 9d9ddce commit 424c93f
3 files changed
Lines changed: 20 additions & 22 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
364 | 364 | | |
365 | 365 | | |
366 | 366 | | |
367 | | - | |
368 | 367 | | |
369 | 368 | | |
370 | 369 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
807 | 807 | | |
808 | 808 | | |
809 | 809 | | |
810 | | - | |
811 | 810 | | |
812 | 811 | | |
813 | 812 | | |
| |||
824 | 823 | | |
825 | 824 | | |
826 | 825 | | |
827 | | - | |
828 | 826 | | |
829 | 827 | | |
830 | 828 | | |
| |||
1074 | 1072 | | |
1075 | 1073 | | |
1076 | 1074 | | |
1077 | | - | |
1078 | | - | |
1079 | 1075 | | |
1080 | 1076 | | |
1081 | 1077 | | |
1082 | 1078 | | |
1083 | 1079 | | |
1084 | 1080 | | |
1085 | | - | |
1086 | | - | |
1087 | | - | |
1088 | | - | |
1089 | | - | |
1090 | 1081 | | |
1091 | 1082 | | |
1092 | | - | |
| 1083 | + | |
| 1084 | + | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
| 1089 | + | |
1093 | 1090 | | |
1094 | 1091 | | |
1095 | 1092 | | |
1096 | 1093 | | |
1097 | 1094 | | |
1098 | | - | |
1099 | | - | |
1100 | 1095 | | |
1101 | 1096 | | |
1102 | 1097 | | |
1103 | 1098 | | |
1104 | 1099 | | |
1105 | 1100 | | |
1106 | | - | |
1107 | | - | |
1108 | | - | |
1109 | | - | |
1110 | | - | |
1111 | 1101 | | |
1112 | 1102 | | |
1113 | | - | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
1114 | 1110 | | |
1115 | 1111 | | |
1116 | 1112 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
53 | 56 | | |
54 | | - | |
| 57 | + | |
55 | 58 | | |
56 | 59 | | |
57 | 60 | | |
| |||
0 commit comments