Changes in [1766:7508cfe5ad26:1765:b497b961c944] in orange-bioinformatics


Ignore:
Location:
_bioinformatics/obiKEGG
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • _bioinformatics/obiKEGG/api.py

    r1760 r1757  
    436436 
    437437        # Finally join all the results, but drop all None objects 
    438  
    439         with closing(get.cache_store()): 
    440             keys = [get.key_from_args((id,)) for id in ids] 
    441             entries = [store[key].value for key in keys] 
    442  
    443         entries = filter(lambda e: e is not None, entries) 
     438        entries = filter(lambda e: e is not None, map(get, ids)) 
    444439 
    445440        rval = "".join(entries) 
  • _bioinformatics/obiKEGG/databases.py

    r1760 r1747  
    77 
    88import re 
    9 from contextlib import closing 
    109 
    1110from . import entry 
     
    194193            keys = self.keys() 
    195194 
    196         keys = map(self._add_db, keys) 
    197  
    198         get = self.api.get 
    199  
    200         # drop all keys with a valid cache entry to minimize the number 
    201         # of 'get' requests. 
    202         with closing(get.cache_store()) as store: 
    203             def is_uncached(key): 
    204                 return not get.key_has_valid_cache(get.key_from_args((key,)), 
    205                                                    store) 
    206             keys = filter(is_uncached, keys) 
    207  
     195        keys = list(keys) 
    208196        start = 0 
    209  
    210197        while start < len(keys): 
    211198            batch = keys[start: start + batch_size] 
     199            batch = map(self._add_db, batch) 
     200 
    212201            self.api.get(batch) 
    213202 
     
    226215        entries = [] 
    227216        batch_size = 10 
    228         keys = map(self._add_db, keys) 
    229  
    230         # Precache the entries first 
    231         self.pre_cache(keys) 
    232  
     217        keys = list(keys) 
    233218        start = 0 
    234219        while start < len(keys): 
    235220            batch = keys[start: start + batch_size] 
     221            batch = map(self._add_db, batch) 
    236222            batch_entries = self.api.get(batch) 
    237223            if batch_entries is not None: 
Note: See TracChangeset for help on using the changeset viewer.