{"action":"created","issue":{"url":"https://api.github.com/repos/SpiNNakerManchester/sPyNNaker/issues/119","labels_url":"https://api.github.com/repos/SpiNNakerManchester/sPyNNaker/issues/119/labels{/name}","comments_url":"https://api.github.com/repos/SpiNNakerManchester/sPyNNaker/issues/119/comments","events_url":"https://api.github.com/repos/SpiNNakerManchester/sPyNNaker/issues/119/events","html_url":"https://github.com/SpiNNakerManchester/sPyNNaker/issues/119","id":98340379,"number":119,"title":"Missing exp function in distance dependent probability connector","user":{"login":"chanokin","id":1545983,"avatar_url":"https://avatars.githubusercontent.com/u/1545983?v=3","gravatar_id":"","url":"https://api.github.com/users/chanokin","html_url":"https://github.com/chanokin","followers_url":"https://api.github.com/users/chanokin/followers","following_url":"https://api.github.com/users/chanokin/following{/other_user}","gists_url":"https://api.github.com/users/chanokin/gists{/gist_id}","starred_url":"https://api.github.com/users/chanokin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chanokin/subscriptions","organizations_url":"https://api.github.com/users/chanokin/orgs","repos_url":"https://api.github.com/users/chanokin/repos","events_url":"https://api.github.com/users/chanokin/events{/privacy}","received_events_url":"https://api.github.com/users/chanokin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-31T08:17:52Z","updated_at":"2015-08-03T17:06:29Z","closed_at":null,"body":"Hi,\r\nI was trying to use the DistanceDependentProbabilityConnector class and it threw an error about a missing exp function when the distance expression is parsed. \r\n\r\nTo fix it I just added:\r\nfrom numpy import exp\r\nto \r\nsPyNNaker/spynnaker/pyNN/models/neural_projections/conectors/distance_dependent_probability_connector.py\r\n\r\nIt feels like there should be a more general solution, but I'm not sure what the best thing to do is.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/SpiNNakerManchester/sPyNNaker/issues/comments/127332935","html_url":"https://github.com/SpiNNakerManchester/sPyNNaker/issues/119#issuecomment-127332935","issue_url":"https://api.github.com/repos/SpiNNakerManchester/sPyNNaker/issues/119","id":127332935,"user":{"login":"apdavison","id":260552,"avatar_url":"https://avatars.githubusercontent.com/u/260552?v=3","gravatar_id":"","url":"https://api.github.com/users/apdavison","html_url":"https://github.com/apdavison","followers_url":"https://api.github.com/users/apdavison/followers","following_url":"https://api.github.com/users/apdavison/following{/other_user}","gists_url":"https://api.github.com/users/apdavison/gists{/gist_id}","starred_url":"https://api.github.com/users/apdavison/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/apdavison/subscriptions","organizations_url":"https://api.github.com/users/apdavison/orgs","repos_url":"https://api.github.com/users/apdavison/repos","events_url":"https://api.github.com/users/apdavison/events{/privacy}","received_events_url":"https://api.github.com/users/apdavison/received_events","type":"User","site_admin":false},"created_at":"2015-08-03T17:06:29Z","updated_at":"2015-08-03T17:06:29Z","body":"It's not so bad. This is not documented, but the distance expression can only contain certain functions and constants from NumPy (plus builtin Python functions like `abs()`, of course).\r\n\r\nThe following import statement should cover it:\r\n```\r\nfrom numpy import arccos, arcsin, arctan, arctan2, ceil, cos, cosh, exp, fabs, \\\r\n    floor, fmod, hypot, ldexp, log, log10, modf, power, sin, sinh, sqrt, tan, tanh, \\\r\n    maximum, minimum, e, pi\r\n```\r\n"}}