Commit 767e064
style(review): apply Task 7 code-review cleanups (expression)
From the code quality reviewer's findings:
Important:
- Added _HAND_POSES constant — 9-pose enum tuple (resting, reaching,
holding, gesturing, clasped, writing, guarded, open, fist). Week 2's
compute_expression produces 4 of these; the others are defined for
NellFace animation authoring in Week 6. ExpressionVector docstring
updated to reference _HAND_POSES instead of "a small enum".
- test_all_params_in_zero_to_one_range now asserts float-range
[0.0, 1.0] on arm_hand values (skipping hand_pose which is str).
Previous test only verified type, not range — coverage gap.
Minor (comments only):
- Inline comment on the grief mouth coefficient (0.5 vs joy's 0.4):
intentional asymmetry — mixed states land below neutral, matching
human pattern where sadness dominates mouth expression.
- Inline comment on body_heat = max(desire, arousal_emotion): arousal
decays in hours (half-life 0.5d), desire decays in days. max()
keeps the transient arousal signal from being washed out.
- Docstring note on compute_expression: Week 2 only drives arousal-
tier-gated arm params; arm_openness/wrist_angle/finger_spread/
reach_retract stay at baseline 0.3. NellFace Week 6 handles those
via pose-driven animation.
Deliberately NOT applied:
- brow_furrow saturation at grief+anger extremes: known tuning issue
for Week 6 ramp-weight refinement.
- _clamp(0.7) vacuous-clamp on literal constant: cosmetic only.
Pytest: 113/113 pass. Ruff + format both clean.
This closes out all 7 emotion sub-modules. Task 8 (week close-out +
tag week-2-complete) is next.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 756e26b commit 767e064
2 files changed
Lines changed: 37 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
61 | 61 | | |
62 | 62 | | |
63 | 63 | | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
64 | 81 | | |
65 | 82 | | |
66 | 83 | | |
| |||
69 | 86 | | |
70 | 87 | | |
71 | 88 | | |
72 | | - | |
| 89 | + | |
73 | 90 | | |
74 | 91 | | |
75 | 92 | | |
| |||
108 | 125 | | |
109 | 126 | | |
110 | 127 | | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
111 | 134 | | |
112 | 135 | | |
113 | 136 | | |
| |||
118 | 141 | | |
119 | 142 | | |
120 | 143 | | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
121 | 147 | | |
122 | 148 | | |
123 | 149 | | |
| |||
144 | 170 | | |
145 | 171 | | |
146 | 172 | | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
147 | 177 | | |
148 | 178 | | |
149 | 179 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
85 | | - | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
86 | 89 | | |
87 | 90 | | |
88 | 91 | | |
| |||
0 commit comments