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

[DOC] Write developer documentation for type hints including soft dependencies. #1857

Open
MatthewMiddlehurst opened this issue Jul 29, 2024 · 4 comments · Fixed by #2424
Open
Labels
documentation Improvements or additions to documentation

Comments

@MatthewMiddlehurst
Copy link
Member

Describe the issue linked to the documentation

Developer documentation does not sufficiently include guidance for adding type hints, espceically in situations where soft dependencies are required.

Suggest a potential alternative/fix

Add a new page in docs/developer_guide/ on adding type hints. PyODAdapter is a good example of type hints with soft dependencies, following PEP 563.

@MatthewMiddlehurst MatthewMiddlehurst added documentation Improvements or additions to documentation good first issue Good for newcomers labels Jul 29, 2024
@vedpawar2254
Copy link
Contributor

@aeon-actions-bot assign @vedpawar2254

@aeon-actions-bot aeon-actions-bot bot removed the good first issue Good for newcomers label Nov 30, 2024
vedpawar2254 added a commit to vedpawar2254/aeon that referenced this issue Dec 1, 2024
vedpawar2254 added a commit to vedpawar2254/aeon that referenced this issue Dec 2, 2024
Added a documentation file on adding type hints that fixes aeon-toolkit#1857
@SebastianSchmidl
Copy link
Member

SebastianSchmidl commented Dec 8, 2024

PR #2424 does not describe handling of soft-dependencies sufficiently.

typing.TYPE_CHECKING can be used to conditionally import soft-dependency types. However, to use those types, one must also always import from __future__ import annotations at the top of the file.

The example in the current documentation page does not include the usage of any conditionally-imported types. The displayed function is a input validation function and not related to the type-checking.

@vedpawar2254
Copy link
Contributor

ok @SebastianSchmidl ill fix it

@MatthewMiddlehurst
Copy link
Member Author

Ah yep, did not mean to close this, sorry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
3 participants