{"action":"created","issue":{"url":"https://api.github.com/repos/sherpa/sherpa/issues/22","labels_url":"https://api.github.com/repos/sherpa/sherpa/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/sherpa/sherpa/issues/22/comments","events_url":"https://api.github.com/repos/sherpa/sherpa/issues/22/events","html_url":"https://github.com/sherpa/sherpa/issues/22","id":78640511,"number":22,"title":"datastack module and optional requirements","user":{"login":"olaurino","id":5692321,"avatar_url":"https://avatars.githubusercontent.com/u/5692321?v=3","gravatar_id":"","url":"https://api.github.com/users/olaurino","html_url":"https://github.com/olaurino","followers_url":"https://api.github.com/users/olaurino/followers","following_url":"https://api.github.com/users/olaurino/following{/other_user}","gists_url":"https://api.github.com/users/olaurino/gists{/gist_id}","starred_url":"https://api.github.com/users/olaurino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olaurino/subscriptions","organizations_url":"https://api.github.com/users/olaurino/orgs","repos_url":"https://api.github.com/users/olaurino/repos","events_url":"https://api.github.com/users/olaurino/events{/privacy}","received_events_url":"https://api.github.com/users/olaurino/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/sherpa/sherpa/labels/1%20-%20Backlog","name":"1 - Backlog","color":"ededed"},{"url":"https://api.github.com/repos/sherpa/sherpa/labels/area:code","name":"area:code","color":"d4c5f9"},{"url":"https://api.github.com/repos/sherpa/sherpa/labels/note:can-workaround","name":"note:can-workaround","color":"bfd4f2"},{"url":"https://api.github.com/repos/sherpa/sherpa/labels/priority:medium","name":"priority:medium","color":"fef2c0"},{"url":"https://api.github.com/repos/sherpa/sherpa/labels/type:bug","name":"type:bug","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"DougBurke","id":224638,"avatar_url":"https://avatars.githubusercontent.com/u/224638?v=3","gravatar_id":"","url":"https://api.github.com/users/DougBurke","html_url":"https://github.com/DougBurke","followers_url":"https://api.github.com/users/DougBurke/followers","following_url":"https://api.github.com/users/DougBurke/following{/other_user}","gists_url":"https://api.github.com/users/DougBurke/gists{/gist_id}","starred_url":"https://api.github.com/users/DougBurke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DougBurke/subscriptions","organizations_url":"https://api.github.com/users/DougBurke/orgs","repos_url":"https://api.github.com/users/DougBurke/repos","events_url":"https://api.github.com/users/DougBurke/events{/privacy}","received_events_url":"https://api.github.com/users/DougBurke/received_events","type":"User","site_admin":false},"milestone":null,"comments":5,"created_at":"2015-05-20T18:37:05Z","updated_at":"2015-07-27T14:31:37Z","closed_at":null,"body":"As mentioned in the [4.7 release notes](https://github.com/sherpa/sherpa/releases/tag/4.7), the new `datastack` module fails to load when `matplotlib` is not installed.\r\n\r\nThis is a side effect of the decision to have the IO and plotting backends as soft dependencies, while in CIAO there is always a back-end installed.\r\n\r\nMoreover, if `matplotlib` is installed, but `pyfits` is not, the `datastack` module will indeed be loaded, but the tests will fail because `pyfits` is not available.\r\n\r\nThe `datastack` should check for the presence of the backends and act accordingly.\r\n\r\nInstalling `matplotlib` and `pyfits` works around the issue."},"comment":{"url":"https://api.github.com/repos/sherpa/sherpa/issues/comments/125226165","html_url":"https://github.com/sherpa/sherpa/issues/22#issuecomment-125226165","issue_url":"https://api.github.com/repos/sherpa/sherpa/issues/22","id":125226165,"user":{"login":"olaurino","id":5692321,"avatar_url":"https://avatars.githubusercontent.com/u/5692321?v=3","gravatar_id":"","url":"https://api.github.com/users/olaurino","html_url":"https://github.com/olaurino","followers_url":"https://api.github.com/users/olaurino/followers","following_url":"https://api.github.com/users/olaurino/following{/other_user}","gists_url":"https://api.github.com/users/olaurino/gists{/gist_id}","starred_url":"https://api.github.com/users/olaurino/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/olaurino/subscriptions","organizations_url":"https://api.github.com/users/olaurino/orgs","repos_url":"https://api.github.com/users/olaurino/repos","events_url":"https://api.github.com/users/olaurino/events{/privacy}","received_events_url":"https://api.github.com/users/olaurino/received_events","type":"User","site_admin":false},"created_at":"2015-07-27T14:31:37Z","updated_at":"2015-07-27T14:31:37Z","body":"Indeed. Eventually it would be good if the backend was returned by some kind of factory, but that's something we need to improve in the main sherpa code as well.\r\n\r\nAs for testing, I hope I can commit an example unit test. The unit tests should exercise the expected behavior of the datastack code by mocking the backends and just ensuring that the right backend calls are properly made. The integration of the actual backend is more complex, and depends on the backend. Since the addition of the datastack code is recent and it is a reasonably isolated module, I would try and use it as an example of how we should do proper testing and use this example in other parts of the codebase."}}