Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mypy fails for 3.13 #905

Open
4 of 5 tasks
SiQube opened this issue Dec 11, 2024 · 1 comment
Open
4 of 5 tasks

mypy fails for 3.13 #905

SiQube opened this issue Dec 11, 2024 · 1 comment
Labels
bug Something isn't working essential important

Comments

@SiQube
Copy link
Member

SiQube commented Dec 11, 2024

Current Behavior

mypy fails, the start of the error message is pasted below.

this seems to be an issue with factory overwrite in datasets (see here) and numpy typing changes from dtype[floating[Any]] to dtype[float64]

Expected Behavior

mypy passes for 3.13

Minimum acceptance criteria

  • mypy passes for 3.13

Failure Information (for bugs)

Please help provide information about the failure if this is a bug.
If it is not a bug, please remove the rest of this template.

Steps to Reproduce

use python 3.13 and pre-commit

  • change and python file
    e.g.
diff --git a/src/pymovements/utils/plotting.py b/src/pymovements/utils/plotting.py
index 2025b73..4fd6e75 100644
--- a/src/pymovements/utils/plotting.py
+++ b/src/pymovements/utils/plotting.py
@@ -36,6 +36,7 @@ LinearSegmentedColormapType: TypeAlias = dict[
     Sequence[tuple[float, ...]],
 ]
 
+'test'
 
 DEFAULT_SEGMENTDATA: LinearSegmentedColormapType = {
     'red': [

then run

pre-commit run --all-files

Context

  • Project Version / Commit: 0.19
  • Operating System: Linux
  • Python Version: 3.13

Failure Logs

mypy.....................................................................Failed
- hook id: mypy
- exit code: 1

src/pymovements/gaze/transforms_numpy.py:251: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[floating[Any]]]", variable has type "ndarray[tuple[int, ...], dtype[float64]]")  [assignment]
src/pymovements/gaze/transforms_numpy.py:377: error: Incompatible types in assignment (expression has type "ndarray[tuple[int, ...], dtype[floating[Any]]]", variable has type "ndarray[tuple[int, ...], dtype[float64]]")  [assignment]
src/pymovements/datasets/toy_dataset_eyelink.py: error: Argument 5 of "__replace__" is incompatible with supertype "DatasetDefinition"; supertype defines the argument type as "Experiment | None"  [override]
src/pymovements/datasets/toy_dataset_eyelink.py: note: This violates the Liskov substitution principle
src/pymovements/datasets/toy_dataset_eyelink.py: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides
src/pymovements/datasets/toy_dataset_eyelink.py: error: Argument 11 of "__replace__" is incompatible with supertype "DatasetDefinition"; supertype defines the argument type as "list[str] | None"  [override]
src/pymovements/datasets/toy_dataset_eyelink.py: error: Argument 12 of "__replace__" is incompatible with supertype "DatasetDefinition"; supertype defines the argument type as "str | None"  [override]
src/pymovements/datasets/toy_dataset_eyelink.py: error: Argument 13 of "__replace__" is incompatible with supertype "DatasetDefinition"; supertype defines the argument type as "str | None"  [override]
src/pymovements/datasets/toy_dataset_eyelink.py: error: Argument 14 of "__replace__" is incompatible with supertype "DatasetDefinition"; supertype defines the argument type as "list[str] | None"  [override]
src/pymovements/datasets/toy_dataset.py: error: Argument 5 of "__replace__" is incompatible with supertype "DatasetDefinition"; supertype defines the argument type as "Experiment | None"  [override]
src/pymovements/datasets/toy_dataset.py: note: This violates the Liskov substitution principle
src/pymovements/datasets/toy_dataset.py: note: See https://mypy.readthedocs.io/en/stable/common_issues.html#incompatible-overrides

Checklist

  • I am running the latest version
  • I checked the documentation and found no answer
  • I checked to make sure that this issue has not already been filed
  • I have provided sufficient information for the team
@SiQube SiQube added the bug Something isn't working label Dec 11, 2024
@dkrako dkrako added the essential important label Dec 11, 2024
@SiQube
Copy link
Member Author

SiQube commented Dec 29, 2024

to not block new pull requests, we ignore override for now via #911

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working essential important
Projects
None yet
Development

No branches or pull requests

2 participants