Exemplo n.º 1
0
 def load_entry(self,
                index,
                label,
                group,
                transportGroup,
                reference=None,
                referenceType='',
                shortDesc='',
                longDesc='',
                ):
     """
     Method for parsing entries in database files.
     Note that these argument names are retained for backward compatibility.
     """
     if (group[0:3].upper() == 'OR{' or
             group[0:4].upper() == 'AND{' or
             group[0:7].upper() == 'NOT OR{' or
             group[0:8].upper() == 'NOT AND{'):
         item = make_logic_node(group)
     else:
         item = Group().from_adjacency_list(group)
     self.entries[label] = Entry(
         index=index,
         label=label,
         item=item,
         data=transportGroup,
         reference=reference,
         reference_type=referenceType,
         short_desc=shortDesc,
         long_desc=longDesc.strip(),
     )
Exemplo n.º 2
0
    def load_entry(self, index, label, group, kinetics, reference=None, referenceType='', shortDesc='', longDesc='',
                   nodalDistance=None):
        """
        Method for parsing entries in database files.
        Note that these argument names are retained for backward compatibility.

        nodal_distance is the distance between a given entry and its parent specified by a float
        """
        if (group[0:3].upper() == 'OR{' or
                group[0:4].upper() == 'AND{' or
                group[0:7].upper() == 'NOT OR{' or
                group[0:8].upper() == 'NOT AND{'):
            item = make_logic_node(group)
        else:
            item = Group().from_adjacency_list(group)

        if label in self.entries:
            raise DatabaseError("Duplicate group name {label} found in kinetics groups for {family} "
                                "family.".format(label=label, family=self.label))
        self.entries[label] = Entry(
            index=index,
            label=label,
            item=item,
            data=kinetics,
            reference=reference,
            reference_type=referenceType,
            short_desc=shortDesc,
            long_desc=longDesc.strip(),
            nodal_distance=nodalDistance
        )
Exemplo n.º 3
0
 def load_entry(
         self,
         index,
         label,
         group,
         distances,
         reference=None,
         reference_type='',
         short_desc='',
         long_desc=''):
     if group[0:3].upper() == 'OR{' or group[0:4].upper(
     ) == 'AND{' or group[0:7].upper() == 'NOT OR{' or group[0:8].upper() == 'NOT AND{':
         item = make_logic_node(group)
     else:
         item = Group().from_adjacency_list(group)
     self.entries[label] = Entry(
         index=index,
         label=label,
         item=item,
         data=distances,
         reference=reference,
         reference_type=reference_type,
         short_desc=short_desc,
         long_desc=long_desc.strip(),
     )