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

Fix numpy related type issues #543

Merged
merged 1 commit into from
Nov 30, 2021

Conversation

jklaise
Copy link
Contributor

@jklaise jklaise commented Nov 30, 2021

This PR is a prerequisite for #521 as the newest tensorflow pulls in the newest numpy which has support for type hints. This has revealed some typing issues in our codebase.

This PR uses type: ignore fairly liberally as in some places it is not fully clear why the upstream types are failing (e.g. List[int] not being valid input to np.ix_), and in others we're missing some validation/type narrowing on our side (e.g. baselines). I've also used cast in a few places to help the typechecker narrow down types based on the boolean flags we use.

@codecov
Copy link

codecov bot commented Nov 30, 2021

Codecov Report

Merging #543 (3588fc1) into master (dbc874a) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #543   +/-   ##
=======================================
  Coverage   82.47%   82.47%           
=======================================
  Files          77       77           
  Lines       10417    10420    +3     
=======================================
+ Hits         8591     8594    +3     
  Misses       1826     1826           
Impacted Files Coverage Δ
alibi/explainers/anchor_image.py 91.30% <ø> (ø)
alibi/explainers/anchor_tabular.py 78.75% <100.00%> (ø)
alibi/explainers/integrated_gradients.py 89.00% <100.00%> (+0.08%) ⬆️
alibi/explainers/tests/test_anchor_image.py 97.93% <100.00%> (ø)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant