{"action":"created","issue":{"url":"https://api.github.com/repos/astropy/astropy/issues/7636","repository_url":"https://api.github.com/repos/astropy/astropy","labels_url":"https://api.github.com/repos/astropy/astropy/issues/7636/labels{/name}","comments_url":"https://api.github.com/repos/astropy/astropy/issues/7636/comments","events_url":"https://api.github.com/repos/astropy/astropy/issues/7636/events","html_url":"https://github.com/astropy/astropy/pull/7636","id":339950339,"node_id":"MDExOlB1bGxSZXF1ZXN0MjAwNDc5NjEz","number":7636,"title":"Modularize Quantity helpers, ensuring scipy.special and erfa are loaded on demand","user":{"login":"mhvk","id":2789820,"node_id":"MDQ6VXNlcjI3ODk4MjA=","avatar_url":"https://avatars0.githubusercontent.com/u/2789820?v=4","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":[{"id":133220484,"node_id":"MDU6TGFiZWwxMzMyMjA0ODQ=","url":"https://api.github.com/repos/astropy/astropy/labels/Performance","name":"Performance","color":"bfe5bf","default":false},{"id":316473427,"node_id":"MDU6TGFiZWwzMTY0NzM0Mjc=","url":"https://api.github.com/repos/astropy/astropy/labels/Refactoring","name":"Refactoring","color":"fef2c0","default":false},{"id":12456977,"node_id":"MDU6TGFiZWwxMjQ1Njk3Nw==","url":"https://api.github.com/repos/astropy/astropy/labels/units","name":"units","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/astropy/astropy/milestones/52","html_url":"https://github.com/astropy/astropy/milestone/52","labels_url":"https://api.github.com/repos/astropy/astropy/milestones/52/labels","id":2929745,"node_id":"MDk6TWlsZXN0b25lMjkyOTc0NQ==","number":52,"title":"v3.1","description":"","creator":{"login":"eteq","id":346587,"node_id":"MDQ6VXNlcjM0NjU4Nw==","avatar_url":"https://avatars1.githubusercontent.com/u/346587?v=4","gravatar_id":"","url":"https://api.github.com/users/eteq","html_url":"https://github.com/eteq","followers_url":"https://api.github.com/users/eteq/followers","following_url":"https://api.github.com/users/eteq/following{/other_user}","gists_url":"https://api.github.com/users/eteq/gists{/gist_id}","starred_url":"https://api.github.com/users/eteq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eteq/subscriptions","organizations_url":"https://api.github.com/users/eteq/orgs","repos_url":"https://api.github.com/users/eteq/repos","events_url":"https://api.github.com/users/eteq/events{/privacy}","received_events_url":"https://api.github.com/users/eteq/received_events","type":"User","site_admin":false},"open_issues":83,"closed_issues":99,"state":"open","created_at":"2017-11-21T23:24:18Z","updated_at":"2018-08-13T18:15:11Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2018-07-10T18:04:53Z","updated_at":"2018-08-14T12:09:45Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/astropy/astropy/pulls/7636","html_url":"https://github.com/astropy/astropy/pull/7636","diff_url":"https://github.com/astropy/astropy/pull/7636.diff","patch_url":"https://github.com/astropy/astropy/pull/7636.patch"},"body":"This PR has two purposes. The main one is to ensure that `scipy.special` is only loaded on demand, so that for a typical situation in which `astropy` is used but `scipy.special` is not, the latter does not get imported unless one of its functions are actually applied to a `Quantity`. This helps reduce the import time of `astropy.units` quite a bit (see below). The second purpose is to split up the very large `quantity_helpers` file into more manageable pieces, by making it a module.\r\n\r\nNote that as part of this, it is becoming possible to \"register\" sets of ufuncs with the `units` module without actual loading - ~I hope to use this~ this is already used here for `erfa`, but it could be exposed as well. I've not written any documentation for that yet, as I first want to be sure people agree the structure makes sense (also, it sets the format for the helper functions in stone, which I'm not sure I like).\r\n\r\nExcerpts from `python -X importtime -c 'import astropy.units`:\r\n```\r\n# With current master\r\nimport time: self [us] | cumulative | imported package\r\nimport time:       787 |      60205 |       scipy.special\r\nimport time:       419 |      69729 |     astropy.units.quantity_helper\r\nimport time:      4641 |      76212 |   astropy.units.quantity\r\nimport time:     20671 |     521538 | astropy.units\r\n# With this PR\r\nimport time:       216 |        216 |       astropy.units.quantity_helper.converters\r\nimport time:       310 |        310 |       astropy.units.quantity_helper.helpers\r\nimport time:       183 |        183 |       astropy.units.quantity_helper.scipy_special\r\nimport time:       225 |        932 |     astropy.units.quantity_helper\r\nimport time:      5404 |       8088 |   astropy.units.quantity\r\nimport time:     19827 |     432185 | astropy.units\r\n```"},"comment":{"url":"https://api.github.com/repos/astropy/astropy/issues/comments/412850338","html_url":"https://github.com/astropy/astropy/pull/7636#issuecomment-412850338","issue_url":"https://api.github.com/repos/astropy/astropy/issues/7636","id":412850338,"node_id":"MDEyOklzc3VlQ29tbWVudDQxMjg1MDMzOA==","user":{"login":"mhvk","id":2789820,"node_id":"MDQ6VXNlcjI3ODk4MjA=","avatar_url":"https://avatars0.githubusercontent.com/u/2789820?v=4","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":"2018-08-14T12:09:45Z","updated_at":"2018-08-14T12:09:45Z","author_association":"CONTRIBUTOR","body":"Rebased since erfa had become supported - that is now modularized as well, for those who use units but not coordinates."}}
{"actor":{"display_login":"mhvk"}}