{"action":"created","issue":{"url":"https://api.github.com/repos/adrn/gala/issues/39","repository_url":"https://api.github.com/repos/adrn/gala","labels_url":"https://api.github.com/repos/adrn/gala/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/adrn/gala/issues/39/comments","events_url":"https://api.github.com/repos/adrn/gala/issues/39/events","html_url":"https://github.com/adrn/gala/issues/39","id":146797898,"number":39,"title":"Add a way for spherical potentials to be called with just radius ","user":{"login":"adrn","id":583379,"avatar_url":"https://avatars.githubusercontent.com/u/583379?v=3","gravatar_id":"","url":"https://api.github.com/users/adrn","html_url":"https://github.com/adrn","followers_url":"https://api.github.com/users/adrn/followers","following_url":"https://api.github.com/users/adrn/following{/other_user}","gists_url":"https://api.github.com/users/adrn/gists{/gist_id}","starred_url":"https://api.github.com/users/adrn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrn/subscriptions","organizations_url":"https://api.github.com/users/adrn/orgs","repos_url":"https://api.github.com/users/adrn/repos","events_url":"https://api.github.com/users/adrn/events{/privacy}","received_events_url":"https://api.github.com/users/adrn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/adrn/gala/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/adrn/gala/labels/priority:high","name":"priority:high","color":"e99695"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/adrn/gala/milestones/2","html_url":"https://github.com/adrn/gala/milestones/v0.2","labels_url":"https://api.github.com/repos/adrn/gala/milestones/2/labels","id":1760953,"number":2,"title":"v0.2","description":null,"creator":{"login":"adrn","id":583379,"avatar_url":"https://avatars.githubusercontent.com/u/583379?v=3","gravatar_id":"","url":"https://api.github.com/users/adrn","html_url":"https://github.com/adrn","followers_url":"https://api.github.com/users/adrn/followers","following_url":"https://api.github.com/users/adrn/following{/other_user}","gists_url":"https://api.github.com/users/adrn/gists{/gist_id}","starred_url":"https://api.github.com/users/adrn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrn/subscriptions","organizations_url":"https://api.github.com/users/adrn/orgs","repos_url":"https://api.github.com/users/adrn/repos","events_url":"https://api.github.com/users/adrn/events{/privacy}","received_events_url":"https://api.github.com/users/adrn/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":1,"state":"open","created_at":"2016-05-11T19:53:19Z","updated_at":"2016-07-17T18:26:35Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2016-04-08T02:42:13Z","updated_at":"2016-07-18T02:03:36Z","closed_at":null,"body":"Should internally promote to a `(3,n)` array"},"comment":{"url":"https://api.github.com/repos/adrn/gala/issues/comments/233217763","html_url":"https://github.com/adrn/gala/issues/39#issuecomment-233217763","issue_url":"https://api.github.com/repos/adrn/gala/issues/39","id":233217763,"user":{"login":"adrn","id":583379,"avatar_url":"https://avatars.githubusercontent.com/u/583379?v=3","gravatar_id":"","url":"https://api.github.com/users/adrn","html_url":"https://github.com/adrn","followers_url":"https://api.github.com/users/adrn/followers","following_url":"https://api.github.com/users/adrn/following{/other_user}","gists_url":"https://api.github.com/users/adrn/gists{/gist_id}","starred_url":"https://api.github.com/users/adrn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/adrn/subscriptions","organizations_url":"https://api.github.com/users/adrn/orgs","repos_url":"https://api.github.com/users/adrn/repos","events_url":"https://api.github.com/users/adrn/events{/privacy}","received_events_url":"https://api.github.com/users/adrn/received_events","type":"User","site_admin":false},"created_at":"2016-07-18T02:03:36Z","updated_at":"2016-07-18T02:03:36Z","body":"Brainstorming API.\r\n\r\nUser-facing (spherical):\r\n```python\r\npot = HernquistPotential(...) # knows internally that it has spherical symmetry\r\n\r\nr = np.logspace(-1, 1, 128)\r\nxyz = np.zeros((3,r.size))\r\nxyz[0] = r\r\n\r\n# as positional argument, requires cartesian:\r\npot.value(xyz) \r\n\r\n# as kwarg, takes just a radius\r\npot.value(r=r)\r\n```\r\n\r\nUser-facing (cylindrical):\r\n```python\r\nR = np.linspace(4, 12, 128)\r\nz = np.random.normal(0, 0.1, size=R.size)\r\nxyz = np.zeros((3,R.size))\r\nxyz[0] = R\r\nxyz[2] = z\r\n\r\npot = MiyamotoNagaiPotential(...) # knows internally that it has cylindrical symmetry\r\npot.value(xyz) \r\npot.value(R=R, z=z) \r\n\r\n```\r\n\r\nWhat does the API look like for defining potential classes? Maybe:\r\n\r\n```python\r\nclass SomeNewPotential(PotentialBase):\r\n\r\n    def __init__(self, a, units=None):\r\n        parameters = OrderedDict()\r\n        parameters['a'] = a\r\n        super(SomeNewPotential, self).__init__(units=units,\r\n                                                                         parameters=parameters,\r\n                                                                         symmetry='spherical')\r\n```\r\n\r\nBut really, define symmetry classes that define mappings between partial coordinates and cartesian. So, for example, `SphericalSymmetry` would map `r` to `x` or something:\r\n- Spherical symmetry = no phi, theta dependence\r\n- Cylindrical symmetry = no phi dependence\r\n- "}}
{"actor":{"display_login":"adrn"}}