You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Remove pyre-fixme/pyre-ignore from ax/core, ax/adapter, ax/generators test files (#4989)
Summary:
Pull Request resolved: #4989
Remove pyre-fixme and pyre-ignore type suppression comments from test files in
ax/core/tests, ax/adapter/tests, ax/adapter/transforms/tests, and source file
ax/adapter/transforms/one_hot.py. Uses proper type narrowing via none_throws,
assert_is_instance, cast, and explicit type annotations instead of suppression
comments.
Key changes:
- Replace `# pyre-ignore[16]` on `Parameter` attribute access with
`assert_is_instance(..., RangeParameter)` / `ChoiceParameter` / `FixedParameter`
- Replace `# pyre-fixme[16]` on Optional access with `none_throws(...)`
- Add explicit type annotations (`TParameterization`, `TConfig`, `list[float]`,
`dict[str, float | int]`) to fix type inference issues
- Replace `**attrs` dict unpacking with explicit kwargs to eliminate union-type
pyre errors in test_observation.py
- Fix `all()` generator expression scoping bug in test_batch_trial.py (missing
parentheses caused pyre-fixme[6])
- Remove unnecessary `return` statements inside `assertRaises` blocks
- Add missing return type and parameter annotations on mock-decorated test methods
- Refactor BoTorchGenerator construction in test_cross_validation.py to avoid
pyre-ignore on `adapter.generator.surrogate` access
Reviewed By: dme65
Differential Revision: D95273495
fbshipit-source-id: 5e4b0d1db817b1f95a4d691b7598358aed028da0
0 commit comments