minorminer
minorminer copied to clipboard
Make bisclique cache location more configurable
Currently a user can override the cache location, but it's pretty inelegant
import os
import minorminer.busclique
def myfileloc(version=None):
dir_path = os.path.dirname(os.path.realpath(__file__))
return os.path.join(dir_path, "clique_cache")
minorminer.busclique.busgraph_cache.cache_rootdir = myfileloc
it would be nice to have an official API for specifying the cache location
I agree. Moreover, it would be nice to have consistent cache interface(s) across the whole Ocean. Some preliminary cache control improvements have been done in https://github.com/dwavesystems/dwave-cloud-client/pull/579, but they don't cover on-disk cache control.
I agree, @randomir. The disk cache I wrote here is entirely out of place, I hate just about every line of it, and I do not want to continue maintaining it if at all possible. If a better solution exists (I've only perused the bullet points of https://pypi.org/project/diskcache/ but it looks perfect) we should use that.