{"action":"created","issue":{"url":"https://api.github.com/repos/ezag/pyeuclid/issues/10","labels_url":"https://api.github.com/repos/ezag/pyeuclid/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/ezag/pyeuclid/issues/10/comments","events_url":"https://api.github.com/repos/ezag/pyeuclid/issues/10/events","html_url":"https://github.com/ezag/pyeuclid/pull/10","id":70950348,"number":10,"title":"Minor fix to improve compatibility when using numarray value types","user":{"login":"robclewley","id":4868709,"avatar_url":"https://avatars.githubusercontent.com/u/4868709?v=3","gravatar_id":"","url":"https://api.github.com/users/robclewley","html_url":"https://github.com/robclewley","followers_url":"https://api.github.com/users/robclewley/followers","following_url":"https://api.github.com/users/robclewley/following{/other_user}","gists_url":"https://api.github.com/users/robclewley/gists{/gist_id}","starred_url":"https://api.github.com/users/robclewley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robclewley/subscriptions","organizations_url":"https://api.github.com/users/robclewley/orgs","repos_url":"https://api.github.com/users/robclewley/repos","events_url":"https://api.github.com/users/robclewley/events{/privacy}","received_events_url":"https://api.github.com/users/robclewley/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-25T18:29:50Z","updated_at":"2015-04-25T19:22:40Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ezag/pyeuclid/pulls/10","html_url":"https://github.com/ezag/pyeuclid/pull/10","diff_url":"https://github.com/ezag/pyeuclid/pull/10.diff","patch_url":"https://github.com/ezag/pyeuclid/pull/10.patch"},"body":""},"comment":{"url":"https://api.github.com/repos/ezag/pyeuclid/issues/comments/96266427","html_url":"https://github.com/ezag/pyeuclid/pull/10#issuecomment-96266427","issue_url":"https://api.github.com/repos/ezag/pyeuclid/issues/10","id":96266427,"user":{"login":"robclewley","id":4868709,"avatar_url":"https://avatars.githubusercontent.com/u/4868709?v=3","gravatar_id":"","url":"https://api.github.com/users/robclewley","html_url":"https://github.com/robclewley","followers_url":"https://api.github.com/users/robclewley/followers","following_url":"https://api.github.com/users/robclewley/following{/other_user}","gists_url":"https://api.github.com/users/robclewley/gists{/gist_id}","starred_url":"https://api.github.com/users/robclewley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/robclewley/subscriptions","organizations_url":"https://api.github.com/users/robclewley/orgs","repos_url":"https://api.github.com/users/robclewley/repos","events_url":"https://api.github.com/users/robclewley/events{/privacy}","received_events_url":"https://api.github.com/users/robclewley/received_events","type":"User","site_admin":false},"created_at":"2015-04-25T19:22:40Z","updated_at":"2015-04-25T19:22:40Z","body":"I'm not an expert with this, but I don't think it's numpy's problem. Here's how to reproduce it:\r\n\r\n```\r\n----> 1 LineSegment2(Point2(*np.array([0,1.03])), Point2(*np.array([3.1, 2])))\r\n\r\n/sw/lib/python2.7/site-packages/euclid.py in __init__(self, *args)\r\n   1836             raise AttributeError('%r' % (args,))\r\n   1837\r\n-> 1838         if not self.v:\r\n   1839             raise AttributeError('Line has zero-length vector')\r\n   1840\r\n\r\nTypeError: __nonzero__ should return bool or int, returned numpy.bool_\r\n```\r\n\r\nWeirdly, I get the same TypeError with `LineSegment2(Point2(np.array([0,1.03])), Point2(np.array([3.1, 2])))` even though, by itself, `Point2(np.array([0,1.03]))` raises\r\n\r\n```\r\n/sw/lib/python2.7/site-packages/euclid.py in __repr__(self)\r\n   1784 class Point2(Vector2, Geometry):\r\n   1785     def __repr__(self):\r\n-> 1786         return 'Point2(%.2f, %.2f)' % (self.x, self.y)\r\n   1787\r\n   1788     def intersect(self, other):\r\n\r\nTypeError: float argument required, not numpy.ndarray\r\n```\r\n\r\nIn any case, it also occurs with `LineSegment2(Point2(np.array([0]), np.array([1.03])), Point2(np.array([3.1]), np.array([0.1])))`\r\n\r\nI think it's reasonable that this should work given that numpy singleton arrays may be generated in a calculation elsewhere and passed to a function that creates euclid Line2 objects."}}