Reorganize Python unit tests for modmesh::universe#705
Merged
yungyuc merged 2 commits intosolvcon:masterfrom Mar 29, 2026
Merged
Reorganize Python unit tests for modmesh::universe#705yungyuc merged 2 commits intosolvcon:masterfrom
modmesh::universe#705yungyuc merged 2 commits intosolvcon:masterfrom
Conversation
d924e27 to
0693f66
Compare
* `test_universe_shape0d.py`: * `BersteinTB`, `BersteinPolynomialTC`, `BernsteinInterpolationTC` * `Point3dTB`, `Point3dFp32TC`, `Point3dFp64TC` * `test_universe_shape1d.py`: * `Segment3dTB`, `Segment3dFp32TC`, `Segment3dFp64TC` * `Bezier3dTB`, `Bezier3dFp32TC`, `Segment3dFp64TC` * `SegmentPadTB`, `SegmentPadFp32TC`, `SegmentPadFp64TC` * `CurvePadTB`, `CurvePadFp32TC`, `CurvePadFp64TC` * `test_universe_shape2d.py` * `Triangle3dTB`, `Triangle3dFp32TC`, `Triangle3dFp64TC` * `TrianglePadTB`, `TrianglePadFp32TC`, `TrianglePadFp64TC` There is not unit tests for 3-D shapes yet. The prompts used through clion claude plugin are: - Split the tests in `test_universe.py` into `test_universe_shape0d.py`, `test_universe_shape1d.py`, `test_universe_shape2d.py`, `test_universe_shape3d.py` based on the wrapped C++ classes that are wrapped in `wrap_shape0d.cpp`, `wrap_shape1d.cpp`, `wrap_shape2d.cpp`, `wrap_shape3d.cpp` under `cpp/modmesh/universe/pymod/`.
…erse_shape2d.py` * From `test_polygon3d.py`: * `Polygon3dTB`, `Polygon3dFp32TC`, `Polygon3dFp64TC` * Form `test_universe_trap.py`: * `TrapezoidalDecomposerTB`, `TrapezoidalDecomposerFp32TC`, `TrapezoidalDecomposerFp64TC`
0693f66 to
d82d036
Compare
yungyuc
commented
Mar 29, 2026
Member
Author
There was a problem hiding this comment.
Contents in this file test_universe_shape0d.py come from test_universe.py:
BersteinTB,BersteinPolynomialTC,BernsteinInterpolationTCPoint3dTB,Point3dFp32TC,Point3dFp64TC
Member
Author
There was a problem hiding this comment.
Contents in this file test_universe_shape1d.py come from test_universe.py:
Segment3dTB,Segment3dFp32TC,Segment3dFp64TCBezier3dTB,Bezier3dFp32TC,Segment3dFp64TCSegmentPadTB,SegmentPadFp32TC,SegmentPadFp64TCCurvePadTB,CurvePadFp32TC,CurvePadFp64TC
Member
Author
There was a problem hiding this comment.
Contents in this file test_universe_shape2d.py come from:
- Extracted from
test_universe.py:Triangle3dTB,Triangle3dFp32TC,Triangle3dFp64TCTrianglePadTB,TrianglePadFp32TC,TrianglePadFp64TC
- Moved from
test_polygon3d.py:Polygon3dTB,Polygon3dFp32TC,Polygon3dFp64TC
- Moved
test_universe_trap.py:TrapezoidalDecomposerTB,TrapezoidalDecomposerFp32TC,TrapezoidalDecomposerFp64TC
Member
Author
There was a problem hiding this comment.
test_universe_trap.py contents are moved to test_universe_shape0d.py.
Member
Author
There was a problem hiding this comment.
The tests that remains in this file test_universe.py:
WorldTB,WorldFp32TC,WorldFp64TC
Tests factor out from this file test_universe.py:
- To
test_universe_shape0d.py:BersteinTB,BersteinPolynomialTC,BernsteinInterpolationTCPoint3dTB,Point3dFp32TC,Point3dFp64TC
- To
test_universe_shape1d.py:Segment3dTB,Segment3dFp32TC,Segment3dFp64TCBezier3dTB,Bezier3dFp32TC,Segment3dFp64TCSegmentPadTB,SegmentPadFp32TC,SegmentPadFp64TCCurvePadTB,CurvePadFp32TC,CurvePadFp64TC
- To
test_universe_shape2d.pyTriangle3dTB,Triangle3dFp32TC,Triangle3dFp64TCTrianglePadTB,TrianglePadFp32TC,TrianglePadFp64TC
Member
Author
|
I am merging the PR. @tigercosmos @c1ydehhx please take a look. |
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.
Python unit test cases for C++
modmesh::universescattered intest_universe.py,test_polygon3d.py, andtest_universe_trap.py, and were not organized well. This PR reorganize the tests totest_universe_shape0d.py,test_universe_shape1d.py, andtest_universe_shape2d.py.Note
There are not unit tests for 3-D shapes yet. Then file
test_universe_shape3d.pyis not created.Factor out the tests in
test_universe.pyto distinct files:test_universe_shape0d.py:BersteinTB,BersteinPolynomialTC,BernsteinInterpolationTCPoint3dTB,Point3dFp32TC,Point3dFp64TCtest_universe_shape1d.py:Segment3dTB,Segment3dFp32TC,Segment3dFp64TCBezier3dTB,Bezier3dFp32TC,Segment3dFp64TCSegmentPadTB,SegmentPadFp32TC,SegmentPadFp64TCCurvePadTB,CurvePadFp32TC,CurvePadFp64TCtest_universe_shape2d.pyTriangle3dTB,Triangle3dFp32TC,Triangle3dFp64TCTrianglePadTB,TrianglePadFp32TC,TrianglePadFp64TCMerge 2-D shape test cases to
test_universe_shape2d.py:test_polygon3d.py:Polygon3dTB,Polygon3dFp32TC,Polygon3dFp64TCtest_universe_trap.py:TrapezoidalDecomposerTB,TrapezoidalDecomposerFp32TC,TrapezoidalDecomposerFp64TCThe tests that remains in
test_universe.py:WorldTB,WorldFp32TC,WorldFp64TCI have manually diff'ed to confirm the moved code is identical.
Note
The prompts used through clion claude plugin are:
test_universe.pyintotest_universe_shape0d.py,test_universe_shape1d.py,test_universe_shape2d.py,test_universe_shape3d.pybased on the wrapped C++ classes that are wrappedin
wrap_shape0d.cpp,wrap_shape1d.cpp,wrap_shape2d.cpp,wrap_shape3d.cppundercpp/modmesh/universe/pymod/.