{"action":"created","issue":{"url":"https://api.github.com/repos/sherpa/sherpa/issues/275","repository_url":"https://api.github.com/repos/sherpa/sherpa","labels_url":"https://api.github.com/repos/sherpa/sherpa/issues/275/labels{/name}","comments_url":"https://api.github.com/repos/sherpa/sherpa/issues/275/comments","events_url":"https://api.github.com/repos/sherpa/sherpa/issues/275/events","html_url":"https://github.com/sherpa/sherpa/issues/275","id":178107057,"number":275,"title":"issue with data representation on python 3","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/area:code","name":"area:code","color":"d4c5f9"},{"url":"https://api.github.com/repos/sherpa/sherpa/labels/dep:python3","name":"dep:python3","color":"fef2c0"},{"url":"https://api.github.com/repos/sherpa/sherpa/labels/type:bug","name":"type:bug","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/sherpa/sherpa/milestones/4","html_url":"https://github.com/sherpa/sherpa/milestones/CIAO%204.9","labels_url":"https://api.github.com/repos/sherpa/sherpa/milestones/4/labels","id":1993568,"number":4,"title":"CIAO 4.9","description":"","creator":{"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},"open_issues":8,"closed_issues":1,"state":"open","created_at":"2016-09-09T14:10:22Z","updated_at":"2016-10-03T14:46:03Z","due_on":"2016-10-31T00:00:00Z","closed_at":null},"comments":2,"created_at":"2016-09-20T16:17:16Z","updated_at":"2016-10-03T15:46:19Z","closed_at":null,"body":"Printing a dataset results in an exception on Python 3.\r\n``` python\r\nfrom sherpa.astro.ui import *\r\nload_arrays(1, [1, 2, 3], [1, 2, 3], DataPHA)\r\nprint(get_data())\r\n```\r\nSince the exception is raised in the `BaseData` class this is likely to be applicable to other data types, not only `DataPHA`.\r\n\r\n```\r\n---------------------------------------------------------------------------\r\nTypeError                                 Traceback (most recent call last)\r\n<ipython-input-4-f8304f59701f> in <module>()\r\n----> 1 print(get_data())\r\n\r\n/home/vagrant/miniconda2/envs/sherpa3/lib/python3.5/site-packages/sherpa/astro/data.py in __str__(self)\r\n    403         try:\r\n    404             self._fields = filter((lambda x: x != 'header'), self._fields)\r\n--> 405             ss = BaseData.__str__(self)\r\n    406         finally:\r\n    407             self._fields = old\r\n\r\n/home/vagrant/miniconda2/envs/sherpa3/lib/python3.5/site-packages/sherpa/data.py in __str__(self)\r\n    109         \"\"\"\r\n    110 \r\n--> 111         fields = self._fields + getattr(self, '_extra_fields', ())\r\n    112         fdict = dict(izip(fields, [getattr(self, f) for f in fields]))\r\n    113         return print_fields(fields, fdict)\r\n\r\nTypeError: unsupported operand type(s) for +: 'filter' and 'tuple'\r\n```\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/sherpa/sherpa/issues/comments/251142915","html_url":"https://github.com/sherpa/sherpa/issues/275#issuecomment-251142915","issue_url":"https://api.github.com/repos/sherpa/sherpa/issues/275","id":251142915,"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":"2016-10-03T15:46:19Z","updated_at":"2016-10-03T15:46:19Z","body":"It looks like the affected data classes were `DataPHA`, `DataARF`, `DataRMF`, and `DataIMG`.\r\n\r\nI am issuing a PR that tests for the representations of these classes. It would be nice to add a bunch of unit tests, but each dataset needs to be created with a specific constructor, so it takes too long."}}
{"actor":{"display_login":"olaurino"}}