Skip to content

fix: avoid np.int in feature inf analysis#2206

Draft
Bortlesboat wants to merge 1 commit intomicrosoft:mainfrom
Bortlesboat:codex/fix-fea-inf-numpy-int
Draft

fix: avoid np.int in feature inf analysis#2206
Bortlesboat wants to merge 1 commit intomicrosoft:mainfrom
Bortlesboat:codex/fix-fea-inf-numpy-int

Conversation

@Bortlesboat
Copy link
Copy Markdown

Summary

  • replace the removed NumPy np.int alias in FeaInfAna with the built-in int
  • add a regression test covering infinite-value counting under NumPy 2.x

Why

NumPy 2.x raises AttributeError when code accesses np.int. That makes FeaInfAna fail before it can summarize infinite feature values. The built-in int preserves the current integer mask behavior without pinning to a platform-specific NumPy dtype.

Checks

  • python -m pytest tests/test_contrib_report_data_ana.py -q
  • python -m compileall -q qlib/contrib/report/data/ana.py tests/test_contrib_report_data_ana.py
  • python -m black --check --diff -l 120 qlib/contrib/report/data/ana.py tests/test_contrib_report_data_ana.py
  • git diff --cached --check

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant