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: adding primitive stars, 3D stars, rhombi. #170

Closed
wants to merge 9 commits into from

Conversation

lidonohu
Copy link
Contributor

@lidonohu lidonohu commented Feb 27, 2020

  • test file

  • add primitive

@pep8speaks
Copy link

pep8speaks commented Feb 27, 2020

Hello @lidonohu! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 144:80: E501 line too long (80 > 79 characters)

Comment last updated at 2020-03-05 22:16:39 UTC

@codecov
Copy link

codecov bot commented Feb 27, 2020

Codecov Report

Merging #170 into master will decrease coverage by 0.2%.
The diff coverage is 26.66%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #170      +/-   ##
==========================================
- Coverage      88%   87.79%   -0.21%     
==========================================
  Files          17       17              
  Lines        4184     4196      +12     
  Branches      518      520       +2     
==========================================
+ Hits         3682     3684       +2     
- Misses        365      375      +10     
  Partials      137      137
Impacted Files Coverage Δ
fury/primitive.py 73.11% <26.66%> (-8.37%) ⬇️

@skoudoro skoudoro added this to the v0.5.0 milestone Feb 27, 2020
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 @lidonohu,

Thank you for this! Can you address my comment and update the tests? Thank you

fury/primitive.py Outdated Show resolved Hide resolved
fury/primitive.py Outdated Show resolved Hide resolved
fury/primitive.py Outdated Show resolved Hide resolved
npt.assert_equal(vertices.shape, shape)
npt.assert_equal(np.mean(vertices), 0)
npt.assert_equal(vertices.min(), -.5)
npt.assert_equal(vertices.max(), 0.5)



Copy link
Contributor

Choose a reason for hiding this comment

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

empty line to remove

@@ -5,7 +5,6 @@
from scipy.spatial import ConvexHull
from scipy.spatial import transform


Copy link
Contributor

Choose a reason for hiding this comment

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

empty line to keep

@lidonohu
Copy link
Contributor Author

lidonohu commented Mar 5, 2020

Hi @lidonohu,

Thank you for this! Can you address my comment and update the tests? Thank you

I have made all the corrections that you suggested. Let me know in case of further changes.

@ShreyasFadnavis
Copy link
Member

Hi @lidonohu ! Thank you for this PR -- Looks good to me 👍

@skoudoro ~ The failures for this PR do not seem to be relevant to the files changed. Is this okay?

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 @lidonohu, thank you for the update!

You can see below some comments. As you can see below @ShreyasFadnavis and @lidonohu , there are many points that I do not understand and I think this why all tests are failing. I suppose, a rebase or an update from master will fix these problems

big_vertices += big_centers

return big_vertices, big_triangles, big_colors, big_centers
return big_vertices, big_triangles, big_colors
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do you remove big_centers ?


"""
# duplicated vertices if needed
if not have_tiled_verts:
vertices = np.tile(vertices, (centers.shape[0], 1))
big_vertices = vertices

Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain why do you remove big_vertices?

@@ -117,18 +117,19 @@ def repeat_primitive(vertices, faces, centers, directions=(1, 0, 0),
Expanded triangles that composed our shape to duplicate
big_colors : ndarray
Expanded colors applied to all vertices/faces
big_centers : ndarray
Expanded centers for all vertices/faces
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you explain why you remove this docstring ?

# Get unit shape
unit_verts_size = vertices.shape[0] // centers.shape[0]
unit_triangles_size = faces.shape[0]

big_centers = np.repeat(centers, unit_verts_size, axis=0)
# apply centers position
big_vertices = vertices + big_centers
Copy link
Contributor

Choose a reason for hiding this comment

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

Same questions as above, I don't understand why you add this part? Please, can you explain ?

@@ -163,20 +164,18 @@ def normalize_input(arr, arr_name=''):

# update orientations
directions = normalize_input(directions, 'directions')
big_vertices -= big_centers
Copy link
Contributor

Choose a reason for hiding this comment

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

Same questions as above?

vertices coords that composed our rhombicuboctahedron
my_triangles: ndarray
Triangles that composed our rhombicuboctahedron
"""
Copy link
Contributor

Choose a reason for hiding this comment

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

Missing an empty line


for func, shape in l_primitives:
for func, shape, min, max, mean in l_primitives:
Copy link
Contributor

Choose a reason for hiding this comment

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

min, max, mean are predefined by python so it is better to avoid this variable name. Can you change them? Just put e_min, .... the e is for expected

@lidonohu
Copy link
Contributor Author

All changes have been made in the new PR

@lidonohu lidonohu closed this Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants