Exemplo n.º 1
0
 def test_test_t_threshold(self):
     current_working_directory = os.getcwd()
     filepath = current_working_directory + "/GENOMICS_parameter.py"
     gnx.make_parameters_file(filepath)
     params = exec(open(filepath, 'r').read())
     pop = None
     self.assertEquals(True, burnin._test_t_threshold(pop, 2))
Exemplo n.º 2
0
 def test_test_adf_threshold(self):
     current_working_directory = os.getcwd()
     filepath = current_working_directory + "/GENOMICS_parameter.py"
     gnx.make_parameters_file(filepath)
     params = exec(open(filepath, 'r').read())
     pop = None #TODO: place holder for pop after testing model
     self.assertEquals(True, burnin._test_adf_threshold(pop, 1))
Exemplo n.º 3
0
 def test_make_defined_scape(self):
     current_working_directory = os.getcwd()
     filepath = current_working_directory + "/GENOMICS_parameter.py"
     gnx.make_parameters_file(filepath)
     params = exec(open(filepath, 'r').read())
     dim = params.land.main.dim
     res = params.land.main.res
     ulc = params.land.main.ulc
Exemplo n.º 4
0
 def test_write_stats(self):
     current_working_directory = os.getcwd()
     filepath = current_working_directory + "/GENOMICS_parameter.py"
     gnx.make_parameters_file(filepath)
     params = exec(open(filepath, 'r').read())
     land = landscape._make_landscape(params)
     pop = population._make_population(land, params)
     stats._calc_ld(pop)
Exemplo n.º 5
0
 def testMakeCommunity(self):
     current_working_directory = os.getcwd()
     filepath = current_working_directory + "/GENOMICS_parameter.py"
     gnx.make_parameters_file(filepath)
     params = exec(open(filepath, 'r').read())
     land = landscape._make_landscape(params)
     com = community._make_community(land, params)
     self.assertEqual(com.n_pops, len(params.comm.pops))
     self.assertEqual(com.t, -1)
Exemplo n.º 6
0
 def make_model_test_with_params(self):
     filenames = set(os.listdir('.'))
     g.make_parameters_file()
     new_filenames = set(os.listdir('.'))
     filename = [*new_filenames - filenames][0]
     try:
         g.make_model(filename)
     except:
         print("System error, fail make community test.")
Exemplo n.º 7
0
 def make_landscape_test(self):
     filenames = set(os.listdir('.'))
     g.make_parameters_file()
     new_filenames = set(os.listdir('.'))
     filename = [*new_filenames - filenames][0]
     try:
         g.make_landscape(filename)
     except:
         print("System error, fail make landscape test.")
Exemplo n.º 8
0
 def test_make_land(self):
     current_working_directory = os.getcwd()
     filepath = current_working_directory + "/GENOMICS_parameter.py"
     gnx.make_parameters_file(filepath)
     params = exec(open(filepath, 'r').read())
     dim = params.land.main.dim
     res = params.land.main.res
     ulc = params.land.main.ulc
     land = landscape._make_landscape(params, 2)
     self.assertIsInstance(land, landscape.Landscape)
Exemplo n.º 9
0
 def test_make_random_scape(self):
     current_working_directory = os.getcwd()
     filepath = current_working_directory + "/GENOMICS_parameter.py"
     gnx.make_parameters_file(filepath)
     params = exec(open(filepath, 'r').read())
     dim = params.land.main.dim
     try:
         random_scape = landscape._make_random_lyr(dim, 10)
     except:
         print("Can not make the random scape")
Exemplo n.º 10
0
 def make_genomic_architecture_test(self):
     filenames = set(os.listdir('.'))
     g.make_parameters_file()
     new_filenames = set(os.listdir('.'))
     filename = [*new_filenames - filenames][0]
     landscape = g.make_landscape(filename)
     try:
         g.make_genomic_architecture(filename, landscape)
     except:
         print("System error, fail make community test.")
Exemplo n.º 11
0
 def make_population_test(self):
     filenames = set(os.listdir('.'))
     g.make_parameters_file()
     new_filenames = set(os.listdir('.'))
     filename = [*new_filenames - filenames][0]
     landscape = g.make_landscape(filename)
     try:
         g.make_population(landscape, filename)
     except:
         print("System error, fail make population test.")
Exemplo n.º 12
0
 def test_make_recomb_array(self):
     current_working_directory = os.getcwd()
     filepath = current_working_directory + "/GENOMICS_parameter.py"
     gnx.make_parameters_file(filepath)
     params = exec(open(filepath, 'r').read())
     g_params = params.genome
     try:
         genome._make_recomb_array(g_params, 1)
     except:
         print("Can't make the recomb array")
Exemplo n.º 13
0
 def test_make_genomic_architecture(self):
     current_working_directory = os.getcwd()
     filepath = current_working_directory + "/GENOMICS_parameter.py"
     gnx.make_parameters_file(filepath)
     params = exec(open(filepath, 'r').read())
     g_params = params.genome
     land = gnx.make_landscape(params)
     Genomic_Architecture = gnx.make_genomic_architecture(params, land)
     genome_arch = genome._make_genomic_architecture(params, land)
     self.assertIsInstance(genome_arch, Genomic_Architecture)
Exemplo n.º 14
0
 def test_make_population(self):
     current_working_directory = os.getcwd()
     filepath = current_working_directory + "/GENOMICS_parameter.py"
     gnx.make_parameters_file(filepath)
     params = exec(open(filepath, 'r').read())
     land = gnx.make_landscape(params)
     #TODO: Need to update here
     #in order to make population we need to have land, params, pop_params
     pop = population._make_population(land, "aribitrary name", params)
     self.assertIsInstance(pop, population.Population)
Exemplo n.º 15
0
 def test_make_individual_simple_case(self):
     current_working_directory = os.getcwd()
     filepath = current_working_directory + "/GNX_test_params.py"
     gnx.make_parameters_file(filepath)
     params = exec(open(filepath, 'r').read())
     land = gnx.make_landscape(params)
     genome_arch = gnx.structs.genome._make_genomic_architecture(params,
                                                                 land)
     ind = gnx.structs.individual._make_individual(1, True, None,
                                                   genome_arch)
     self.assertIsInstance(ind, gnx.structs.individual.Individual)
     print("It's an individual!")
Exemplo n.º 16
0
 def make_params_file_test(self):
     try:
         g.make_parameters_file()
     except:
         print("System error, fail make parameter faile test.")