Skip to content

[REF] Remove #type: ignore from SLM class #199

Description

@ReinderVosDeWael

Currently, mypy crashes on SLM.py due to an import inside a class. This issue is tracked at mypy/issuse/10521.

Once mypy resolves it issue, this issue can be solved by simply removing the following: https://github.com/MICA-MNI/BrainStat/blob/master/brainstat/stats/SLM.py#L1

Activity

  1. added
    PythonOn the Python implementation
    on holdIssues that rely on fixes to external software
    on Jul 29, 2021
  2. zihuaihuai commented on Sep 27, 2024

    @zihuaihuai
    Collaborator

    mypy is temporary removed now, will mark this issue as add mypy back

  3. removed
    on holdIssues that rely on fixes to external software
    on Sep 27, 2024
  4. zihuaihuai commented on May 4, 2026

    @zihuaihuai
    Collaborator

    Quick status check: the upstream mypy issue (python/mypy#10521) is still open. Several near-duplicates have been folded into it but no fix has landed — the in-class from ._linear_model import _linear_model style still trips mypy on current releases.

    Concretely, removing line 1 of SLM.py and running mypy brainstat/ against mypy 1.x reproduces a crash on the inner imports, so this issue is still blocked on the upstream resolution.

  5. added
    on holdIssues that rely on fixes to external software
    on May 4, 2026
  6. zihuaihuai commented on May 4, 2026

    @zihuaihuai
    Collaborator

    Resolved in #381. Mypy was crashing because of the in-class from ._linear_model import _linear_model pattern (python/mypy#10521). Lifting those imports to module level and binding them as class attributes (_linear_model = _linear_model) gets mypy past the crash, so the file-level # type: ignore shebangs are gone from both SLM.py and _multiple_comparisons.py. The ~380 pre-existing untyped-code errors that were hiding behind the blanket ignore now surface — those are a separate cleanup task; until they're triaged we're leaving the commented-out mypy CI job alone.

  7. added a commit that references this issue on May 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    PythonOn the Python implementationon holdIssues that rely on fixes to external software

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions