Add comprehensive type annotations and Python 3 modernization - #67
Merged
Conversation
…NIFEST.in, setup.py, and type tests Co-authored-by: letmaik <530988+letmaik@users.noreply.github.com>
Co-authored-by: letmaik <530988+letmaik@users.noreply.github.com>
…er type, fix typo Co-authored-by: letmaik <530988+letmaik@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add typing support and tests for project
Add type annotations and PEP 561 compliance
Jan 30, 2026
Co-authored-by: letmaik <530988+letmaik@users.noreply.github.com>
Copilot
AI
changed the title
Add type annotations and PEP 561 compliance
Add inline type annotations to _lensfun.pyx
Jan 30, 2026
Owner
|
@copilot change all legacy |
…or with return types Co-authored-by: letmaik <530988+letmaik@users.noreply.github.com>
Contributor
Author
Copilot
AI
changed the title
Add inline type annotations to _lensfun.pyx
Add inline type annotations and modernize properties in _lensfun.pyx
Jan 30, 2026
letmaik
reviewed
Jan 30, 2026
…tations Co-authored-by: letmaik <530988+letmaik@users.noreply.github.com>
Copilot
AI
changed the title
Add inline type annotations and modernize properties in _lensfun.pyx
Add comprehensive type annotations and Python 3 modernization
Jan 30, 2026
letmaik
marked this pull request as ready for review
January 30, 2026 08:28
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds comprehensive type annotations to the Cython source file (
_lensfun.pyx) to match the approach in rawpy PR #275. This complements the existing.pyistub file with runtime-visible type information.Changes
Typing imports
from typing import Optional, List, Union, Anyfrom numpy.typing import NDArrayFull type annotations
maker: Optional[str],loose_search: bool, etc.find_cameras() -> List[Camera],find_lenses() -> List[Lens], etc.-> Optional[LensCalibDistortion], etc.-> Optional[NDArray[np.float32]]for coordinate arrays,-> boolfor color modificationModern property syntax
property abc:syntax to modern@propertydecorator@property def maker(self) -> str:)__get__methodsPython 3 modernization
language_level=3directive to make code Python 3 only_charsfunction (Python 2 compatibility code)c_string_type=unicodeandlanguage_level=3, Cython automatically handles str→char* conversion with UTF-8 encodingExample
The inline types and modern property syntax improve IDE experience and make type information visible in the compiled module's introspection. The code is now Python 3 only and follows current Cython best practices.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.