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

add type annotations #1107

Merged
merged 94 commits into from
Jan 16, 2024
Merged

add type annotations #1107

merged 94 commits into from
Jan 16, 2024

Conversation

gboeing
Copy link
Owner

@gboeing gboeing commented Jan 11, 2024

This PR adds complete type annotations throughout the package (validated via mypy . --strict and typeguard in CI) for user type hinting and type checking. It also fixes minor bugs and inconsistencies revealed by the subsequent type check validation. Resolves #1062.

This PR includes the following enhancements:

  • adds type annotations to all public and private functions
  • adds mypy strict validation to CI
  • adds typeguard runtime validation to CI
  • maintains test coverage
  • fix bug where _downloader._save_to_cache function expected requests.response.ok bool values as an argument, but was being passed requests.response.status_code int values instead
  • minor fixes throughout to address inconsistencies revealed by mypy static checking and typeguard runtime checking

See also #1106

@gboeing gboeing merged commit 8113342 into v2 Jan 16, 2024
7 checks passed
@gboeing gboeing deleted the typing branch January 16, 2024 21:12
@gboeing
Copy link
Owner Author

gboeing commented May 3, 2024

The first pre-release OSMnx v2 beta has been released. Testers needed! See #1123 for details.

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.

1 participant