Skip to content

Remove pyre-fixme/pyre-ignore from ax/ small directories#4981

Closed
saitcakmak wants to merge 1 commit intofacebook:mainfrom
saitcakmak:export-D95264987
Closed

Remove pyre-fixme/pyre-ignore from ax/ small directories#4981
saitcakmak wants to merge 1 commit intofacebook:mainfrom
saitcakmak:export-D95264987

Conversation

@saitcakmak
Copy link
Contributor

Summary:
Remove pyre-fixme/pyre-ignore suppression comments from 11 files across
several directories: plot/, analysis/, generation_strategy/, benchmark/,
metrics/, global_stopping/ (both source and test files).

Key fixes:

  • Use none_throws() for Optional unwrapping
  • Use assert_is_instance() for type narrowing
  • Add proper type annotations (AnalysisCard, SklearnDataset, TParamValue)
  • Use float() wrapping for numpy scalar arithmetic
  • Use npt.NDArray instead of bare np.ndarray
  • Use int() for cardinality() return values
  • Fix tuple[int] -> tuple[int, int, int] for RGB color tuples
  • Annotate DISCRETE_COLOR_SCALE global
  • Remove stale pyre-fixme comments on AxPlotConfig(data=fig, ...) calls

Differential Revision: D95264987

@meta-cla meta-cla bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Mar 5, 2026
@meta-codesync
Copy link

meta-codesync bot commented Mar 5, 2026

@saitcakmak has exported this pull request. If you are a Meta employee, you can view the originating Diff in D95264987.

Summary:
Remove pyre-fixme/pyre-ignore suppression comments from 17 files across
several directories: plot/, analysis/, generation_strategy/, benchmark/,
metrics/, global_stopping/ (both source and test files).

Key fixes:
- Widen `AxPlotConfig.__new__` data param to `dict[str, Any] | Figure`,
  eliminating 14 pyre-fixme[6] suppressions across ax/plot/
- Use `none_throws()` for Optional unwrapping
- Use `assert_is_instance()` for type narrowing
- Add proper type annotations (`AnalysisCard`, `SklearnDataset`, `TParamValue`)
- Use `float()` wrapping for numpy scalar arithmetic
- Use `npt.NDArray` instead of bare `np.ndarray`
- Use `int()` for cardinality() return values
- Fix `tuple[int]` -> `tuple[int, int, int]` for RGB color tuples
- Annotate `DISCRETE_COLOR_SCALE` global

Reviewed By: dme65

Differential Revision: D95264987
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 91.30435% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.82%. Comparing base (4059782) to head (85a753a).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
ax/metrics/sklearn.py 50.00% 1 Missing ⚠️
ax/plot/trace.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #4981      +/-   ##
==========================================
- Coverage   96.86%   96.82%   -0.04%     
==========================================
  Files         597      597              
  Lines       64282    64288       +6     
==========================================
- Hits        62267    62249      -18     
- Misses       2015     2039      +24     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@meta-codesync
Copy link

meta-codesync bot commented Mar 5, 2026

This pull request has been merged in 00960e9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed Do not delete this pull request or issue due to inactivity. fb-exported Merged meta-exported

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants