{"action":"opened","issue":{"url":"https://api.github.com/repos/numba/numba/issues/2027","repository_url":"https://api.github.com/repos/numba/numba","labels_url":"https://api.github.com/repos/numba/numba/issues/2027/labels{/name}","comments_url":"https://api.github.com/repos/numba/numba/issues/2027/comments","events_url":"https://api.github.com/repos/numba/numba/issues/2027/events","html_url":"https://github.com/numba/numba/issues/2027","id":170645648,"number":2027,"title":"`RuntimeWarning` when calling vectorized function from interpreter","user":{"login":"ma-ba","id":10598343,"avatar_url":"https://avatars.githubusercontent.com/u/10598343?v=3","gravatar_id":"","url":"https://api.github.com/users/ma-ba","html_url":"https://github.com/ma-ba","followers_url":"https://api.github.com/users/ma-ba/followers","following_url":"https://api.github.com/users/ma-ba/following{/other_user}","gists_url":"https://api.github.com/users/ma-ba/gists{/gist_id}","starred_url":"https://api.github.com/users/ma-ba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ma-ba/subscriptions","organizations_url":"https://api.github.com/users/ma-ba/orgs","repos_url":"https://api.github.com/users/ma-ba/repos","events_url":"https://api.github.com/users/ma-ba/events{/privacy}","received_events_url":"https://api.github.com/users/ma-ba/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-11T13:28:16Z","updated_at":"2016-08-11T13:28:16Z","closed_at":null,"body":"Calling a vectorized function which has fixed `float64` parameters in its `vectorize`-signature from Python code gives an unexpected `RuntimeWarning` for a zero division that should actually never be executed. See:\r\n```python\r\nfrom numba import vectorize, njit, int64, float64\r\ndiv = lambda a, b: a / b if b != 0 else -1\r\n\r\nv1 = vectorize()(div)\r\nv2 = vectorize()(div)\r\nvi = vectorize([float64(int64, int64)])(div)\r\nvf = vectorize([float64(float64, float64)])(div)\r\n\r\nprint(\"v1 output:   \", v1(1, 0))\r\nprint(\"v2 output:   \", v2(1, 0))\r\nprint(\"vi output:   \", vi(1, 0))\r\nprint(\"vf output:   \", vf(1, 0))\r\nprint(\"v1 overloads:\", *v1._dispatcher.overloads)\r\nprint(\"v2 overloads:\", *v2._dispatcher.overloads)\r\nprint(\"vi overloads:\", *vi._dispatcher.overloads)\r\nprint(\"vf overloads:\", *vf._dispatcher.overloads)\r\n\r\njv1 = vectorize()(div)\r\njv2 = vectorize()(div)\r\njvi = vectorize([float64(int64, int64)])(div)\r\njvf = vectorize([float64(float64, float64)])(div)\r\n\r\nprint(\"jv1 output:   \", njit()(lambda: jv1(1, 0))())\r\nprint(\"jv2 output:   \", njit()(lambda: jv2(1, 0))())\r\nprint(\"jvi output:   \", njit()(lambda: jvi(1, 0))())\r\nprint(\"jvf output:   \", njit()(lambda: jvf(1, 0))())\r\nprint(\"jv1 overloads:\", *jv1._dispatcher.overloads)\r\nprint(\"jv2 overloads:\", *jv2._dispatcher.overloads)\r\nprint(\"jvi overloads:\", *jvi._dispatcher.overloads)\r\nprint(\"jvf overloads:\", *jvf._dispatcher.overloads)\r\n```\r\noutputs:\r\n```\r\nv1 output:    -1.0\r\nv2 output:    -1.0\r\nvi output:    -1.0\r\nvectorized_div.py:12: RuntimeWarning: divide by zero encountered in <lambda>\r\n  print(\"vf output:   \", vf(1, 0))\r\nvf output:    -1.0\r\nv1 overloads: (int64, int64) -> float64\r\nv2 overloads: (int64, int64) -> float64\r\nvi overloads: (int64, int64) -> float64\r\nvf overloads: (float64, float64) -> float64\r\njv1 output:    -1.0\r\njv2 output:    -1.0\r\njvi output:    -1.0\r\njvf output:    -1.0\r\njv1 overloads: (int64, int64) -> float64\r\njv2 overloads: (int64, int64) -> float64\r\njvi overloads: (int64, int64) -> float64\r\njvf overloads: (float64, float64) -> float64\r\n```"}}
{"actor":{"display_login":"ma-ba"}}