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

Some type annotations for coords.py #4294

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

rcomer
Copy link
Member

@rcomer rcomer commented Aug 24, 2021

🚀 Pull Request

Description

Added some type hints relevant to the changes in #5955


Consult Iris pull request check list

lib/iris/coords.py Outdated Show resolved Hide resolved
lib/iris/coords.py Outdated Show resolved Hide resolved
lib/iris/coords.py Outdated Show resolved Hide resolved
@rcomer
Copy link
Member Author

rcomer commented Sep 6, 2021

Rebased. CI is green. Ready for review 😎

@rcomer
Copy link
Member Author

rcomer commented Nov 19, 2021

Added some type hints for the method and function I modified, as well as ones required to tidy up PyRight complaints within the collapsed method. The form import numpy.typing as npt is taken from examples in the numpy docs.

@rcomer
Copy link
Member Author

rcomer commented Nov 19, 2021

Some screenshots of the built docs:

now redundant as we turned hints off in the docs at #4510

ndim_property
bounds_property
core_bounds_method
collapsed_method

lib/iris/coords.py Outdated Show resolved Hide resolved
@rcomer
Copy link
Member Author

rcomer commented Jan 5, 2022

Made some changes to the type hints following a chat with @bjlittle this morning, and taking some inspiration from @jamesp's stubs.

The rendered docs look better:

now redundant as we turned hints off in the docs at #4510

bounds
core_points_and_bounds
collapsed

@bjlittle
Copy link
Member

bjlittle commented Oct 5, 2022

@bjlittle get your finger out...

@bjlittle
Copy link
Member

bjlittle commented Oct 5, 2022

@rcomer Fancy doing a rebase?

@rcomer
Copy link
Member Author

rcomer commented Oct 5, 2022

Now rebased.

@bjlittle it's all on you now 😛

Copy link

codecov bot commented May 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.78%. Comparing base (44257eb) to head (1a63e4c).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4294   +/-   ##
=======================================
  Coverage   89.78%   89.78%           
=======================================
  Files          88       88           
  Lines       23060    23064    +4     
  Branches     5031     5031           
=======================================
+ Hits        20704    20708    +4     
  Misses       1624     1624           
  Partials      732      732           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rcomer
Copy link
Member Author

rcomer commented May 15, 2024

See #5955 for a version of this fix without the type-hinting rabbit hole.

@rcomer rcomer changed the title Partial collapse of multi-dimensional string coords Some type annotations for coords.py Aug 30, 2024
@rcomer rcomer marked this pull request as draft August 30, 2024 14:54
@rcomer
Copy link
Member Author

rcomer commented Aug 30, 2024

The bugfix has now been merged in #5955 so I have rebased this to only include the type changes. It seems that mypy is unhappy though and I'm not sure if/when I will be motivated to investigate that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants