-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Direction methods (VMobject) #647
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
Conversation
|
On a first glance, this looks pretty good already! I'll review this in more detail tomorrow or so. Just as a remark: please avoid creating new branches on the ManimCommunity repository and rather push and PR from your own fork. This helps to keep the main repository clean (#590). |
|
I see. I'm not entirely sure how that works, but if I know GitHub as much as I do it's not gonna look different than the fork/contribution interface currently. I'll keep it in mind. |
huguesdevimeux
left a comment
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.
It's perfect and all but i'm just worried about the used of strings "CW" and "CCW" for this case. Don't you think there is a better way to do this rather than using string ?
I don't know if it is possible to do better in Python, but one solution is to use booleans instead.
I would like to hear of the other's opinion on thisl.
|
Thanks @XorUnison ! Will review at length later but to answer @huguesdevimeux question: maybe you can use an Enum. |
|
Another option would be to return +1 or -1 for positive (counterclockwise) or negative (clockwise) orientation. |
Simplify area sign check Co-authored-by: Hugues Devimeux <[email protected]>
Sure, those are all options, but I am actually rather partial to strings in this case. While those options might be marginally simpler, and there definitely is a correct way of interpreting the sign to mean one or the other direction, my concern with using these shortened strings lies in how it's going to be used and viewed by end users. Pretty much everyone and their dog knows how clockwise and counterclockwise work, and will find it likewise extremely easy to write and see code like |
leotrs
left a comment
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.
I think strings are superior to +1/-1, but I still think an Enum is superior to strings.
However, since in this case there are only two options, I think strings are fine.
@XorUnison would it be too much trouble to ask you to add tests? :)
@leotrs Unless I know where those tests would go with the new structure, it is trouble, heh. The necessary test for direction is of graphical nature, so it has no business in test_vectorized_mobject.py. But test_geometry.py isn't really the place either. So uh... you tell me where it goes, I'll see about adding it. |
behackl
left a comment
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.
This looks very good to me! Added a bunch of tiny suggestions concerning formatting of documentation, one suggestion for a doctest, and a non-blocking wish for a rendered example.
|
I think a classical unit test id fine for this, no? |
Co-authored-by: Benjamin Hackl <[email protected]>
|
I'd rather have more tests than have them organized. So feel free to create a new file |
Co-authored-by: Benjamin Hackl <[email protected]>
Co-authored-by: Benjamin Hackl <[email protected]>
Co-authored-by: Benjamin Hackl <[email protected]>
|
How is this looking? Is this ready for final review? Also, @XorUnison do you think we could close #210 ? I understand this is only a partial implementation of it, but whatever future work should be done in a new PR, not in #210, right? |
Well, I wish. Like I expected the amount and type of change requests is holding this up again. Expect it to be held up for a few more days again or even a week.
I suppose so. I have the issue bookmarked and will open new ones as I get the stuff ready, just expect that to take a lot of time too. |
|
No worries, just wanted an update, didn't want to be pushy :)
…On Wed, Nov 4, 2020 at 9:41 PM XorUnison ***@***.***> wrote:
How is this looking? Is this ready for final review?
Well, I wish. Like I expected the amount and type of change requests is
holding this up again. Expect it to be held up for a few more days again or
even a week.
Also, @XorUnison <https://github.com/XorUnison> do you think we could
close #210 <#210> ? I
understand this is only a partial implementation of it, but whatever future
work should be done in a new PR, not in #210
<#210>, right?
I suppose so. I have the issue bookmarked and will open new ones as I get
the stuff ready, just expect that to take a lot of time too.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#647 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAILYACNU5J5HDEAENUWTHLSOIGFTANCNFSM4TFSTJWQ>
.
--
www.leotrs.com | [email protected]
PhD candidate at the Network Science Institute, Northeastern University
|
Didn't take it as being pushy, no worries there either. I'll have to deal with the |
Adding a rendered example to the docs is easy: prepare a scene to render and put it inside the docstring inside a And this block is put directly into the docstring; I would put this in the examples section of the docstring of |
behackl
left a comment
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.
Looks great, and the example renders and displays correctly. Good to go!
I agree there should be a test for these direction methods. However the only real meaningful test for this is whether or not the array, and thus the drawing direction gets inverted cleanly. While in principle a picture test could be done by snapshotting halfway into the animation, adding a proper simple video test once these are ready to go strikes me as the decidedly better path. |
In that case please add it to #193 |
Partial implementation of #210
Added shoelace method to space_ops.py
Added orientation methods to vectorized_mobject.py, uses shoelace
For test code and a result gif of the added feature, see #210, Test1.