update
This commit is contained in:
parent
e3df57ccde
commit
626b3a7327
@ -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
|
||||
|
@ -104,3 +104,4 @@ verbose:
|
||||
querying: true
|
||||
concentration_test: true
|
||||
|
||||
persistent_query_memoization: false
|
||||
|
@ -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"]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user