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


import random
import unittest
import scipy.linalg
import scipy.optimize
import numpy
import phydmslib.models
from phydmslib.constants import (N_CODON, N_NT, AA_TO_INDEX, N_AA,
                                 CODON_NT_COUNT)
            "M({0}) differs".format(t))
        for param in ["kappa", "omega", "beta"]:
            self.assertTrue(
                numpy.allclose(
                    getattr(expcm, param), getattr(expcm_divpressure, param)),
                "param values differ for {0}".format(param))
            self.assertTrue(
                numpy.allclose(
                    expcm.dstationarystate(param),
                    (expcm_divpressure.dstationarystate(param))),
                "dstationarystate differs for {0}".format(param))
            self.assertTrue(
                numpy.allclose(
                    expcm.dM(t, param, expcm.M(t)),
                    (expcm_divpressure.dM(t, param, expcm_divpressure.M(t)))),
                "dM({0}) differs for {1}".format(t, param))


class testExpCM_empirical_phi_divpressure(unittest.TestCase):
    """Tests ``ExpCM`` with div pressure."""

    def test_ExpCM_empirical_phi_divpressure(self):
        """Init `ExpCM_empirical_phi_divpressure`, test, update, test again."""
        # create preferences
        random.seed(1)
        numpy.random.seed(1)
        self.nsites = 6
        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)
# 
# AA_TO_INDEX = {aa: i for (i, aa) in INDEX_TO_AA.items()}
# 
# N_AA = len(INDEX_TO_AA)
# 
# CODON_NT_COUNT = numpy.zeros((N_NT, N_CODON), dtype='int')


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

            "M({0}) differs".format(t))
        for param in ["kappa", "omega", "beta"]:
            self.assertTrue(
                numpy.allclose(
                    getattr(expcm, param), getattr(expcm_divpressure, param)),
                "param values differ for {0}".format(param))
            self.assertTrue(
                numpy.allclose(
                    expcm.dstationarystate(param),
                    (expcm_divpressure.dstationarystate(param))),
                "dstationarystate differs for {0}".format(param))
            self.assertTrue(
                numpy.allclose(
                    expcm.dM(t, param, expcm.M(t)),
                    (expcm_divpressure.dM(t, param, expcm_divpressure.M(t)))),
                "dM({0}) differs for {1}".format(t, param))


class testExpCM_empirical_phi_divpressure(unittest.TestCase):
    """Tests ``ExpCM`` with div pressure."""

    def test_ExpCM_empirical_phi_divpressure(self):
        """Init `ExpCM_empirical_phi_divpressure`, test, update, test again."""
        # create preferences
        random.seed(1)
        numpy.random.seed(1)
        self.nsites = 6
        self.prefs = []
        minpref = 0.01
        for _r in range(self.nsites):

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