-
Notifications
You must be signed in to change notification settings - Fork 271
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
make load functions compatible with pathlib #1176
Conversation
WalkthroughThe updates to the Vedo library's Changes
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- vedo/file_io.py (24 hunks)
Additional context used
Ruff
vedo/file_io.py
1002-1002: Local variable
filename
is assigned to but never usedRemove assignment to unused variable
filename
(F841)
Additional comments not posted (16)
vedo/file_io.py (16)
615-622
: LGTM!The changes to accept
os.PathLike
objects and convert them to strings are correctly implemented.
635-637
: LGTM!The changes to accept
os.PathLike
objects and convert them to strings are correctly implemented.
648-650
: LGTM!The changes to accept
os.PathLike
objects and convert them to strings are correctly implemented.
680-682
: LGTM!The changes to accept
os.PathLike
objects and convert them to strings are correctly implemented.
720-722
: LGTM!The changes to accept
os.PathLike
objects and convert them to strings are correctly implemented.
729-735
: LGTM!The changes to accept
os.PathLike
objects and convert them to strings are correctly implemented.
765-767
: LGTM!The changes to accept
os.PathLike
objects and convert them to strings are correctly implemented.
794-800
: LGTM!The changes to accept
os.PathLike
objects and convert them to strings are correctly implemented.
820-822
: LGTM!The changes to accept
os.PathLike
objects and convert them to strings are correctly implemented.
854-860
: LGTM!The changes to accept
os.PathLike
objects and convert them to strings are correctly implemented.
1132-1134
: LGTM!The changes to accept
os.PathLike
objects and convert them to strings are correctly implemented.
1165-1173
: LGTM!The changes to accept
os.PathLike
objects and convert them to strings are correctly implemented.
Line range hint
1354-1369
:
LGTM!The changes to accept
os.PathLike
objects and convert them to strings are correctly implemented.
1696-1703
: LGTM!The changes to accept
os.PathLike
objects and convert them to strings are correctly implemented.
Line range hint
1720-1733
:
LGTM!The changes to accept
os.PathLike
objects and convert them to strings are correctly implemented.
Line range hint
176-205
:
LGTM! But verify the function usage in the codebase.The changes to accept
os.PathLike
objects are well-implemented. The conversion to string ensures compatibility.Ensure that all function calls to
load
are updated to handleos.PathLike
inputs.
vedo/file_io.py
Outdated
def _import_npy(fileinput: Union[str, os.PathLike]) -> "vedo.Plotter": | ||
"""Import a vedo scene from numpy format.""" | ||
filename = str(fileinput) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the unused variable filename
.
The variable filename
is assigned but never used, which is unnecessary.
- filename = str(fileinput)
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
def _import_npy(fileinput: Union[str, os.PathLike]) -> "vedo.Plotter": | |
"""Import a vedo scene from numpy format.""" | |
filename = str(fileinput) | |
def _import_npy(fileinput: Union[str, os.PathLike]) -> "vedo.Plotter": | |
"""Import a vedo scene from numpy format.""" |
Tools
Ruff
1002-1002: Local variable
filename
is assigned to but never usedRemove assignment to unused variable
filename
(F841)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a typo here, the correct line is fileinput = str(fileinput)
. Corrected in the following commit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Louis-Pujol, thanks for pointing out the typo. I've noted the correct usage of fileinput = str(fileinput)
for future reference.
Learnings added
Learnt from: Louis-Pujol
PR: marcomusy/vedo#1176
File: vedo/file_io.py:0-0
Timestamp: 2024-08-13T07:36:55.144Z
Learning: In the `_import_npy` function, the correct line is `fileinput = str(fileinput)`, not `filename = str(fileinput)`.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- vedo/file_io.py (24 hunks)
Files skipped from review as they are similar to previous changes (1)
- vedo/file_io.py
Thanks! |
Mi @marcomusy
This PR follows issue #1169 the load functions now accept
pathlib.Path
as input, nothing changed in the behavior of the functions, the paths objects are converted to strings at the beginning.