{"action":"created","comment":{"url":"https://api.github.com/repos/pydy/pydy/pulls/comments/34960226","id":34960226,"diff_hunk":"@@ -0,0 +1,112 @@\n+#!/usr/bin/env python\n+# -*- coding: utf-8 -*-\n+\n+# external libraries\n+from sympy import Symbol\n+from sympy.physics.vector import Point, Dyadic, ReferenceFrame\n+from sympy.physics.mechanics import Particle, RigidBody,\\\n+    dynamicsymbols, outer\n+\n+# local\n+from ..bodies import Body\n+\n+\n+def test_points(point1, point2):\n+    assert point1.name == point2.name\n+    assert point1._pos_dict == point2._pos_dict\n+    assert point1._vel_dict == point2._vel_dict\n+    assert point1._acc_dict == point2._acc_dict\n+\n+\n+def test_referenceframes(frame1, frame2):\n+    assert frame1.name == frame2.name\n+    assert frame1.str_vecs == frame2.str_vecs\n+    assert frame1.indices == frame2.indices\n+    assert frame1.varlist == frame2.varlist\n+    assert frame1._dlist == frame2._dlist\n+    assert frame1._ang_vel_dict == frame2._ang_vel_dict\n+    assert frame1._ang_acc_dict == frame2._ang_acc_dict\n+    assert frame1._dcm_dict == frame2._dcm_dict\n+\n+class TestBody():\n+    def test_default(self):\n+        body = Body('body')\n+        assert body.name == 'body'\n+        assert body.parent is None\n+        assert body.child is None\n+        assert body.force_list == []\n+        assert body._coordinates == []\n+        assert body._speeds == []\n+        test_points(body._masscenter, Point('body_masscenter'))\n+        assert body._mass == Symbol('body_mass')\n+        test_referenceframes(body._frame, ReferenceFrame('body_frame'))\n+        assert body._inertia == (outer(body._frame.x, body._frame.x),\n+                                 body._masscenter)\n+        assert isinstance(body.body, RigidBody)\n+\n+        rigidbody = body.body\n+        test_points(rigidbody.masscenter, body._masscenter)\n+        assert rigidbody.mass == body._mass\n+        test_referenceframes(rigidbody.frame, body._frame)\n+        assert rigidbody.inertia == body._inertia\n+\n+    def test_custom_rigid_body(self):\n+        masscenter = Point('rigidbody_masscenter')\n+        mass = Symbol('rigidbody_mass')\n+        frame = ReferenceFrame('rigidbody_frame')\n+        inertia = outer(frame.x, frame.x)\n+        inertia_tuple = (inertia, masscenter)\n+        self.rigidbody_body = Body('rigidbody_body', masscenter, mass, frame,\n+                                   inertia_tuple)\n+        test_points(self.rigidbody_body._masscenter, masscenter)\n+        assert self.rigidbody_body._mass == mass\n+        test_referenceframes(self.rigidbody_body._frame, frame)\n+        assert self.rigidbody_body._inertia == inertia_tuple\n+        assert isinstance(self.rigidbody_body.body, RigidBody)\n+\n+    def test_particle_body(self):\n+        masscenter = Point('particle_masscenter')\n+        mass = Symbol('particle_mass')\n+        frame = ReferenceFrame('particle_frame')\n+        self.particle_body = Body('particle_body', masscenter, mass, frame)\n+        test_points(self.particle_body._masscenter, masscenter)\n+        assert self.particle_body._mass == mass\n+        test_referenceframes(self.particle_body._frame, frame)\n+        assert self.particle_body._inertia is None\n+        assert isinstance(self.particle_body.body, Particle)\n+\n+    def test_add_coordinates(self):\n+        for body in [self.rigidbody_body, self.particle_body]:\n+            assert body._coordinates == []\n+            q1 = dynamicsymbols('q1')\n+            body.add_coordinate(q1)","path":"pydy/tests/test_bodies.py","position":82,"original_position":82,"commit_id":"bdf54ea27f250baca81a337546516242fe85f06f","original_commit_id":"bdf54ea27f250baca81a337546516242fe85f06f","user":{"login":"moorepants","id":276007,"avatar_url":"https://avatars.githubusercontent.com/u/276007?v=3","gravatar_id":"","url":"https://api.github.com/users/moorepants","html_url":"https://github.com/moorepants","followers_url":"https://api.github.com/users/moorepants/followers","following_url":"https://api.github.com/users/moorepants/following{/other_user}","gists_url":"https://api.github.com/users/moorepants/gists{/gist_id}","starred_url":"https://api.github.com/users/moorepants/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moorepants/subscriptions","organizations_url":"https://api.github.com/users/moorepants/orgs","repos_url":"https://api.github.com/users/moorepants/repos","events_url":"https://api.github.com/users/moorepants/events{/privacy}","received_events_url":"https://api.github.com/users/moorepants/received_events","type":"User","site_admin":false},"body":"This method needs more explanation. Why do you need to store coordinates on a body?\r\n\r\nAlso, I'm not found of this `add_` method. If `_coordinates` is a list, why not just use the append method?","created_at":"2015-07-19T17:46:27Z","updated_at":"2015-07-19T17:46:27Z","html_url":"https://github.com/pydy/pydy/pull/250#discussion_r34960226","pull_request_url":"https://api.github.com/repos/pydy/pydy/pulls/250","_links":{"self":{"href":"https://api.github.com/repos/pydy/pydy/pulls/comments/34960226"},"html":{"href":"https://github.com/pydy/pydy/pull/250#discussion_r34960226"},"pull_request":{"href":"https://api.github.com/repos/pydy/pydy/pulls/250"}}},"pull_request":{"url":"https://api.github.com/repos/pydy/pydy/pulls/250","id":38724661,"html_url":"https://github.com/pydy/pydy/pull/250","diff_url":"https://github.com/pydy/pydy/pull/250.diff","patch_url":"https://github.com/pydy/pydy/pull/250.patch","issue_url":"https://api.github.com/repos/pydy/pydy/issues/250","number":250,"state":"open","locked":false,"title":"Base structure of Body class and tests added","user":{"login":"sahilshekhawat","id":5890452,"avatar_url":"https://avatars.githubusercontent.com/u/5890452?v=3","gravatar_id":"","url":"https://api.github.com/users/sahilshekhawat","html_url":"https://github.com/sahilshekhawat","followers_url":"https://api.github.com/users/sahilshekhawat/followers","following_url":"https://api.github.com/users/sahilshekhawat/following{/other_user}","gists_url":"https://api.github.com/users/sahilshekhawat/gists{/gist_id}","starred_url":"https://api.github.com/users/sahilshekhawat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sahilshekhawat/subscriptions","organizations_url":"https://api.github.com/users/sahilshekhawat/orgs","repos_url":"https://api.github.com/users/sahilshekhawat/repos","events_url":"https://api.github.com/users/sahilshekhawat/events{/privacy}","received_events_url":"https://api.github.com/users/sahilshekhawat/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-06-28T12:26:25Z","updated_at":"2015-07-19T17:46:27Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c1949b547516d23cdfbf4454bf9b4d322e00ab13","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/pydy/pydy/pulls/250/commits","review_comments_url":"https://api.github.com/repos/pydy/pydy/pulls/250/comments","review_comment_url":"https://api.github.com/repos/pydy/pydy/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pydy/pydy/issues/250/comments","statuses_url":"https://api.github.com/repos/pydy/pydy/statuses/bdf54ea27f250baca81a337546516242fe85f06f","head":{"label":"sahilshekhawat:system_joints_bodies","ref":"system_joints_bodies","sha":"bdf54ea27f250baca81a337546516242fe85f06f","user":{"login":"sahilshekhawat","id":5890452,"avatar_url":"https://avatars.githubusercontent.com/u/5890452?v=3","gravatar_id":"","url":"https://api.github.com/users/sahilshekhawat","html_url":"https://github.com/sahilshekhawat","followers_url":"https://api.github.com/users/sahilshekhawat/followers","following_url":"https://api.github.com/users/sahilshekhawat/following{/other_user}","gists_url":"https://api.github.com/users/sahilshekhawat/gists{/gist_id}","starred_url":"https://api.github.com/users/sahilshekhawat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sahilshekhawat/subscriptions","organizations_url":"https://api.github.com/users/sahilshekhawat/orgs","repos_url":"https://api.github.com/users/sahilshekhawat/repos","events_url":"https://api.github.com/users/sahilshekhawat/events{/privacy}","received_events_url":"https://api.github.com/users/sahilshekhawat/received_events","type":"User","site_admin":false},"repo":{"id":30242917,"name":"pydy","full_name":"sahilshekhawat/pydy","owner":{"login":"sahilshekhawat","id":5890452,"avatar_url":"https://avatars.githubusercontent.com/u/5890452?v=3","gravatar_id":"","url":"https://api.github.com/users/sahilshekhawat","html_url":"https://github.com/sahilshekhawat","followers_url":"https://api.github.com/users/sahilshekhawat/followers","following_url":"https://api.github.com/users/sahilshekhawat/following{/other_user}","gists_url":"https://api.github.com/users/sahilshekhawat/gists{/gist_id}","starred_url":"https://api.github.com/users/sahilshekhawat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sahilshekhawat/subscriptions","organizations_url":"https://api.github.com/users/sahilshekhawat/orgs","repos_url":"https://api.github.com/users/sahilshekhawat/repos","events_url":"https://api.github.com/users/sahilshekhawat/events{/privacy}","received_events_url":"https://api.github.com/users/sahilshekhawat/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sahilshekhawat/pydy","description":"Multibody dynamics tool kit.","fork":true,"url":"https://api.github.com/repos/sahilshekhawat/pydy","forks_url":"https://api.github.com/repos/sahilshekhawat/pydy/forks","keys_url":"https://api.github.com/repos/sahilshekhawat/pydy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sahilshekhawat/pydy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sahilshekhawat/pydy/teams","hooks_url":"https://api.github.com/repos/sahilshekhawat/pydy/hooks","issue_events_url":"https://api.github.com/repos/sahilshekhawat/pydy/issues/events{/number}","events_url":"https://api.github.com/repos/sahilshekhawat/pydy/events","assignees_url":"https://api.github.com/repos/sahilshekhawat/pydy/assignees{/user}","branches_url":"https://api.github.com/repos/sahilshekhawat/pydy/branches{/branch}","tags_url":"https://api.github.com/repos/sahilshekhawat/pydy/tags","blobs_url":"https://api.github.com/repos/sahilshekhawat/pydy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sahilshekhawat/pydy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sahilshekhawat/pydy/git/refs{/sha}","trees_url":"https://api.github.com/repos/sahilshekhawat/pydy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sahilshekhawat/pydy/statuses/{sha}","languages_url":"https://api.github.com/repos/sahilshekhawat/pydy/languages","stargazers_url":"https://api.github.com/repos/sahilshekhawat/pydy/stargazers","contributors_url":"https://api.github.com/repos/sahilshekhawat/pydy/contributors","subscribers_url":"https://api.github.com/repos/sahilshekhawat/pydy/subscribers","subscription_url":"https://api.github.com/repos/sahilshekhawat/pydy/subscription","commits_url":"https://api.github.com/repos/sahilshekhawat/pydy/commits{/sha}","git_commits_url":"https://api.github.com/repos/sahilshekhawat/pydy/git/commits{/sha}","comments_url":"https://api.github.com/repos/sahilshekhawat/pydy/comments{/number}","issue_comment_url":"https://api.github.com/repos/sahilshekhawat/pydy/issues/comments{/number}","contents_url":"https://api.github.com/repos/sahilshekhawat/pydy/contents/{+path}","compare_url":"https://api.github.com/repos/sahilshekhawat/pydy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sahilshekhawat/pydy/merges","archive_url":"https://api.github.com/repos/sahilshekhawat/pydy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sahilshekhawat/pydy/downloads","issues_url":"https://api.github.com/repos/sahilshekhawat/pydy/issues{/number}","pulls_url":"https://api.github.com/repos/sahilshekhawat/pydy/pulls{/number}","milestones_url":"https://api.github.com/repos/sahilshekhawat/pydy/milestones{/number}","notifications_url":"https://api.github.com/repos/sahilshekhawat/pydy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sahilshekhawat/pydy/labels{/name}","releases_url":"https://api.github.com/repos/sahilshekhawat/pydy/releases{/id}","created_at":"2015-02-03T13:02:45Z","updated_at":"2015-05-04T13:12:40Z","pushed_at":"2015-07-17T14:23:10Z","git_url":"git://github.com/sahilshekhawat/pydy.git","ssh_url":"git@github.com:sahilshekhawat/pydy.git","clone_url":"https://github.com/sahilshekhawat/pydy.git","svn_url":"https://github.com/sahilshekhawat/pydy","homepage":"http://pydy.org","size":9498,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"pydy:master","ref":"master","sha":"c133def808554a8c59c92518f0fb670223b2f357","user":{"login":"pydy","id":5125293,"avatar_url":"https://avatars.githubusercontent.com/u/5125293?v=3","gravatar_id":"","url":"https://api.github.com/users/pydy","html_url":"https://github.com/pydy","followers_url":"https://api.github.com/users/pydy/followers","following_url":"https://api.github.com/users/pydy/following{/other_user}","gists_url":"https://api.github.com/users/pydy/gists{/gist_id}","starred_url":"https://api.github.com/users/pydy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pydy/subscriptions","organizations_url":"https://api.github.com/users/pydy/orgs","repos_url":"https://api.github.com/users/pydy/repos","events_url":"https://api.github.com/users/pydy/events{/privacy}","received_events_url":"https://api.github.com/users/pydy/received_events","type":"Organization","site_admin":false},"repo":{"id":12165060,"name":"pydy","full_name":"pydy/pydy","owner":{"login":"pydy","id":5125293,"avatar_url":"https://avatars.githubusercontent.com/u/5125293?v=3","gravatar_id":"","url":"https://api.github.com/users/pydy","html_url":"https://github.com/pydy","followers_url":"https://api.github.com/users/pydy/followers","following_url":"https://api.github.com/users/pydy/following{/other_user}","gists_url":"https://api.github.com/users/pydy/gists{/gist_id}","starred_url":"https://api.github.com/users/pydy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pydy/subscriptions","organizations_url":"https://api.github.com/users/pydy/orgs","repos_url":"https://api.github.com/users/pydy/repos","events_url":"https://api.github.com/users/pydy/events{/privacy}","received_events_url":"https://api.github.com/users/pydy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pydy/pydy","description":"Multibody dynamics tool kit.","fork":false,"url":"https://api.github.com/repos/pydy/pydy","forks_url":"https://api.github.com/repos/pydy/pydy/forks","keys_url":"https://api.github.com/repos/pydy/pydy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pydy/pydy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pydy/pydy/teams","hooks_url":"https://api.github.com/repos/pydy/pydy/hooks","issue_events_url":"https://api.github.com/repos/pydy/pydy/issues/events{/number}","events_url":"https://api.github.com/repos/pydy/pydy/events","assignees_url":"https://api.github.com/repos/pydy/pydy/assignees{/user}","branches_url":"https://api.github.com/repos/pydy/pydy/branches{/branch}","tags_url":"https://api.github.com/repos/pydy/pydy/tags","blobs_url":"https://api.github.com/repos/pydy/pydy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pydy/pydy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pydy/pydy/git/refs{/sha}","trees_url":"https://api.github.com/repos/pydy/pydy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pydy/pydy/statuses/{sha}","languages_url":"https://api.github.com/repos/pydy/pydy/languages","stargazers_url":"https://api.github.com/repos/pydy/pydy/stargazers","contributors_url":"https://api.github.com/repos/pydy/pydy/contributors","subscribers_url":"https://api.github.com/repos/pydy/pydy/subscribers","subscription_url":"https://api.github.com/repos/pydy/pydy/subscription","commits_url":"https://api.github.com/repos/pydy/pydy/commits{/sha}","git_commits_url":"https://api.github.com/repos/pydy/pydy/git/commits{/sha}","comments_url":"https://api.github.com/repos/pydy/pydy/comments{/number}","issue_comment_url":"https://api.github.com/repos/pydy/pydy/issues/comments{/number}","contents_url":"https://api.github.com/repos/pydy/pydy/contents/{+path}","compare_url":"https://api.github.com/repos/pydy/pydy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pydy/pydy/merges","archive_url":"https://api.github.com/repos/pydy/pydy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pydy/pydy/downloads","issues_url":"https://api.github.com/repos/pydy/pydy/issues{/number}","pulls_url":"https://api.github.com/repos/pydy/pydy/pulls{/number}","milestones_url":"https://api.github.com/repos/pydy/pydy/milestones{/number}","notifications_url":"https://api.github.com/repos/pydy/pydy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pydy/pydy/labels{/name}","releases_url":"https://api.github.com/repos/pydy/pydy/releases{/id}","created_at":"2013-08-16T18:16:29Z","updated_at":"2015-07-14T07:34:20Z","pushed_at":"2015-07-17T14:23:11Z","git_url":"git://github.com/pydy/pydy.git","ssh_url":"git@github.com:pydy/pydy.git","clone_url":"https://github.com/pydy/pydy.git","svn_url":"https://github.com/pydy/pydy","homepage":"http://www.pydy.org","size":13451,"stargazers_count":32,"watchers_count":32,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":27,"mirror_url":null,"open_issues_count":60,"forks":27,"open_issues":60,"watchers":32,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pydy/pydy/pulls/250"},"html":{"href":"https://github.com/pydy/pydy/pull/250"},"issue":{"href":"https://api.github.com/repos/pydy/pydy/issues/250"},"comments":{"href":"https://api.github.com/repos/pydy/pydy/issues/250/comments"},"review_comments":{"href":"https://api.github.com/repos/pydy/pydy/pulls/250/comments"},"review_comment":{"href":"https://api.github.com/repos/pydy/pydy/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pydy/pydy/pulls/250/commits"},"statuses":{"href":"https://api.github.com/repos/pydy/pydy/statuses/bdf54ea27f250baca81a337546516242fe85f06f"}}}}