diff --git a/README.md b/README.md index 491908c..e167ea9 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,12 @@ +# Configuration + +The configuration is stored the the `src/config.yaml` file. + +## Database-specific configuration + +`database_name` should contain the name of the database to use. The database has to be stored in the proper directory structure (See the [Directory structure > Datasets](README.md#Datasets)) + # Directory structure of the project ## Virtual environment diff --git a/src/config.yaml b/src/config.yaml index 3aa0edb..b725746 100644 --- a/src/config.yaml +++ b/src/config.yaml @@ -104,3 +104,4 @@ verbose: querying: true concentration_test: true +persistent_query_memoization: false diff --git a/src/querying.py b/src/querying.py index ba994d6..c3b1e91 100644 --- a/src/querying.py +++ b/src/querying.py @@ -11,7 +11,15 @@ import orderankings as odrk from config import CONFIG, DATABASE_CFG, VENV_HOME, DATABASE_FILE # persistent memoïzation -memory = Memory(f"{VENV_HOME}/src/cache") +if CONFIG["persistent_query_memoization"]: + memory = Memory(f"{VENV_HOME}/src/cache") +else: + # if memoïzation is disabled, then just use the false memoization decorator + class FalseMemory: + def cache(self, func): + """This is a decorator that does nothing to its function.""" + return func + memory = FalseMemory() VERBOSE = CONFIG["verbose"]["querying"]