Changeset 1760:165df4199ec9 in orange-bioinformatics for _bioinformatics/obiKEGG/api.py


Ignore:
Timestamp:
04/23/13 14:09:20 (12 months ago)
Author:
Ales Erjavec <ales.erjavec@…>
Branch:
default
Message:

Optimized DBDatabase batch_get/pre_cache w.r.t. number of separate network requests.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _bioinformatics/obiKEGG/api.py

    r1757 r1760  
    436436 
    437437        # Finally join all the results, but drop all None objects 
    438         entries = filter(lambda e: e is not None, map(get, ids)) 
     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) 
    439444 
    440445        rval = "".join(entries) 
Note: See TracChangeset for help on using the changeset viewer.