{"action":"created","issue":{"url":"https://api.github.com/repos/glottobank/python-newick/issues/23","repository_url":"https://api.github.com/repos/glottobank/python-newick","labels_url":"https://api.github.com/repos/glottobank/python-newick/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/glottobank/python-newick/issues/23/comments","events_url":"https://api.github.com/repos/glottobank/python-newick/issues/23/events","html_url":"https://github.com/glottobank/python-newick/issues/23","id":152744526,"number":23,"title":"Stacked singleton root leads to infinite loop for `remove_redundant_nodes`","user":{"login":"Anaphory","id":1579723,"avatar_url":"https://avatars.githubusercontent.com/u/1579723?v=3","gravatar_id":"","url":"https://api.github.com/users/Anaphory","html_url":"https://github.com/Anaphory","followers_url":"https://api.github.com/users/Anaphory/followers","following_url":"https://api.github.com/users/Anaphory/following{/other_user}","gists_url":"https://api.github.com/users/Anaphory/gists{/gist_id}","starred_url":"https://api.github.com/users/Anaphory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Anaphory/subscriptions","organizations_url":"https://api.github.com/users/Anaphory/orgs","repos_url":"https://api.github.com/users/Anaphory/repos","events_url":"https://api.github.com/users/Anaphory/events{/privacy}","received_events_url":"https://api.github.com/users/Anaphory/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":8,"created_at":"2016-05-03T10:37:03Z","updated_at":"2016-05-03T11:08:26Z","closed_at":"2016-05-03T11:02:51Z","body":"For `R = newick.loads(\"((A,B):1):2\")[0]`, `R.remove_redundant_nodes()` terminates and creates `(A,B):3.0` as it should.\r\n\r\nFor two stacked singletons at the root, as in `R = newick.loads(\"(((A,B):1):2)\")[0]`, `R.remove_redundant_nodes()` runs an infinite loop of ever-increasing root length."},"comment":{"url":"https://api.github.com/repos/glottobank/python-newick/issues/comments/216497250","html_url":"https://github.com/glottobank/python-newick/issues/23#issuecomment-216497250","issue_url":"https://api.github.com/repos/glottobank/python-newick/issues/23","id":216497250,"user":{"login":"Anaphory","id":1579723,"avatar_url":"https://avatars.githubusercontent.com/u/1579723?v=3","gravatar_id":"","url":"https://api.github.com/users/Anaphory","html_url":"https://github.com/Anaphory","followers_url":"https://api.github.com/users/Anaphory/followers","following_url":"https://api.github.com/users/Anaphory/following{/other_user}","gists_url":"https://api.github.com/users/Anaphory/gists{/gist_id}","starred_url":"https://api.github.com/users/Anaphory/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Anaphory/subscriptions","organizations_url":"https://api.github.com/users/Anaphory/orgs","repos_url":"https://api.github.com/users/Anaphory/repos","events_url":"https://api.github.com/users/Anaphory/events{/privacy}","received_events_url":"https://api.github.com/users/Anaphory/received_events","type":"User","site_admin":false},"created_at":"2016-05-03T11:08:26Z","updated_at":"2016-05-03T11:08:26Z","body":"I'd have suggested adding a new test for it (then reporting is clearer on which case fails), and make sure that the test tree has large positive lengths and `fpectl` does not allow floating points to overflow to `inf`, such that in case of a regression the infinite loop produces a `FloatingPointError` and we know that something is wrong."}}