# Path: phydmslib/constants.py
# N_AA = len(INDEX_TO_AA)
# 
# N_NT = len(INDEX_TO_NT)
# 
# AA_TO_INDEX = {aa: i for (i, aa) in INDEX_TO_AA.items()}


import random
import unittest
import numpy
import scipy.optimize
import phydmslib.models
from phydmslib.constants import N_AA, N_NT, AA_TO_INDEX
"""Tests `phydmslib.models.GammaDistributedBetaModel` class.

Written by Jesse Bloom and Sarah Hilton.
"""




class test_GammaBeta_ExpCM(unittest.TestCase):
    """Test gamma distributed beta for `ExpCM`."""

    # use approach here to run multiple tests:
    # http://stackoverflow.com/questions/17260469/instantiate-python-unittest-testcase-with-arguments
    BASEMODEL = phydmslib.models.ExpCM

    def test_GammaDistributedBeta(self):
        """Initialize, test values, update, test again."""
        random.seed(1)
        numpy.random.seed(1)
        nsites = 10

        # create preference set
        prefs = []
        minpref = 0.01
        for _r in range(nsites):

# Path: phydmslib/constants.py
# N_AA = len(INDEX_TO_AA)
# 
# N_NT = len(INDEX_TO_NT)
# 
# AA_TO_INDEX = {aa: i for (i, aa) in INDEX_TO_AA.items()}


# Path: tests/test_gammadistributedbeta_model.py
import random
import unittest
import numpy
import scipy.optimize
import phydmslib.models
from phydmslib.constants import N_AA, N_NT, AA_TO_INDEX

"""Tests `phydmslib.models.GammaDistributedBetaModel` class.

Written by Jesse Bloom and Sarah Hilton.
"""




class test_GammaBeta_ExpCM(unittest.TestCase):
    """Test gamma distributed beta for `ExpCM`."""

    # use approach here to run multiple tests:
    # http://stackoverflow.com/questions/17260469/instantiate-python-unittest-testcase-with-arguments
    BASEMODEL = phydmslib.models.ExpCM

    def test_GammaDistributedBeta(self):
        """Initialize, test values, update, test again."""
        random.seed(1)
        numpy.random.seed(1)
        nsites = 10

        # create preference set
        prefs = []
        minpref = 0.01
        for _r in range(nsites):

            rprefs = numpy.random.dirichlet([0.5] * N_AA)