MCPcopy Create free account
hub / github.com/It4innovations/hyperqueue / load_or_create_database

Function load_or_create_database

benchmarks/src/utils/benchmark.py:69–77  ·  view source on GitHub ↗

Loads an existing database from a directory, or creates a new one.

(workdir: Path)

Source from the content-addressed store, hash-verified

67
68
69def load_or_create_database(workdir: Path) -> Database:
70 """
71 Loads an existing database from a directory, or creates a new one.
72 """
73 database_path = workdir / DEFAULT_DATA_JSON
74 if database_path.is_file():
75 return Database.from_file(database_path)
76 else:
77 return Database.empty(database_path)

Callers 3

computeFunction · 0.85
has_work_leftFunction · 0.85
run_benchmarksFunction · 0.85

Calls 2

from_fileMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected