diff --git a/jmclient/jmclient/__init__.py b/jmclient/jmclient/__init__.py index 5d8ddac..35ff958 100644 --- a/jmclient/jmclient/__init__.py +++ b/jmclient/jmclient/__init__.py @@ -3,7 +3,7 @@ import logging from .support import (calc_cj_fee, choose_sweep_orders, choose_orders, cheapest_order_choose, weighted_order_choose, - rand_norm_array, rand_pow_array, rand_exp_array, + rand_norm_array, rand_exp_array, rand_weighted_choice, select, select_gradual, select_greedy, select_greediest, get_random_bytes, random_under_max_order_choose, diff --git a/jmclient/jmclient/support.py b/jmclient/jmclient/support.py index 3f1b971..4177eea 100644 --- a/jmclient/jmclient/support.py +++ b/jmclient/jmclient/support.py @@ -44,14 +44,6 @@ def rand_exp_array(lamda, n): return [random.expovariate(1.0 / lamda) for _ in range(n)] -def rand_pow_array(power, n): - # rather crude in that uses a uniform sample which is a multiple of 1e-4 - # for basis of formula, see: http://mathworld.wolfram.com/RandomNumber.html - return [y**(1.0 / power) - for y in [x * 0.0001 for x in random.sample( - range(10000), n)]] - - def rand_weighted_choice(n, p_arr): """ Choose a value in 0..n-1 diff --git a/jmclient/test/test_support.py b/jmclient/test/test_support.py index 01322f3..cb0872e 100644 --- a/jmclient/test/test_support.py +++ b/jmclient/test/test_support.py @@ -4,7 +4,7 @@ import pytest from jmclient import (select, select_gradual, select_greedy, select_greediest, choose_orders, choose_sweep_orders, weighted_order_choose) -from jmclient.support import (calc_cj_fee, rand_exp_array, rand_pow_array, +from jmclient.support import (calc_cj_fee, rand_exp_array, rand_norm_array, rand_weighted_choice, cheapest_order_choose) from taker_test_data import t_orderbook @@ -37,11 +37,6 @@ def test_random_funcs(): assert len(x2) == 10 for x in x2: assert x > 0 - x3 = rand_pow_array(100, 10) - assert len(x3) == 10 - for x in x3: - assert x > 0 - assert x < 1 x4 = rand_weighted_choice(5, [0.2, 0.1, 0.3, 0.15, 0.25]) assert x4 in range(5) #test weighted choice fails with invalid inputs