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

typing annotations #692

Merged
merged 25 commits into from
Nov 30, 2021
Merged

typing annotations #692

merged 25 commits into from
Nov 30, 2021

Conversation

aaronspring
Copy link
Collaborator

@aaronspring aaronspring commented Nov 27, 2021

Description

  • add typing for relevant use cases
  • show typing in docs
  • add to contribution
  • mypy_extensions needed? dont mypy __getattr__
  • plot(Any) if plt not installed

Closes #685

To-Do List

Type of change

  • Refactoring
  • Improved Documentation

How Has This Been Tested?

  • mypy

Checklist (while developing)

  • I have updated the sphinx documentation, if necessary.
  • CHANGELOG is updated with reference to this PR.

References

https://docs.python.org/3/library/typing.html

climpred/graphics.py Show resolved Hide resolved
climpred/graphics.py Show resolved Hide resolved
climpred/graphics.py Show resolved Hide resolved
fmt="--o",
):
bootstrapped: xr.Dataset,
ax: Optional[plt.Axes] = None,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if plt not installed

climpred/graphics.py Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Nov 29, 2021

Codecov Report

Merging #692 (1139fa9) into main (c29b4d8) will increase coverage by 0.00%.
The diff coverage is 97.14%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #692   +/-   ##
=======================================
  Coverage   93.86%   93.87%           
=======================================
  Files          58       58           
  Lines        6227     6250   +23     
=======================================
+ Hits         5845     5867   +22     
- Misses        382      383    +1     
Impacted Files Coverage Δ
climpred/classes.py 94.65% <95.89%> (-0.31%) ⬇️
climpred/checks.py 95.77% <100.00%> (+0.02%) ⬆️
climpred/comparisons.py 99.06% <100.00%> (+0.01%) ⬆️
climpred/graphics.py 95.85% <100.00%> (+0.04%) ⬆️
climpred/metrics.py 91.78% <100.00%> (+0.02%) ⬆️
climpred/tests/test_comparisons.py 100.00% <100.00%> (ø)
climpred/versioning/print_versions.py 62.50% <100.00%> (+1.16%) ⬆️

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 c29b4d8...1139fa9. Read the comment docs.

@aaronspring aaronspring marked this pull request as ready for review November 30, 2021 12:19
@aaronspring aaronspring merged commit a1b80a2 into pangeo-data:main Nov 30, 2021
@aaronspring aaronspring deleted the AS_add_typing branch November 30, 2021 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add typing/annotations
1 participant