This commit is contained in:
Oscar Plaisant 2024-07-02 03:05:59 +02:00
parent e3df57ccde
commit 626b3a7327
3 changed files with 18 additions and 1 deletions

View File

@ -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

View File

@ -104,3 +104,4 @@ verbose:
querying: true
concentration_test: true
persistent_query_memoization: false

View File

@ -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"]