Exemplo n.º 1
0
    def test_Ne_overwrites_size_none(self):
        d1 = msprime.Demography.island_model(2, 1, Ne=None)
        self.assertEqual(d1.populations[0].initial_size, None)
        self.assertEqual(d1.populations[1].initial_size, None)
        d2 = msprime.demography_factory(
            Ne=1234,
            demography=d1,
            population_configurations=None,
            migration_matrix=None,
            demographic_events=None,
        )
        self.assertEqual(d2.populations[0].initial_size, 1234)
        self.assertEqual(d2.populations[1].initial_size, 1234)

        d1.populations[0].initial_size = 100
        d1.populations[1].initial_size = None
        d2 = msprime.demography_factory(
            Ne=1234,
            demography=d1,
            population_configurations=None,
            migration_matrix=None,
            demographic_events=None,
        )
        self.assertEqual(d2.populations[0].initial_size, 100)
        self.assertEqual(d2.populations[1].initial_size, 1234)
Exemplo n.º 2
0
 def f(
     population_configurations=None,
     migration_matrix=None,
     demographic_events=None,
 ):
     msprime.demography_factory(
         Ne=1,
         demography=demography,
         population_configurations=population_configurations,
         migration_matrix=migration_matrix,
         demographic_events=demographic_events,
     )
Exemplo n.º 3
0
 def test_input_demography_copied(self):
     d1 = msprime.Demography.island_model(2, 1, Ne=100)
     d2 = msprime.demography_factory(
         Ne=None,
         demography=d1,
         population_configurations=None,
         migration_matrix=None,
         demographic_events=None,
     )
     self.assertEqual(d1, d2)
     self.assertIsNot(d1, d2)
     self.assertIsNot(d1.populations[0], d2.populations[0])
     self.assertIsNot(d1.populations[1], d2.populations[1])
     self.assertIsNot(d1.migration_matrix, d2.migration_matrix)