Repository navigation
fix(export_utils): return output_obj_path from export_to_obj - #15507
Open
2422725977 wants to merge 1 commit into
Open
2422725977 wants to merge 1 commit into
2422725977 wants to merge 1 commit into
Conversation
This branch has not been deployed
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.
What does this PR do?
export_to_obj(src/diffusers/utils/export_utils.py) creates a temporary.objfile whenoutput_obj_path is None, writes the mesh data to disk, and exits without returningoutput_obj_path(always returningNone). Because the caller has no reference to the temporary path, the generated.objfile is unreachable whenoutput_obj_pathis omitted, and the return behavior is inconsistent with sibling exporters (export_to_ply,export_to_gif,export_to_video).Summary of changes
-> strreturn type annotation andreturn output_obj_pathtoexport_to_objinsrc/diffusers/utils/export_utils.py.TestExportToObj(2 unit tests) intests/others/test_utils.pyverifying both the temporary-path (output_obj_path=None) and explicit-path (output_obj_path=...) return values and written OBJ contents.Verification
PYTHONPATH=src pytest -v tests/others/test_utils.py -k export_to_obj— 2 passedruff check --no-cache src/diffusers/utils/export_utils.py tests/others/test_utils.py— passedruff format --check --no-cache src/diffusers/utils/export_utils.py tests/others/test_utils.py— passedBefore submitting
self-reviewskill on the diff?Self-review notes
export_to_objdefinitions also exist insrc/diffusers/utils/testing_utils.py:824andtests/testing_utils.py:1136; left untouched to keep this PR scoped to the publicdiffusers.utils.export_utilsAPI, happy to update them as well if desired.output_obj_pathis already constructed and written withinexport_to_obj).