{"action":"created","issue":{"url":"https://api.github.com/repos/astropy/astropy/issues/3866","labels_url":"https://api.github.com/repos/astropy/astropy/issues/3866/labels{/name}","comments_url":"https://api.github.com/repos/astropy/astropy/issues/3866/comments","events_url":"https://api.github.com/repos/astropy/astropy/issues/3866/events","html_url":"https://github.com/astropy/astropy/issues/3866","id":89624723,"number":3866,"title":"Allow np.ufunc to make new compound models","user":{"login":"mhvk","id":2789820,"avatar_url":"https://avatars.githubusercontent.com/u/2789820?v=3","gravatar_id":"","url":"https://api.github.com/users/mhvk","html_url":"https://github.com/mhvk","followers_url":"https://api.github.com/users/mhvk/followers","following_url":"https://api.github.com/users/mhvk/following{/other_user}","gists_url":"https://api.github.com/users/mhvk/gists{/gist_id}","starred_url":"https://api.github.com/users/mhvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhvk/subscriptions","organizations_url":"https://api.github.com/users/mhvk/orgs","repos_url":"https://api.github.com/users/mhvk/repos","events_url":"https://api.github.com/users/mhvk/events{/privacy}","received_events_url":"https://api.github.com/users/mhvk/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/astropy/astropy/labels/Effort-medium","name":"Effort-medium","color":"fef2c0"},{"url":"https://api.github.com/repos/astropy/astropy/labels/Feature%20Request","name":"Feature Request","color":"bfdadc"},{"url":"https://api.github.com/repos/astropy/astropy/labels/modeling","name":"modeling","color":"c7def8"},{"url":"https://api.github.com/repos/astropy/astropy/labels/Package-expert","name":"Package-expert","color":"bfe5bf"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-06-19T18:07:37Z","updated_at":"2015-06-19T18:28:37Z","closed_at":null,"body":"This issue is mostly to remind us/@embray of an idea that mentioned in https://github.com/astropy/astropy/issues/3861#issuecomment-113555981: could one not just support operations like `+` on model classes but also `np.ufunc`? This would seem possible if one defined `__numpy_ufunc__` appropriately, and would mean one would nearly for free get all `ufunc`s covered as models, ie., one could have `np.sin(Const1D+Scale)` construct a new model class.\r\n\r\nPossibly somewhat unrelatedly, by way of similarity, it might then be good to have `F | G` being equivalent to `G(F)` -- obviously, this needs some trickery in `G.__new__`..."},"comment":{"url":"https://api.github.com/repos/astropy/astropy/issues/comments/113598486","html_url":"https://github.com/astropy/astropy/issues/3866#issuecomment-113598486","issue_url":"https://api.github.com/repos/astropy/astropy/issues/3866","id":113598486,"user":{"login":"mhvk","id":2789820,"avatar_url":"https://avatars.githubusercontent.com/u/2789820?v=3","gravatar_id":"","url":"https://api.github.com/users/mhvk","html_url":"https://github.com/mhvk","followers_url":"https://api.github.com/users/mhvk/followers","following_url":"https://api.github.com/users/mhvk/following{/other_user}","gists_url":"https://api.github.com/users/mhvk/gists{/gist_id}","starred_url":"https://api.github.com/users/mhvk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhvk/subscriptions","organizations_url":"https://api.github.com/users/mhvk/orgs","repos_url":"https://api.github.com/users/mhvk/repos","events_url":"https://api.github.com/users/mhvk/events{/privacy}","received_events_url":"https://api.github.com/users/mhvk/received_events","type":"User","site_admin":false},"created_at":"2015-06-19T18:28:37Z","updated_at":"2015-06-19T18:28:37Z","body":"`fit_deriv` would not be hard -- see https://github.com/astropy/astropy/pull/3715/files#diff-2a3560744629608434d0eff93c50cf2aR13\r\nThe main issue, I think, is that there is as far as I know no way to make this work without `__numpy_ufunc__`, i.e., those with numpy <1.10 will have to import the mathematical functions from somewhere."}}