-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Changing the 'side_length' attribute to a property #3901
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
Do you mind adding a test for this behavior? |
Hi @JasonGrace2282, Thank you for your feedback. I have added tests to cover this behavior. The tests can be found in
Previously, changing the |
Please let me know if there are any additional changes or if further testing is needed. Thanks! |
The test seems to fail on Mac. But I think that's because of |
268fe2e
to
508585b
Compare
for more information, see https://pre-commit.ci
Hi @JasonGrace2282 , I hope you're doing well! I wanted to check in on the status of my pull request #3901. Is there anything else I can do or address to help move it forward? Thanks for your time! Just to reiterate, the motivation behind changing From the currect code:
The parameter However, if the proposed change to make
Thank you. |
I think the change itself is fine - I've seen enough confusion about this that it's probably better to make it a property. However, the tests should be working before I'm willing to merge this. Last time I checked, you could get around the floating point error using |
I apologize for the oversight in the tests. I’ll be updating the tests shortly to handle the floating-point precision issues as suggested. I'll commit the changes as soon as they are ready. |
Co-authored-by: Aarush Deshpande <[email protected]>
Hi @JasonGrace2282, I wanted to let you know that I’ve addressed the floating-point precision issue based on your suggestions. All the tests are now passing successfully. It seems that I had initially addressed the floating-point precision issue, but I might have made a mistake in my last commit, which led to the problem persisting. I appreciate your guidance and patience. Please let me know if there are any further adjustments needed. Thank you! |
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.
Seems fine to me, thanks.
Thanks for your help and feedback throughout this process. |
Overview: What does this pull request change?
This
side_length
attribute has no effect on theSquare
class.If I decide to change
side_length
somewhere else in my code by changing this attribute, nothing happens.Motivation and Explanation: Why and how do your changes improve the library?
Here is an illustration of modifying the
side_length
attribute.The side_length does change, but the mobject doesn't change, its height remains the same.
But if I change it via the
height
attribute, it works. However, if I request/change the heigth attribute after a rotation has occurred, the height given is not the side_length.So I think the code needs to be changed, so that the

side_length
attribute has an effect and gives consistent results even after a rotation has occurred.After changing it to a property, it works as expected.
Links to added or changed documentation pages
Further Information and Comments
Reviewer Checklist