{"action":"created","issue":{"url":"https://api.github.com/repos/gammapy/gammapy/issues/1131","repository_url":"https://api.github.com/repos/gammapy/gammapy","labels_url":"https://api.github.com/repos/gammapy/gammapy/issues/1131/labels{/name}","comments_url":"https://api.github.com/repos/gammapy/gammapy/issues/1131/comments","events_url":"https://api.github.com/repos/gammapy/gammapy/issues/1131/events","html_url":"https://github.com/gammapy/gammapy/issues/1131","id":257414238,"number":1131,"title":"gammapy-extra package and resource management","user":{"login":"kosack","id":11677812,"avatar_url":"https://avatars2.githubusercontent.com/u/11677812?v=4","gravatar_id":"","url":"https://api.github.com/users/kosack","html_url":"https://github.com/kosack","followers_url":"https://api.github.com/users/kosack/followers","following_url":"https://api.github.com/users/kosack/following{/other_user}","gists_url":"https://api.github.com/users/kosack/gists{/gist_id}","starred_url":"https://api.github.com/users/kosack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kosack/subscriptions","organizations_url":"https://api.github.com/users/kosack/orgs","repos_url":"https://api.github.com/users/kosack/repos","events_url":"https://api.github.com/users/kosack/events{/privacy}","received_events_url":"https://api.github.com/users/kosack/received_events","type":"User","site_admin":false},"labels":[{"id":39740771,"url":"https://api.github.com/repos/gammapy/gammapy/labels/feature","name":"feature","color":"84b6eb","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/gammapy/gammapy/milestones/11","html_url":"https://github.com/gammapy/gammapy/milestone/11","labels_url":"https://api.github.com/repos/gammapy/gammapy/milestones/11/labels","id":2487784,"number":11,"title":"0.8","description":"","creator":{"login":"cdeil","id":852409,"avatar_url":"https://avatars3.githubusercontent.com/u/852409?v=4","gravatar_id":"","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},"open_issues":39,"closed_issues":1,"state":"open","created_at":"2017-04-28T09:17:03Z","updated_at":"2017-09-18T11:24:27Z","due_on":null,"closed_at":null},"comments":1,"created_at":"2017-09-13T15:00:13Z","updated_at":"2017-09-19T13:02:31Z","closed_at":null,"author_association":"NONE","body":"It would be nice to have at least the datasets part of gammapy-extra in its own pip or conda-installable package. If that was the case, it would be possible to get files from it without forcing the user to set `$GAMMAPY_EXTRA` using the `pkg_resources` module.  It could get installed automatically as a dependency of gammapy, or optionally.  Let's say the module inside the gammapy-extra pacakge is called `gammapy_datasets`, you could do the following to load the 3FGL catalog for example:\r\n\r\n```python\r\nimport pkg_resources\r\n\r\nfilename = pkg_resources.resource_filename('gammapy_datasets', 'catalogs/fermi/gll_psc_v16.fit.gz')\r\n```\r\nThis would load the file without the user having to worry about where it is installed. \r\n\r\n\r\nThe implementation would require restructuring gammapy-extras a bit, and making the modules that should be package-able  real python packages (with __init__.py inside), or making it one global package with all inside (in which case it has to be renamed to remove the hyphen)\r\n\r\nSomething like this would work for setup.py:\r\n\r\n```python\r\nsetup(\r\n    name='gammapy-extra',\r\n    packages=find_packages(),   # finds all sub-packages (or just list ['gammapy_datasets',] to get only that one)\r\n    package_data={'gammapy_datasets': '*'},\r\n)\r\n\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/gammapy/gammapy/issues/comments/330531763","html_url":"https://github.com/gammapy/gammapy/issues/1131#issuecomment-330531763","issue_url":"https://api.github.com/repos/gammapy/gammapy/issues/1131","id":330531763,"user":{"login":"kosack","id":11677812,"avatar_url":"https://avatars2.githubusercontent.com/u/11677812?v=4","gravatar_id":"","url":"https://api.github.com/users/kosack","html_url":"https://github.com/kosack","followers_url":"https://api.github.com/users/kosack/followers","following_url":"https://api.github.com/users/kosack/following{/other_user}","gists_url":"https://api.github.com/users/kosack/gists{/gist_id}","starred_url":"https://api.github.com/users/kosack/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kosack/subscriptions","organizations_url":"https://api.github.com/users/kosack/orgs","repos_url":"https://api.github.com/users/kosack/repos","events_url":"https://api.github.com/users/kosack/events{/privacy}","received_events_url":"https://api.github.com/users/kosack/received_events","type":"User","site_admin":false},"created_at":"2017-09-19T13:02:31Z","updated_at":"2017-09-19T13:02:31Z","author_association":"NONE","body":"Yes, it's not an easy thing to do... Having them downloadable with a cache seems best in the end.  \r\n\r\nThis also relates to some things that are apparently hard-coded into gammapy, like the location of the gammacat files (which are inexplicably in a directory called *docs* and not in `$GAMMAPY_EXTRA/datasets`).  Having one way to access required catalog files would be ideal. "}}
{"actor":{"display_login":"kosack"}}