Skip to content
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

NF: All shape actor based on primitive #967

Open
wants to merge 11 commits into
base: v2
Choose a base branch
from

Conversation

ManishReddyR
Copy link

Hello,
Tried create the actor for Tetrahedron and also added few of the uni tests cases.
Tetrahedron_mc
Tetrahedron_sc
Thank You
Manish Rakasi

Copy link
Contributor

@skoudoro skoudoro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ManishReddyR,

  • Can you rebase this PR on the top of the v2 branch (it avoids to see 15 commits)
  • Can you do all of them in one PR? update this PR with all shape actor based on primitive. easy to review. I think it would be better than one by one. in this specific case.

thank you

@ManishReddyR ManishReddyR changed the title NF: Adding actor for Tetrahedron, TEST: Adding uni tests for Tetrahedron NF: All shape actor based on primitive Jan 28, 2025
@ManishReddyR
Copy link
Author

Tried adding actor for icosahedron.
icosahedron_sc
icosahedron_mc

Thank you
Manish Rakasi

@ManishReddyR ManishReddyR requested a review from skoudoro January 28, 2025 20:31
@skoudoro
Copy link
Contributor

I see you requested a review @ManishReddyR. Thank you for the update.

What about superquadric, rectangle, arrow, cone, triangularprism, rhombicuboctahedron, pentagonalprism, octagonalprism, tetrahedron, icosahedron, star?

@skoudoro
Copy link
Contributor

keep doing 1 commit per primitives shape, this is great and easier to review.

Thanks

Copy link
Contributor

@skoudoro skoudoro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See my comment above, many shapes are missing.

Otherwise, it looks good as it is now

@ManishReddyR
Copy link
Author

ManishReddyR commented Jan 28, 2025

I see you requested a review @ManishReddyR. Thank you for the update.

What about superquadric, rectangle, arrow, cone, triangularprism, rhombicuboctahedron, pentagonalprism, octagonalprism, tetrahedron, icosahedron, star?

working on it, will complete all of them by end of this weekend. And will update you.
Thanks for your review.

@ManishReddyR
Copy link
Author

Added the actor for rhombicuboctahedron, and also added the uni tests.
rhombicuboctahedron mc
rhombicuboctahedron sc

Thank You

@ManishReddyR
Copy link
Author

Added the actor for the triangularprism, And also added the uni tests for triangularprism actor.

triangularprism_mc triangularprism_sc

Thank you

@ManishReddyR
Copy link
Author

Added actor for pentagonalprism, and added uni tests for pentagonalprism.

pentagonalprism_mc pentagonalprism_sc

Thank you

@ManishReddyR
Copy link
Author

Added the actor for octogonal prism, and also added uni tests for octogonal prism actor.

octagonalprism_mc octagonalprism_sc

Thank you

@ManishReddyR
Copy link
Author

Added actor for arrow and also added uni tests for arrow.

Arrow_SC Arrow_MC

Thank you

@ManishReddyR
Copy link
Author

Added actor for superquadric and also added uni tests for superquadric.

superquadric_mc superquadric_sc

Thank you

@ManishReddyR
Copy link
Author

Hello @skoudoro ,

Can you review the actors, which I have added.

Thank you

@skoudoro
Copy link
Contributor

Hi @ManishReddyR,

I will look at this on Friday. Thank you for working on this.

Can you update your tests ? they seems repetitive. Look here for an example on how you could refactor all of this:

def test_vertices_primitives():
# Tests the default vertices of all the built in primitive shapes.
l_primitives = [
(fp.prim_square, (4, 3), -0.5, 0.5, 0),
(fp.prim_box, (8, 3), -0.5, 0.5, 0),
(fp.prim_tetrahedron, (4, 3), -0.5, 0.5, 0),
(fp.prim_star, (10, 3), -3, 3, -0.0666666666),
(fp.prim_rhombicuboctahedron, (24, 3), -0.5, 0.5, 0),
(fp.prim_frustum, (8, 3), -0.5, 0.5, 0),
]
for func, shape, e_min, e_max, e_mean in l_primitives:
vertices, _ = func()
npt.assert_equal(vertices.shape, shape)
npt.assert_almost_equal(np.mean(vertices), e_mean)
npt.assert_equal(vertices.min(), e_min)
npt.assert_equal(vertices.max(), e_max)

@maharshi-gor
Copy link
Contributor

Hi @ManishReddyR Thank you for the work.

@skoudoro should we use only npt for the assertions? I see we have used mixture of assert and npt assert. If not, any specific reason for the same?

@skoudoro
Copy link
Contributor

@skoudoro should we use only npt for the assertions? I see we have used mixture of assert and npt assert. If not, any specific reason for the same?

it is fine, as soon as they are explicit enough. assert do no handle array so npt assert is needed

@ManishReddyR
Copy link
Author

Added actor for cone, and also uni tests for the cone actors.

cone_mc cone_sc

Thank you

@ManishReddyR
Copy link
Author

Added actor for star, and also added uni tests for star.

Star_mc star_sc

I have added almost all the actors based on the primitive. Now working on refactoring of the test cases.

Thank you

Copy link
Contributor

@skoudoro skoudoro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, it is good,

see the comment below to update. Waiting for the tests refactorization also. Thank @ManishReddyR

fury/actor.py Outdated Show resolved Hide resolved
fury/actor.py Outdated Show resolved Hide resolved
fury/actor.py Outdated Show resolved Hide resolved
fury/actor.py Outdated Show resolved Hide resolved
fury/actor.py Outdated Show resolved Hide resolved
fury/actor.py Show resolved Hide resolved
fury/actor.py Outdated Show resolved Hide resolved
fury/actor.py Outdated Show resolved Hide resolved
@ManishReddyR
Copy link
Author

Hello @skoudoro ,
Thanks for your review, and also refactored the tests.

@ManishReddyR ManishReddyR requested a review from skoudoro February 1, 2025 03:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants