# Path: phydmslib/constants.py
# N_CODON = len(CODON_TO_INDEX)
# 
# N_NT = len(INDEX_TO_NT)
# 
# CODON_NT_COUNT = numpy.zeros((N_NT, N_CODON), dtype='int')
# 
# AA_TO_INDEX = {aa: i for (i, aa) in INDEX_TO_AA.items()}
# 
# N_AA = len(INDEX_TO_AA)


import random
import unittest
import numpy
import scipy.linalg
import scipy.optimize
import phydmslib.models
from phydmslib.constants import (N_CODON, N_NT, CODON_NT_COUNT,
                                 AA_TO_INDEX, N_AA)
"""Tests `phydmslib.models.ExpCM_empirical_phi` class.

Written by Jesse Bloom.
"""




class testExpCM_empirical_phi(unittest.TestCase):
    """Tests ``ExpCM`` with empirical phi."""

    def test_ExpCM_empirical_phi(self):
        """Initialize `ExpCM_empirical_phi`, test, update, test again."""
        # create preferences
        random.seed(1)
        numpy.random.seed(1)
        self.nsites = 7
        self.prefs = []
        minpref = 0.01
        for _r in range(self.nsites):

# Path: phydmslib/constants.py
# N_CODON = len(CODON_TO_INDEX)
# 
# N_NT = len(INDEX_TO_NT)
# 
# CODON_NT_COUNT = numpy.zeros((N_NT, N_CODON), dtype='int')
# 
# AA_TO_INDEX = {aa: i for (i, aa) in INDEX_TO_AA.items()}
# 
# N_AA = len(INDEX_TO_AA)


# Path: tests/test_expcm_empirical_phi.py
import random
import unittest
import numpy
import scipy.linalg
import scipy.optimize
import phydmslib.models
from phydmslib.constants import (N_CODON, N_NT, CODON_NT_COUNT,
                                 AA_TO_INDEX, N_AA)

"""Tests `phydmslib.models.ExpCM_empirical_phi` class.

Written by Jesse Bloom.
"""




class testExpCM_empirical_phi(unittest.TestCase):
    """Tests ``ExpCM`` with empirical phi."""

    def test_ExpCM_empirical_phi(self):
        """Initialize `ExpCM_empirical_phi`, test, update, test again."""
        # create preferences
        random.seed(1)
        numpy.random.seed(1)
        self.nsites = 7
        self.prefs = []
        minpref = 0.01
        for _r in range(self.nsites):

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