Skip to content

Fix Python 3.14 CI mypy breakage in masked-array call sites#134

Merged
tukiains merged 2 commits into
mainfrom
copilot/fix-github-actions-build-failure
Jun 22, 2026
Merged

Fix Python 3.14 CI mypy breakage in masked-array call sites#134
tukiains merged 2 commits into
mainfrom
copilot/fix-github-actions-build-failure

Conversation

Copilot AI commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

The build (ubuntu-latest, 3.14) job was failing in the pre-commit mypy step due to Python 3.14 typing incompatibilities around numpy.ma.masked_array(...) call sites. This PR updates the affected masked-array usage patterns to keep behavior unchanged while restoring type-check compatibility.

  • Type-check compatibility updates (production code)

    • Replaced ma.masked_array(...) with ma.array(...) at impacted call sites where mypy reported "TypeAliasType" not callable.
    • Updated masked comparison logic in clutter detection to use numpy.ma operations so .filled(...) remains valid for masked results.
  • Type-check compatibility updates (tests)

    • Applied the same ma.masked_array(...)ma.array(...) adjustment in impacted tests to keep test fixtures aligned with typed usage.
  • Representative change

    # before
    array = ma.masked_array(array)
    
    # after
    array = ma.array(array)
    # before
    tiny_velocity = (np.abs(v[:, :n_gates]) < v_lim).filled(False)
    
    # after
    tiny_velocity = ma.less(ma.abs(v[:, :n_gates]), v_lim).filled(False)

Copilot AI changed the title [WIP] Fix the failing GitHub Actions job build (ubuntu-latest, 3.14) Fix Python 3.14 CI mypy breakage in masked-array call sites Jun 22, 2026
Copilot AI requested a review from tukiains June 22, 2026 11:15
@tukiains tukiains marked this pull request as ready for review June 22, 2026 11:37
@tukiains tukiains merged commit 568362e into main Jun 22, 2026
14 checks passed
@tukiains tukiains deleted the copilot/fix-github-actions-build-failure branch June 22, 2026 11:37
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.

2 participants