-
Notifications
You must be signed in to change notification settings - Fork 16
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
[WIP] Mypy Check Bug Fix #713
[WIP] Mypy Check Bug Fix #713
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you need to merge or rebase on upstream/dev
to get the latest changes before the tests can run.
With the most recent commit I am still having errors produced when just |
Now back to the point of pre-commit passing but the local mypy check produces errors. I am hedging toward this being caused because of a difference in the recursive calls for mypy when it is called individually versus in pre-commit. In the mypy documentation it is stated that submodules found in what is listed in |
Turns out since the pre-commit runs its check in an isolated virtualenv some things may be lost. I believe the dependencies need to be listed for mypy but am at a loss as to what all those dependencies should be. |
…processing into mypy_bug
…processing into mypy_bug
imap_processing/utils.py
Outdated
dtype_array: np.ndarray = np.array(values, dtype=dtype) | ||
return dtype_array | ||
except ValueError: | ||
return np.array(values) | ||
regular_array: np.ndarray = np.array(values) | ||
return regular_array |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that for all of the numpy typing we need to import their typing module, and then use npt.NDArray
. Saying that we are returning np.ndarray
seems incorrect, so I think we should change those, rather than add these explicit type annotations throughout the code.
import numpy.typing as npt
def func() -> npt.NDArray
https://stackoverflow.com/questions/66349242/specific-type-annotation-for-numpy-ndarray-using-mypy
Co-authored-by: Greg Lucas <[email protected]>
A fix for the mypy bug and any needed changes
Overview
Closes #710
Ensures that mypy will only check files within
imap_processing/
etc. Changes to make the pre-commit mypy check and regular mypy check align.Currently, I am being pushed in the direction to think it is a recursion difference that is causes the difference in errors for the two checks. I am trying to track down where this is occurring.
For Reference:
mypy .
ran fromimap_processing/
producespre-commit run --all
ran fromimap_processing/
producesTo Note; all errors found by running the pre-check are present when the mypy check is ran by itself
New Dependencies
New Files
Deleted Files
Updated Files
Testing