{"action":"created","issue":{"url":"https://api.github.com/repos/chris-belcher/joinmarket/issues/186","labels_url":"https://api.github.com/repos/chris-belcher/joinmarket/issues/186/labels{/name}","comments_url":"https://api.github.com/repos/chris-belcher/joinmarket/issues/186/comments","events_url":"https://api.github.com/repos/chris-belcher/joinmarket/issues/186/events","html_url":"https://github.com/chris-belcher/joinmarket/pull/186","id":100167025,"number":186,"title":"numpy removal","user":{"login":"AdamISZ","id":4278257,"avatar_url":"https://avatars.githubusercontent.com/u/4278257?v=3","gravatar_id":"","url":"https://api.github.com/users/AdamISZ","html_url":"https://github.com/AdamISZ","followers_url":"https://api.github.com/users/AdamISZ/followers","following_url":"https://api.github.com/users/AdamISZ/following{/other_user}","gists_url":"https://api.github.com/users/AdamISZ/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamISZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamISZ/subscriptions","organizations_url":"https://api.github.com/users/AdamISZ/orgs","repos_url":"https://api.github.com/users/AdamISZ/repos","events_url":"https://api.github.com/users/AdamISZ/events{/privacy}","received_events_url":"https://api.github.com/users/AdamISZ/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-08-10T20:57:09Z","updated_at":"2015-08-10T20:58:01Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/chris-belcher/joinmarket/pulls/186","html_url":"https://github.com/chris-belcher/joinmarket/pull/186","diff_url":"https://github.com/chris-belcher/joinmarket/pull/186.diff","patch_url":"https://github.com/chris-belcher/joinmarket/pull/186.patch"},"body":"Removed usage of numpy module.\r\n\r\nThere are a set of of rand_* functions in common which replace the necessary functions. The only slightly complex ones are: first, power law distribution, achieved using the inverse of the cdf, see the wolfram link for the idea. I checked this by looking at sample arrays to see that the number of entries in different bins was approximately the same as that produced by the numpy version. Second, the random-choice-weighted-by-probabilities function, which is done by setting boundaries according to the cumulative array of probabilities and then choosing using a random sampled from a uniform dist. There are floating point inaccuracies here, but as noted in comments that's expected and considered unimportant. If later it's felt to be necessary to remove that, it can be done.\r\n\r\nTesting: I'm going to produce a separate PR for the tumbler tests, which are now working, at least up to 6 yield generators against one tumbler. I've run this test many times and am not finding errors with this commit, but there's an important caveat: I had to make the change on line 151 of tumbler.py to refer to total_amount instead of amount, as otherwise I was occasionally getting negative change amounts.\r\n\r\nIn order to run those tests I had to make some small but fiddly configuration changes, but I'll explain that in the separate testing PR."},"comment":{"url":"https://api.github.com/repos/chris-belcher/joinmarket/issues/comments/129604250","html_url":"https://github.com/chris-belcher/joinmarket/pull/186#issuecomment-129604250","issue_url":"https://api.github.com/repos/chris-belcher/joinmarket/issues/186","id":129604250,"user":{"login":"AdamISZ","id":4278257,"avatar_url":"https://avatars.githubusercontent.com/u/4278257?v=3","gravatar_id":"","url":"https://api.github.com/users/AdamISZ","html_url":"https://github.com/AdamISZ","followers_url":"https://api.github.com/users/AdamISZ/followers","following_url":"https://api.github.com/users/AdamISZ/following{/other_user}","gists_url":"https://api.github.com/users/AdamISZ/gists{/gist_id}","starred_url":"https://api.github.com/users/AdamISZ/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AdamISZ/subscriptions","organizations_url":"https://api.github.com/users/AdamISZ/orgs","repos_url":"https://api.github.com/users/AdamISZ/repos","events_url":"https://api.github.com/users/AdamISZ/events{/privacy}","received_events_url":"https://api.github.com/users/AdamISZ/received_events","type":"User","site_admin":false},"created_at":"2015-08-10T20:58:01Z","updated_at":"2015-08-10T20:58:01Z","body":"Forgot to add: I didn't edit the README, seems that some edits will be needed in a few places to remove the reference to numpy."}}