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

Suppress false positive missing method mypy errors. #1503

Merged

Conversation

obi1kenobi
Copy link
Contributor

Description

Suppress the following false positive mypy type errors, without affecting any of the underlying functionality. Working toward #1496.

arviz/data/inference_data.py:1301: error: "Type[Dataset]" has no attribute "mean"  [attr-defined]
arviz/data/inference_data.py:1302: error: "Type[Dataset]" has no attribute "median"  [attr-defined]
arviz/data/inference_data.py:1303: error: "Type[Dataset]" has no attribute "min"  [attr-defined]
arviz/data/inference_data.py:1304: error: "Type[Dataset]" has no attribute "max"  [attr-defined]
arviz/data/inference_data.py:1305: error: "Type[Dataset]" has no attribute "cumsum"  [attr-defined]
arviz/data/inference_data.py:1306: error: "Type[Dataset]" has no attribute "sum"  [attr-defined]

These errors arise from the fact that the Dataset type has some dynamically-defined methods. Since those methods are not visible to mypy, it assumes they don't exist and therefore their use results in a false-positive type error.

Checklist

  • Follows official PR format
  • Code style correct (follows pylint and black guidelines)

@codecov
Copy link

codecov bot commented Jan 18, 2021

Codecov Report

Merging #1503 (2c543b4) into master (14875f5) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1503   +/-   ##
=======================================
  Coverage   91.76%   91.76%           
=======================================
  Files         105      105           
  Lines       11316    11316           
=======================================
  Hits        10384    10384           
  Misses        932      932           
Impacted Files Coverage Δ
arviz/data/inference_data.py 83.81% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 14875f5...2c543b4. Read the comment docs.

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.

2 participants