dwavesystems / minorminer

minorminer is a heuristic tool for minor embedding: given a minor and target graph, it tries to find a mapping that embeds the minor into the target.
https://docs.ocean.dwavesys.com/en/stable/docs_minorminer/source/sdk_index.html
Apache License 2.0
48 stars 40 forks source link

Make bisclique cache location more configurable #242

Open arcondello opened 10 months ago

arcondello commented 10 months ago

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

randomir commented 10 months ago

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.

boothby commented 10 months ago

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.