Skip to content

fix: use np.asarray in meter curves for NumPy 2 - #22

Merged
munlicode merged 2 commits into
munlicode:mainfrom
bact:fix/numpy2-copy-false
Oct 4, 2026
Merged

munlicode merged 2 commits into
munlicode:mainfrom
bact:fix/numpy2-copy-false

Conversation

@bact

@bact bact commented Sep 28, 2026

Copy link
Copy Markdown
Contributor
  • Replace np.array(..., copy=False), which raises on NumPy 2, with np.asarray (in score_vs_true and precision_recall_curve functions)
  • Add a regression test

- Replace np.array(..., copy=False), which raises on NumPy 2, with np.asarray (in score_vs_true and precision_recall_curve)
- Add a regression test

Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

No unresolved review issues were identified.

Review effort: Lite
Findings: None

What changed in this PR

Updates meter curve conversions for NumPy 2 compatibility and adds regression coverage.

Changes:

  • Replaces np.array(..., copy=False) with np.asarray.
  • Adds tests for both meter curve methods.
File Description
python/​fasttext_module/​fasttext/​tests/​test_meter.py Adds regression tests for meter curve arrays.
python/​fasttext_module/​fasttext/​FastText.py Uses NumPy 2-compatible array conversion.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@munlicode
munlicode merged commit b246bf3 into munlicode:main Oct 4, 2026
9 checks passed
@bact
bact deleted the fix/numpy2-copy-false branch October 4, 2026 09:41
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.

3 participants