from builtins import zip

import numpy as np

from astromodels.functions import Powerlaw


def test_memoizer():

    po = Powerlaw()

    a = np.random.uniform(-3, -1, 2000)
    b = np.random.uniform(0.1, 10, 2000)

    for aa, bb in zip(a, b):

        po.index = aa
        po.K = bb

        po(1.0)
