GitHub PullRequestReviewCommentEvent at 2014-04-04 08:17:27
Repository: astropy
Actor: cdeil
Payload: {"comment":{"url":"https://api.github.com/repos/astropy/astropy/pulls/comments/11286146","id":11286146,"diff_hunk":"@@ -134,78 +133,51 @@ def __call__(self, calpha, cdelta):\n         return nphi, ntheta\n \n \n-class MatrixRotation2D(Model):\n+class Rotation2D(Model):\n     \"\"\"\n-    Perform a clockwise 2D matrix rotation given either an angle or a\n-    rotation matrix.\n-\n-    If both matrix and angle are given, angle will be ignored.\n+    Perform a 2D rotation given an angle in degrees, where positive angles\n+    represent a counter-clockwise rotation and vice-versa.\n \n     Parameters\n     ----------\n-    matrix : ndarray\n-        rotation matrix\n     angle : float\n         angle of rotation in deg\n     \"\"\"\n \n-    def _validate_angle(angle):\n+    n_inputs = 2\n+    n_outputs = 2\n+\n+    angle = Parameter(getter=np.rad2deg,\n+                      setter=lambda a: Rotation2D.validate_angle(a),\n+                      default=0.0)\n+\n+    def __init__(self, angle=angle.default):\n+        super(Rotation2D, self).__init__()\n+        self.angle = angle\n+        self._matrix = self._compute_matrix(self._angle)\n+\n+    @staticmethod\n+    def validate_angle(angle):","path":"astropy/modeling/rotations.py","position":46,"original_position":46,"commit_id":"1b140b83e6b2ba5ac3e2267dd3b456fbfe26cc83","original_commit_id":"1b140b83e6b2ba5ac3e2267dd3b456fbfe26cc83","user":{"login":"cdeil","id":852409,"avatar_url":"https://avatars.githubusercontent.com/u/852409?","gravatar_id":"898a54809b35f7b68226f821ac54bfae","url":"https://api.github.com/users/cdeil","html_url":"https://github.com/cdeil","followers_url":"https://api.github.com/users/cdeil/followers","following_url":"https://api.github.com/users/cdeil/following{/other_user}","gists_url":"https://api.github.com/users/cdeil/gists{/gist_id}","starred_url":"https://api.github.com/users/cdeil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cdeil/subscriptions","organizations_url":"https://api.github.com/users/cdeil/orgs","repos_url":"https://api.github.com/users/cdeil/repos","events_url":"https://api.github.com/users/cdeil/events{/privacy}","received_events_url":"https://api.github.com/users/cdeil/received_events","type":"User","site_admin":false},"body":"Should this method be public?","created_at":"2014-04-04T08:17:27Z","updated_at":"2014-04-04T08:17:27Z","html_url":"https://github.com/astropy/astropy/pull/2269#discussion_r11286146","pull_request_url":"https://api.github.com/repos/astropy/astropy/pulls/2269","_links":{"self":{"href":"https://api.github.com/repos/astropy/astropy/pulls/comments/11286146"},"html":{"href":"https://github.com/astropy/astropy/pull/2269#discussion_r11286146"},"pull_request":{"href":"https://api.github.com/repos/astropy/astropy/pulls/2269"}}}}