# Path: phydmslib/constants.py
# N_NT = len(INDEX_TO_NT)


import os
import unittest
import subprocess
import random
import pandas
import phydmslib.file_io
import phydmslib.models
import phydmslib.simulate
import pyvolve
import numpy
from phydmslib.constants import N_NT
                               "--brlen", "scale"])
        omegabysitefile = simulateprefix + "_omegabysite.txt"
        omegas = pandas.read_csv(omegabysitefile, sep="\t", comment="#")
        divpressureomegas = omegas[omegas["site"].isin(divpressuresites)]
        self.assertTrue(len(divpressureomegas) == len(divpressuresites))
        self.assertTrue(
            (divpressureomegas["omega"].values > 2).all(),
            "Not all divpressure sites have omega > 2:\n{0}"
            .format(divpressureomegas))
        self.assertTrue(
            (divpressureomegas["P"].values < 0.08).all(),
            "Not all divpressure sites have P < 0.08:\n{0}"
            .format(divpressureomegas))
        nspurious = len(
            omegas[
                (omegas["omega"] > 2)
                & (omegas["P"] < 0.05)
                & (~omegas["site"].isin(divpressuresites))])
        self.assertTrue(nspurious <= 1, "{0} spurious sites".format(nspurious))

        for f in ["custom_matrix_frequencies.txt"]:
            if os.path.isfile(f):
                os.remove(f)


class test_OmegaBySiteYNGKP(test_OmegaBySiteExpCM):
    """Tests ``--omegabysite`` to ``phydms`` for `YNGKP_M0`."""

    def initializeModel(self):
        """Init model."""

# Path: phydmslib/constants.py
# N_NT = len(INDEX_TO_NT)


# Path: tests/test_omegabysite.py
import os
import unittest
import subprocess
import random
import pandas
import phydmslib.file_io
import phydmslib.models
import phydmslib.simulate
import pyvolve
import numpy
from phydmslib.constants import N_NT

                               "--brlen", "scale"])
        omegabysitefile = simulateprefix + "_omegabysite.txt"
        omegas = pandas.read_csv(omegabysitefile, sep="\t", comment="#")
        divpressureomegas = omegas[omegas["site"].isin(divpressuresites)]
        self.assertTrue(len(divpressureomegas) == len(divpressuresites))
        self.assertTrue(
            (divpressureomegas["omega"].values > 2).all(),
            "Not all divpressure sites have omega > 2:\n{0}"
            .format(divpressureomegas))
        self.assertTrue(
            (divpressureomegas["P"].values < 0.08).all(),
            "Not all divpressure sites have P < 0.08:\n{0}"
            .format(divpressureomegas))
        nspurious = len(
            omegas[
                (omegas["omega"] > 2)
                & (omegas["P"] < 0.05)
                & (~omegas["site"].isin(divpressuresites))])
        self.assertTrue(nspurious <= 1, "{0} spurious sites".format(nspurious))

        for f in ["custom_matrix_frequencies.txt"]:
            if os.path.isfile(f):
                os.remove(f)


class test_OmegaBySiteYNGKP(test_OmegaBySiteExpCM):
    """Tests ``--omegabysite`` to ``phydms`` for `YNGKP_M0`."""

    def initializeModel(self):
        """Init model."""

        e_pw = numpy.full((3, N_NT), 1.0 / N_NT, dtype="float")