# Path: phydmslib/constants.py
# N_NT = len(INDEX_TO_NT)
# 
# N_AA = len(INDEX_TO_AA)
# 
# AA_TO_INDEX = {aa: i for (i, aa) in INDEX_TO_AA.items()}
# 
# N_CODON = len(CODON_TO_INDEX)
# 
# CODON_SINGLEMUT = numpy.full((N_CODON, N_CODON), False, dtype='bool')
# 
# CODON_NONSYN = numpy.full((N_CODON, N_CODON), False, dtype='bool')


import random
import unittest
import numpy
import phydmslib.models
from phydmslib.constants import (N_NT, N_AA, AA_TO_INDEX, N_CODON,
                                 CODON_SINGLEMUT, CODON_NONSYN)
"""Tests the calculation of spielmanwr, following Spielman and Wilke, 2015.

Written by Jesse Bloom and Sarah Hilton.
"""




class testExpCM_spielmanwr(unittest.TestCase):
    """Test the calculation of `spielmanwr` using the model `ExpCM`."""

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

    def testExpCM_spielmanwr(self):
        """Test the `ExpCM` function `_spielman_wr`."""
        # create models
        random.seed(1)
        numpy.random.seed(1)
        nsites = 10

# Path: phydmslib/constants.py
# N_NT = len(INDEX_TO_NT)
# 
# N_AA = len(INDEX_TO_AA)
# 
# AA_TO_INDEX = {aa: i for (i, aa) in INDEX_TO_AA.items()}
# 
# N_CODON = len(CODON_TO_INDEX)
# 
# CODON_SINGLEMUT = numpy.full((N_CODON, N_CODON), False, dtype='bool')
# 
# CODON_NONSYN = numpy.full((N_CODON, N_CODON), False, dtype='bool')


# Path: tests/test_spielmanwr.py
import random
import unittest
import numpy
import phydmslib.models
from phydmslib.constants import (N_NT, N_AA, AA_TO_INDEX, N_CODON,
                                 CODON_SINGLEMUT, CODON_NONSYN)

"""Tests the calculation of spielmanwr, following Spielman and Wilke, 2015.

Written by Jesse Bloom and Sarah Hilton.
"""




class testExpCM_spielmanwr(unittest.TestCase):
    """Test the calculation of `spielmanwr` using the model `ExpCM`."""

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

    def testExpCM_spielmanwr(self):
        """Test the `ExpCM` function `_spielman_wr`."""
        # create models
        random.seed(1)
        numpy.random.seed(1)
        nsites = 10

        g = numpy.random.dirichlet([5] * N_NT)