Aleš Erjavec avatar Aleš Erjavec committed 35769c9

Added caching of name lookups in obiTaxonomy.

Comments (0)

Files changed (1)

orangecontrib/bio/obiTaxonomy.py

             info(info_entry)
             if callback and i in milestones:
                 callback(i)
-    
+
+
+@pickled_cache(None, [("Taxonomy", "ncbi_taxonomy.tar.gz")], version=1)
 def name(taxid):
-    """ Return the scientific name for organism with taxid.
+    """
+    Return the scientific name for organism with taxid.
     """
     return Taxonomy()[taxid]
 
+
+@pickled_cache(None, [("Taxonomy", "ncbi_taxonomy.tar.gz")], version=1)
 def other_names(taxid):
-    """ Return a list of (name, name_type) tuples but exclude the scientific name.
+    """
+    Return a list of (name, name_type) tuples excluding the scientific name.
+
+    Use :func:`name` to retrieve the scientific name.
+
     """
     return  Taxonomy().other_names(taxid)
 
+
 @pickled_cache(None, [("Taxonomy", "ncbi_taxonomy.tar.gz")], version=1)
 def search(string, onlySpecies=True, exact=False):
     """ Search the NCBI taxonomy database for an organism
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.