{"action":"closed","issue":{"url":"https://api.github.com/repos/stan-dev/pystan/issues/249","repository_url":"https://api.github.com/repos/stan-dev/pystan","labels_url":"https://api.github.com/repos/stan-dev/pystan/issues/249/labels{/name}","comments_url":"https://api.github.com/repos/stan-dev/pystan/issues/249/comments","events_url":"https://api.github.com/repos/stan-dev/pystan/issues/249/events","html_url":"https://github.com/stan-dev/pystan/issues/249","id":170491708,"number":249,"title":"Error printing infinity in model fit summary","user":{"login":"danielrosenbloom","id":11393274,"avatar_url":"https://avatars.githubusercontent.com/u/11393274?v=3","gravatar_id":"","url":"https://api.github.com/users/danielrosenbloom","html_url":"https://github.com/danielrosenbloom","followers_url":"https://api.github.com/users/danielrosenbloom/followers","following_url":"https://api.github.com/users/danielrosenbloom/following{/other_user}","gists_url":"https://api.github.com/users/danielrosenbloom/gists{/gist_id}","starred_url":"https://api.github.com/users/danielrosenbloom/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielrosenbloom/subscriptions","organizations_url":"https://api.github.com/users/danielrosenbloom/orgs","repos_url":"https://api.github.com/users/danielrosenbloom/repos","events_url":"https://api.github.com/users/danielrosenbloom/events{/privacy}","received_events_url":"https://api.github.com/users/danielrosenbloom/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/stan-dev/pystan/milestones/8","html_url":"https://github.com/stan-dev/pystan/milestone/8","labels_url":"https://api.github.com/repos/stan-dev/pystan/milestones/8/labels","id":2087527,"number":8,"title":"2.14.0.0","description":"","creator":{"login":"ariddell","id":19950,"avatar_url":"https://avatars.githubusercontent.com/u/19950?v=3","gravatar_id":"","url":"https://api.github.com/users/ariddell","html_url":"https://github.com/ariddell","followers_url":"https://api.github.com/users/ariddell/followers","following_url":"https://api.github.com/users/ariddell/following{/other_user}","gists_url":"https://api.github.com/users/ariddell/gists{/gist_id}","starred_url":"https://api.github.com/users/ariddell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ariddell/subscriptions","organizations_url":"https://api.github.com/users/ariddell/orgs","repos_url":"https://api.github.com/users/ariddell/repos","events_url":"https://api.github.com/users/ariddell/events{/privacy}","received_events_url":"https://api.github.com/users/ariddell/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":5,"state":"open","created_at":"2016-10-23T19:46:30Z","updated_at":"2017-01-01T01:18:54Z","due_on":"2016-12-31T08:00:00Z","closed_at":null},"comments":2,"created_at":"2016-08-10T18:55:41Z","updated_at":"2017-01-01T01:18:54Z","closed_at":"2017-01-01T01:18:54Z","body":"#### Summary:\n\nIf a statistic to be printed in the summary is infinite or NaN, an error is thrown.\n#### Description:\n\nAfter I successfully run `fit = model.sampling(...)`, I try to do a `print fit` to get the summary. Instead of printing the summary, I get the error:\n\n```\nFile \"/Users/dsr2131/VIRTUALENVS/211/lib/python2.7/site-packages/pystan/misc.py\", line 83, in _print_stanfit\n    s['summary_colnames'], digits_summary)\n  File \"/Users/dsr2131/VIRTUALENVS/211/lib/python2.7/site-packages/pystan/misc.py\", line 112, in _array_to_table\n    line += '{num:>{width}}'.format(num=_format_number(num, n_digits, max_col_width - 1), width=width)\n  File \"/Users/dsr2131/VIRTUALENVS/211/lib/python2.7/site-packages/pystan/misc.py\", line 151, in _format_number\n    return str(int(round(num)))\nOverflowError: cannot convert float infinity to integer\n```\n\nThis usually pops up in a model where the Rhat is undefined for a parameter; I can easily fix it by replacing line 151 in misc.py (`return str(int(round(num)))`) with:\n\n`try:\n    return str(int(round(num)))\nexcept OverflowError:\n    return str(round(num))`\n#### PyStan Version:\n\nError in both 2.9 and 2.11\n#### Python Version:\n\n2.7\n#### Operating System:\n\nOSX 10.10\n"}}
{"actor":{"display_login":"ariddell"}}