Changeset 1703:3b1a95ba16ec in orange-bioinformatics


Ignore:
Timestamp:
07/16/12 14:49:32 (22 months ago)
Author:
markotoplak
Branch:
default
Message:

gene matching: using generators for set_targets input now works correctly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _bioinformatics/obiGene.py

    r1682 r1703  
    867867    def set_targets(self, targets): 
    868868        ms = [] 
     869        targets = list(targets) #copy targets as multiple use would 
     870                                #be problematic if a generator was passed 
    869871        for matcher in self.matchers: 
    870872            ms.append(matcher.set_targets(targets)) 
     
    876878    def match(self, gene): 
    877879        return self.matcho.match(gene) 
     880 
    878881    def explain(self, gene): 
    879882        return self.matcho.explain(gene) 
     
    907910 
    908911    def set_targets(self, targets): 
     912        targets = list(targets) #would be problematic if generator was passed 
     913                                #as it is used twice 
    909914        aliases = [ set([a]) for a in targets] 
    910915        self.am = MatcherAliases(aliases, ignore_case=self.ignore_case) 
Note: See TracChangeset for help on using the changeset viewer.