Skip to content

mypy ver 1.11+ multiple errors #2205

@shachafl

Description

@shachafl

Description

mypy version 1.11 and higher introduced new errors that need to be resolved before loosening the version constraint in the requirements file: requirements/REQUIREMENTS-CI.txt.in

Steps/Code to Reproduce

pip install -U mypy
make mypy

Expected Results

mypy --ignore-missing-imports starfish examples/data_formatting_examples/format*
starfish/core/util/logging.py:18: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
...

Actual Results

mypy --ignore-missing-imports starfish examples/data_formatting_examples/format*
starfish/core/util/logging.py:18: note: By default the bodies of untyped functions are not checked, consider using --check-untyped-defs  [annotation-unchecked]
starfish/core/spots/DecodeSpots/check_all_funcs.py:493: error: Item "dict[Hashable, Codebook]" of "Codebook | dict[Hashable, Codebook]" has no attribute "data"  [union-attr]
starfish/core/spots/DecodeSpots/check_all_funcs.py:494: error: Item "dict[Hashable, Codebook]" of "Codebook | dict[Hashable, Codebook]" has no attribute "data"  [union-attr]
starfish/core/spots/DecodeSpots/check_all_funcs.py:495: error: Item "dict[Hashable, Codebook]" of "Codebook | dict[Hashable, Codebook]" has no attribute "data"  [union-attr]
starfish/core/spots/FindSpots/trackpy_local_max_peak_finder.py:180: error: Too many arguments for "image_to_spots" of "TrackpyLocalMaxPeakFinder"  [call-arg]
starfish/core/spots/FindSpots/blob.py:229: error: Too many arguments for "image_to_spots" of "BlobDetector"  [call-arg]
starfish/core/image/Filter/mean_high_pass.py:121: error: Argument "size" to "_high_pass" of "MeanHighPass" has incompatible type "tuple[int | float, ...]"; expected "int | float"  [arg-type]
starfish/core/image/Filter/match_histograms.py:111: error: Argument "reference" to "_match_histograms" of "MatchHistograms" has incompatible type "DataArray"; expected "ndarray[Any, Any]"  [arg-type]
starfish/core/image/Filter/laplace.py:129: error: Argument "sigma" to "_gaussian_laplace" of "Laplace" has incompatible type "tuple[int | float, ...]"; expected "int | float | tuple[int | float]"  [arg-type]
starfish/core/image/Filter/gaussian_low_pass.py:122: error: Argument "sigma" to "_low_pass" of "GaussianLowPass" has incompatible type "tuple[int | float, ...]"; expected "int | float | tuple[int | float]"  [arg-type]
starfish/core/image/Filter/gaussian_high_pass.py:121: error: Argument "sigma" to "_high_pass" of "GaussianHighPass" has incompatible type "tuple[int | float, ...]"; expected "int | float | tuple[int | float]"  [arg-type]

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn issue with an existing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions