Exemplo n.º 1
0
    def get_index_for_individual(self, individual_id):

        """
        This function ...
        :param individual_id:
        :return:
        """

        return tables.find_index(self, individual_id, "Individual ID")
Exemplo n.º 2
0
Arquivo: tables.py Projeto: SKIRT/PTS
    def get_index_for_individual(self, individual_id):

        """
        This function ...
        :param individual_id:
        :return:
        """

        return tables.find_index(self, individual_id, "Individual ID")
Exemplo n.º 3
0
    def score_for(self, individual_name):

        """
        This function ...
        :param individual_name: 
        :return: 
        """

        index = tables.find_index(self, individual_name, "Individual name")
        return self["Score"][index]
Exemplo n.º 4
0
Arquivo: tables.py Projeto: SKIRT/PTS
    def score_for(self, individual_name):

        """
        This function ...
        :param individual_name: 
        :return: 
        """

        index = tables.find_index(self, individual_name, "Individual name")
        return self["Score"][index]
Exemplo n.º 5
0
    def get_original_generation_and_individual_id(self, individual_id):

        """
        This function ...
        """

        index = tables.find_index(self, individual_id)
        if index is None: raise ValueError("Individual " + str(individual_id) + " not found")

        # Return generation and original individual ID
        return self["Generation"][index], self["Original individual ID"][index]
Exemplo n.º 6
0
    def get_score_for_individual(self, individual_id):

        """
        This function ...
        :param individual_id:
        :return:
        """

        index = tables.find_index(self, individual_id)
        if index is None: raise ValueError("Individual " + str(individual_id) + " not found")
        return self["Score"][index]
Exemplo n.º 7
0
Arquivo: tables.py Projeto: SKIRT/PTS
    def get_original_generation_and_individual_id(self, individual_id):

        """
        This function ...
        """

        index = tables.find_index(self, individual_id)
        if index is None: raise ValueError("Individual " + str(individual_id) + " not found")

        # Return generation and original individual ID
        return self["Generation"][index], self["Original individual ID"][index]
Exemplo n.º 8
0
Arquivo: tables.py Projeto: SKIRT/PTS
    def get_score_for_individual(self, individual_id):

        """
        This function ...
        :param individual_id:
        :return:
        """

        index = tables.find_index(self, individual_id)
        if index is None: raise ValueError("Individual " + str(individual_id) + " not found")
        return self["Score"][index]
Exemplo n.º 9
0
    def get_original_individual(self, individual_id):

        """
        This function ...
        :param individual_id:
        :return:
        """

        index = tables.find_index(self, individual_id)
        representation = self["Original individual"][index]

        #print(representation)

        # Return as binary genome, or as list of quantites or real values
        try:
            individual = parsing.binary(representation)
            print(individual)
            return individual
        except ValueError: return parsing.real_list_or_quantity_list(representation)
Exemplo n.º 10
0
Arquivo: tables.py Projeto: SKIRT/PTS
    def get_original_individual(self, individual_id):

        """
        This function ...
        :param individual_id:
        :return:
        """

        index = tables.find_index(self, individual_id)
        representation = self["Original individual"][index]

        #print(representation)

        # Return as binary genome, or as list of quantites or real values
        try:
            individual = parsing.binary(representation)
            print(individual)
            return individual
        except ValueError: return parsing.real_list_or_quantity_list(representation)
Exemplo n.º 11
0
        print("Differences:")
        print(differences)
    differences_order = set(table_a.colnames).symmetric_difference(table_b.colnames)
    if len(differences_order) > 0:
        print("Differences in order:")
        print(differences_order)

if len(table_a) == len(table_b): print("Table sizes are equal")
else: print("Table sizes are not equal")

# -----------------------------------------------------------------

for index_a in range(len(table_a)):

    key = table_a[table_a.colnames[0]][index_a]
    index_b = tables.find_index(table_b, key)

    row_a = table_a[index_a]
    row_b = table_b[index_b]

    #print("")
    #print(row_a)
    #print(row_b)
    #print("")

    for name in table_a.colnames:

        try:
            value_a = float(row_a[name])
            value_b = float(row_b[name])
            #print(value_a/value_b)
Exemplo n.º 12
0
        print(differences)
    differences_order = set(table_a.colnames).symmetric_difference(
        table_b.colnames)
    if len(differences_order) > 0:
        print("Differences in order:")
        print(differences_order)

if len(table_a) == len(table_b): print("Table sizes are equal")
else: print("Table sizes are not equal")

# -----------------------------------------------------------------

for index_a in range(len(table_a)):

    key = table_a[table_a.colnames[0]][index_a]
    index_b = tables.find_index(table_b, key)

    row_a = table_a[index_a]
    row_b = table_b[index_b]

    #print("")
    #print(row_a)
    #print(row_b)
    #print("")

    for name in table_a.colnames:

        try:
            value_a = float(row_a[name])
            value_b = float(row_b[name])
            #print(value_a/value_b)