-
Notifications
You must be signed in to change notification settings - Fork 86
Add MyPy Checks #556
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
Add MyPy Checks #556
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #556 +/- ##
==========================================
- Coverage 96.48% 96.40% -0.09%
==========================================
Files 29 29
Lines 2703 2724 +21
==========================================
+ Hits 2608 2626 +18
- Misses 95 98 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Cool @juanitorduz. This area is a bit fuzzy for me, can you just mention if or how this might impact a plan by @louismagowan to implement type checking by |
I think after we merge this one we can simply replace mypy by ty. This PR addresses a more fundamental issue which is making types consistent. The rest is about which tool we use to check it |
|
Also, I missed #378 (comment) 🤦 . Sorry! Do you wanna wait and close this PR? |
No I think what you say here is very sensible.
Just in the middle of something, but will test this out locally and review shortly :) |
|
"trust me bro, it works" 😆 |
|
@drbenvincent In #557 I actually add type hints (via GEMINI) to all the code base. |
drbenvincent
left a comment
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.
Ran locally and we have 4 errors:
causalpy/data/simulate_data.py:183: error: Unsupported operand types for - ("ExtensionArray" and "int") [operator]
causalpy/data/simulate_data.py:183: note: Left operand is of type "ExtensionArray | ndarray[tuple[Any, ...], dtype[Any]]"
causalpy/data/simulate_data.py:266: error: Argument 1 to "outcome" has incompatible type "Series[Any]"; expected "ndarray[tuple[Any, ...], dtype[Any]]" [arg-type]
causalpy/data/simulate_data.py:271: error: Argument 6 to "outcome" has incompatible type "Series[Any]"; expected "ndarray[tuple[Any, ...], dtype[Any]]" [arg-type]
causalpy/data/simulate_data.py:272: error: Argument 7 to "outcome" has incompatible type "Series[Any]"; expected "ndarray[tuple[Any, ...], dtype[Any]]" [arg-type]
Found 4 errors in 1 file (checked 32 source files)
|
yes, I will fix this becasue I need to rebase the PR from #544 |
|
@drbenvincent Its green now |
* init * rm file * update badge * Update causalpy/experiments/regression_kink.py Co-authored-by: Copilot <[email protected]> * update docstrings * fix: apply ruff formatting after rebase --------- Co-authored-by: Copilot <[email protected]>
|
Ok! Merged the approved PR #557 to this one and I think we are now ready to merge to |
|
Thank you @drbenvincent ! |
Closes #66
Add MyPy Checks
📚 Documentation preview 📚: https://causalpy--556.org.readthedocs.build/en/556/