[Migration] Migrate deprecated bambi accessors and refresh test doubles
- Dominant language
- Python
- Stars
- 124
- Forks
- 24
- Avg merge
- 19h 32m
- Merged PRs (30d)
- 60
Description
Part of #1305. Parent: #1306.
[bambi#1002](https://github.com/bambinos/bambi/pull/1002), *Model parameters and components*, renamed the model vocabulary. `FutureWarning` shims exist today and will be removed:
| Old | New |
|-----|-----|
| `Model.components` | `Model.parameters` |
| `Model.distributional_components` | `Model.conditional_parameters` |
| `Model.constant_components` | `Model.marginal_parameters` |
| `Model.response_component` | `Model.response_term` |
`src/hssm/utils.py` is currently **inconsistent**: line 55 uses the new `response_term`, while lines 280 and 285 still use `response_component.term`. That inconsistency is what breaks the `SimpleNamespace` test doubles in `tests/test_utils.py`, which still mimic the pre-rewrite API:
```
AttributeError: 'types.SimpleNamespace' object has no attribute 'response_term'
```
Two `FutureWarning`s are already visible in the current test run (`components`, `distributional_components`).
### Tasks
- [ ] `src/hssm/utils.py:134`, `src/hssm/base.py:1812` — `components` → `parameters`
- [ ] `src/hssm/utils.py:127`, `:142`, `src/hssm/base.py:915` — `distributional_components` → `conditional_parameters`
- [ ] `src/hssm/utils.py:280`, `:285` — `response_component` → `response_term`
- [ ] `tests/test_utils.py` — reshape the doubles to the new API
- [ ] Consider failing CI on bambi `FutureWarning`s so the rest surface automatically
- [ ] Remove the R6 xfail marks
### Impact
3 test ids in `tests/test_utils.py`, plus removal of all currently-emitted bambi deprecation warnings.
Details: `design/bambi-dev-upgrade-test-failures.md` (R6, latent #4), `design/bambi-migration-fix-plan.md` (F5).
Contributor guide
Research direction
Start with the listed references in src/hssm/utils.py and src/hssm/base.py, then inspect the SimpleNamespace doubles and affected test ids in tests/test_utils.py. Run the current test suite to reproduce the AttributeError and FutureWarnings. Done means all listed deprecated accessors and test doubles use the new API, the affected tests pass, and the current warnings are removed; also review the R6 xfail marks and CI warning handling.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, testing-qa
- Issue type
- Refactor
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 72/100