GitHub PullRequestReviewCommentEvent at 2014-05-31 09:15:11
Repository: pydy
Actor: tarzzz
Payload: {"comment":{"url":"https://api.github.com/repos/pydy/pydy/pulls/comments/13260221","id":13260221,"diff_hunk":"@@ -294,46 +294,50 @@ def evaluate_transformation_matrix(self, dynamic_values, constant_values):\n             new = self._numeric_transform(*args)\n \n         self._visualization_matrix = new.reshape(n, 16)\n+        self._visualization_matrix = self._visualization_matrix.tolist()\n         return self._visualization_matrix\n \n-    def generate_visualization_dict(self, constant_map={}):\n-        \"\"\"Returns a dictionary of all the info required for the\n-        visualization of this frame.\n-\n-        Before calling this method, all the transformation matrix generation\n-        methods should be called, or it will give an error.\n+    \n+    def generate_scene_dict(self, constant_map={}):\n+        \"\"\"\n+        This method generates information for a static \n+        visualization in the initial conditions, in the form\n+        of dictionary. This contains shape information\n+        from `Shape.generate_dict()` followed by an\n+        init_orientation Key.\n \n         Parameters\n         ==========\n         constant_map : dictionary\n-            If the shape associated with this visualization frame has\n-            symbolic values for its geometric parameters, then you must\n-            supply a dictionary mapping the necessary SymPy symbols to\n-            Python floats.\n+        Constant map is required when Shape contains sympy expressions.This\n+        dictionary maps sympy expressions/symbols to numerical values(floats)\n \n-        Returns\n-        =======\n-        data : dictionary\n-            The dictionary contains the following keys:\n-            name : string\n-                The name of the VisualizationFrame.\n-            shape : dictionary\n-                A dictionary generated from the associated Shape.\n-            simulation_matrix : list\n-                The N x 4 x 4 array provided as a list of lists of lists. N\n-                is the number of time steps and the 4 x 4 matrix at each\n-                time step represents the transformation matrix for animation\n-                purposes.\n+        \"\"\"\n+        _scene_dict = self.shape.generate_dict(constant_map=constant_map)\n+        _scene_dict[\"init_orientation\"] = self._visualization_matrix[0]\n+        _scene_dict[\"reference_frame_name\"] = str(self._reference_frame)\n+        _scene_dict[\"simulation_id\"] = id(self)\n+\n+        return _scene_dict\n \n+    def generate_simulation_dict(self):\n         \"\"\"\n-        data = {}\n-        data['name'] = self.name\n-        data['shape'] = self.shape.generate_dict(constant_map=constant_map)\n+        Generates the simulation information for this visualization\n+        frame. It maps the simulation data information to the\n+        scene information via a unique id.\n+        \n+        \"\"\"\n+        _simulation_dict = {}","path":"pydy/viz/visualization_frame.py","position":63,"original_position":63,"commit_id":"09fc18aaac4082aaab83dd11cb829aea0bcb7b1f","original_commit_id":"09fc18aaac4082aaab83dd11cb829aea0bcb7b1f","user":{"login":"tarzzz","id":1546532,"avatar_url":"https://avatars.githubusercontent.com/u/1546532?","gravatar_id":"b5ed9879d4a5b36a22efdba1eb989aa3","url":"https://api.github.com/users/tarzzz","html_url":"https://github.com/tarzzz","followers_url":"https://api.github.com/users/tarzzz/followers","following_url":"https://api.github.com/users/tarzzz/following{/other_user}","gists_url":"https://api.github.com/users/tarzzz/gists{/gist_id}","starred_url":"https://api.github.com/users/tarzzz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tarzzz/subscriptions","organizations_url":"https://api.github.com/users/tarzzz/orgs","repos_url":"https://api.github.com/users/tarzzz/repos","events_url":"https://api.github.com/users/tarzzz/events{/privacy}","received_events_url":"https://api.github.com/users/tarzzz/received_events","type":"User","site_admin":false},"body":"Yes that is a valid point!. I shall remove underscores, they are not required.","created_at":"2014-05-31T09:15:11Z","updated_at":"2014-05-31T09:15:11Z","html_url":"https://github.com/pydy/pydy/pull/57#discussion_r13260221","pull_request_url":"https://api.github.com/repos/pydy/pydy/pulls/57","_links":{"self":{"href":"https://api.github.com/repos/pydy/pydy/pulls/comments/13260221"},"html":{"href":"https://github.com/pydy/pydy/pull/57#discussion_r13260221"},"pull_request":{"href":"https://api.github.com/repos/pydy/pydy/pulls/57"}}}}