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
Make Body
and ReferenceFrame
analogous
#21964
Comments
I would like to work on this.
Where do I have to add this line? |
In physics module wherever we can pass |
The physics module is really vast, I'm unable to find such functions. Please guide me through, I'm new to sympy. |
The one's that I remember are Physics.mechanics.functions module(Inertia and all) , physics.mechanics.vector.frame (orient functions) and many more. All of the functions would be in mechanics and vector sub module. |
Thanks a lot!
to something like this
as well? |
Only change required is to add seperate check if frame's a body before checking frame. |
It would be nice if duck typing worked, i.e. add all methods to body that mimic ReferenceFrame. |
Yes that's the end goal, Body should have everything possible that Particle, Rigid body and Reference Frame has. |
Is this issue still open? |
I would like to work on this issue. I am pretty new to open source development so I think this problem will be a great way to start |
The current solutions here seem to focus on checking on every usage whether something is not a def __getattr__(self, name):
if hasattr(self.frame, name):
return self.frame.__getattribute__(name)
else:
raise AttributeError This is why I use |
I may have a better solution, since the solution I just proposed, will probably be too tricky to get working nicely. It is also a bit more like the current proposed implementation with
def _get_checked_frame(other):
frame = getattr(other, 'frame', other)
_check_frame(frame)
return frame The advantage of these solutions is that it will be more future proof and it will also return the responsibility a bit more to the classes themselves, instead of to the client. |
Hey there! |
I cannot seem to find a discussion I had about whether it should entirely stay composition or not. I thought that the conclusion of that discussion was that it would be better to just leave it as composition and let them not become entirely analogous. However I cannot entirely confirm this, as I cannot find where that discussion took place. Another argument to maybe close this issue is that the |
Hey! So, as per this issue, we started off with making So, with all said above, doesn't it fit that this issue can be closed now or after deprecating |
I would also like to mention regarding the original issue: |
Hey @tjstienstra, Based on this comment of yours, I would think that it's best to close this issue as to keep things in order and clean. |
I think this issue needs to be closed since Body has been deprecated |
Body
andReferenceFrame
are analogous in dynamics, and all the joint classes , jointsmethod and class body follow it, but rest of physics module doesn't.Example -
So where ever ReferenceFrame works on being passed as arg, passing body to same arg should also work.
It can be done simply by -
cc - @moorepants
The text was updated successfully, but these errors were encountered: