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

[Dev] use type hint and type checker #1258

Open
6 of 18 tasks
lisphilar opened this issue Oct 9, 2022 · 4 comments
Open
6 of 18 tasks

[Dev] use type hint and type checker #1258

lisphilar opened this issue Oct 9, 2022 · 4 comments
Labels
brainstorming Discussion to get creative ideas development Add tests or refactoring

Comments

@lisphilar
Copy link
Owner

lisphilar commented Oct 9, 2022

Checkbox

Issues of the current workflow

Type hints are documented in docstings and un-analyzable with type checker.

Action items

  • use type hints in APIs users will call: downloading
  • use type hints in APIs users will call: dynamics
  • use type hints in APIs users will call: engineering
  • use type hints in APIs users will call: gis
  • use type hints in APIs users will call: science
  • use type hints in APIs users will call: util
  • use type hints in APIs users will call: metadata
  • use type hints in internal classes and methods: downloading
  • use type hints in internal classes and methods: dynamics
  • use type hints in internal classes and methods: engineering
  • use type hints in internal classes and methods: gis
  • use type hints in internal classes and methods: science
  • use type hints in internal classes and methods: util
  • use type hints in internal classes and methods: metadata
  • use type checker: e.g. pyright, mypy, pytype
  • include py.typed in folders

Additional Context

To keep backward compatibility, from __future__ import annotations and typing_extension library may be used.

@lisphilar lisphilar added brainstorming Discussion to get creative ideas development Add tests or refactoring labels Oct 9, 2022
@lisphilar lisphilar added this to the Release v3.0.0 milestone Oct 9, 2022
@lisphilar
Copy link
Owner Author

We may need the sphinx.ext.autodoc.typehints extension to show types in documentation.
https://github.com/tox-dev/sphinx-autodoc-typehints

@lisphilar
Copy link
Owner Author

sphinx.ext.autodoc.typehints will be used in documentation workflow with #1285.

@lisphilar
Copy link
Owner Author

With "1286,

  • use type hints in APIs users will call: dynamics
  • use pyright as type checker
  • fix/suppress errors of type hints found by pyright
  • update intersphinx mapping to link with numpy and matplotlib in docs/conf.py

@lisphilar lisphilar removed this from the Release v3.0.0 milestone May 12, 2023
@lisphilar
Copy link
Owner Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
brainstorming Discussion to get creative ideas development Add tests or refactoring
Projects
None yet
Development

No branches or pull requests

1 participant