-
Notifications
You must be signed in to change notification settings - Fork 182
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: Sphere, Geometry & Material #946
base: v2
Are you sure you want to change the base?
Conversation
Hello @m-agour! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2024-12-16 15:56:33 UTC |
I will fix the pep8 and upload the tests |
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.
fury/actor/__init__.py
Outdated
@@ -0,0 +1 @@ | |||
from .actor import sphere |
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.
please, use absolute import
fury/actor/actor.py
Outdated
import fury.primitive as fp | ||
import numpy as np | ||
from fury.v2.actor.materials import _create_mesh_material | ||
from fury.v2.actor.geometry import buffer_to_geometry, create_mesh |
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.
import order incorrect,
fury/actor/actor.py
Outdated
opacity=1, | ||
material='phong', | ||
enable_picking=True | ||
): |
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.
do not forget docstring
fury/actor/actor.py
Outdated
if faces is None and vertices is None: | ||
vertices, faces = fp.prim_sphere(phi=phi, theta=theta) |
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.
what happens if only vertices is None ? will it work?
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.
what happens if only vertices is None ? will it work?
@skoudoro No, It will not work and I can't imagine any use case for giving the vertices and faces of a sphere to create a sphere. Do you think we should remove it or keep it?
fury/actor/actor.py
Outdated
scales=scales, | ||
) | ||
big_verts, big_faces, big_colors, _ = res | ||
print(big_colors) |
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.
print to remove
fury/actor/geometry.py
Outdated
@@ -0,0 +1,32 @@ | |||
from pygfx import Geometry, Mesh |
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.
not sure geometry should be under actor folder
fury/actor/actor.py
Outdated
@@ -0,0 +1,54 @@ | |||
import fury.primitive as fp |
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.
not sure actor should be under actor folder. let's keep it simple and create submodule later
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 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.
Please take a look at requesting changes and move faster on this @m-agour .
Thanks!
fury/actor/actor.py
Outdated
@@ -0,0 +1,54 @@ | |||
import fury.primitive as fp |
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.
fury/actor/materials.py
Outdated
pick_write=enable_picking, | ||
color_mode='vertex' if color is None else 'auto', | ||
color=color if color is not None else (1, 1, 1, opacity if color is None else 1), | ||
) |
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.
Throw an exception if the material does not equal to one of the configured types.
I think it is over-engineering @maharshi-gor. Let's keep it simple and split when we feel the need.
odf can be used in other field like Geophysics, Astrophysics and Cosmology. We want fury to be generic. if odf is in |
6b40a10
to
4e15a30
Compare
Also, try to squash your commit @m-agour please! |
Thank you @skoudoro @maharshi-gor for your reviews I am already working on them and would finish them by tomorrow the 14th. |
768a0af
to
a05fe70
Compare
NF: mesh material NF: geometry & mesh NF: added sphere actor RF: init actors BF: fix `sphere` opacity RF: pep8 issues fix & absolute import RF: convert `actor` module into fury/actor.py DOC: updated Sphere&material docstring
a05fe70
to
d4c7660
Compare
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.
Hi @m-agour,
Thank you for the update. Here some initial review before trying it.
Also, Can you run pre-commit to make to follow the standard?
pip install pre-commit
pre-commit install
pre-commit run my_py_files
Spheres positions. | ||
colors : ndarray, shape (N, 3) or (N, 4) or tuple (3,) or tuple (4,) | ||
RGB or RGBA (for opacity) R, G, B, and A should be in the range [0, 1]. | ||
radii : float or ndarray, shape (N,) |
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.
, optional
to add
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.
you just missed this one
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.
Ok, overall, it looks good!
Thank you for this @m-agour. I need to try it locally, butI think it is ready to be merged.
@maharshi-gor, Do you want to give it a look? if no news, I will go ahead and merge it tomorrow.
I haven't tried as I need to device the tutorial on this. But looking at the PR LGTM. I will give feedback as I have those tutorials ready. |
Thank you, @skoudoro and @maharshi-gor for your reviews! |
Added Sphere actor.