Repository navigation
Conversation
Include union operators in argument, default, return and summary parsing. The filesystem caster already accepts PathLike, str and bytes; truncation misrepresents that contract in generated signatures. Add public IO annotation regressions and document the accepted filename forms.
|
Thanks for submitting this pull request! The maintainers of this repository would appreciate if you could update the CHANGELOG.md based on your changes. |
Record the corrected generated file path, default and return annotations in the Main changelog as requested by the repository contribution bot.
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.
Type
Motivation and Context
The pybind11 filesystem caster accepts
str,bytes, andos.PathLikeand emits the unionos.PathLike | str | bytes. Open3D's docstring parser stops at|, so the generated file-IO annotations omit valid string and byte filenames. This also truncates union return types and can move the remainder of a return annotation into the summary.Checklist
python util/check_style.py --apply --changed-only --no_parallelto apply Open3D code style.Description
Preserve
|when parsing argument annotations, argument annotations with defaults, return annotations, and the boundary preceding the summary. Keep the existing public APIs, non-union defaults, and summary text. Add four public file-IO annotation regressions and document apathlib.Pathwrite / string read example.Plan summary: restore annotations for accepted runtime inputs, preserve defaults and return descriptions, and verify the complete production parser through native bindings, generated stubs, filename IO and the repository style checks.
Validation:
docstring.cpp,Helper.cpp, andLogging.cpp, then the same translation units with the parser fix, using the actual project headers, pybind11 3.0.0, Eigen, fmt 12.1.0, and Python 3.12 SDK. A native binding fixture calls the productionFunctionDocInject; its 18 checks cover unions, optional/default arguments, nested annotations, return types, summaries, ordinary defaults, and real filesystem IO. Before: 9 passed / 9 failed. After: 18 passed / 0 failed.strandbytes.osimport and pybind11 emits an unparameterizedos.PathLike. An independent published-stubgen 3.0.0 control correctly importsosbut still reports fourPathLike[Unknown]diagnostics under the same strict rules. These dependency limitations remain outside this patch.str/bytes/PathIO and optional/default/return calls. With the unmodified official wheel, all four new public annotation regressions fail as expected; the complete existingpython/test/io/test_io.pypasses, and the actual documentation example executes successfully.The parser validation compiles its complete production translation units with real dependencies; the official-wheel runtime and public-test control is independent. The complete patched Open3D Python package, full documentation build, and supported-platform CI were not rebuilt or run locally. The four public annotation tests need the rebuilt patched package in CI. The strict typecheck still has the independent annotation limitations described above.