Package schrodinger :: Package job :: Module hunt_cache
[hide private]
[frames] | no frames]

Module hunt_cache

Speed up hunt with caching.

Classes [hide private]
  HuntCache
A HuntCache object represents a particular "hunt cache" a file that stores hunt results for re-use.
Functions [hide private]
int
dhm_to_seconds(dhms)
Interpret the given string as a time interval with units.
str
canonicalize_key(cache_key)
Return the string form of the key, with keys sorted and key-value pairs concatenated using the standard delimiter.
Variables [hide private]
  logger = log.get_output_logger('jobc.cache')
  cache_name = 'hunt_cache'
  delim = '!'
  __package__ = 'schrodinger.job'
Function Details [hide private]

dhm_to_seconds(dhms)

 

Interpret the given string as a time interval with units.

Parameters:
  • dhhms - a time interval, with optional units 's', 'm', 'h', or 'd'
Returns: int
the interval in seconds

canonicalize_key(cache_key)

 

Return the string form of the key, with keys sorted and key-value pairs concatenated using the standard delimiter.

This string form of the cache key is used in the cache file.

Parameters:
  • cache_key - a dict of hunt settings, representing a particular hunt request.
Returns: str
a string, composed of the key-value pairs from the cache key, concatentated in a standard order.