Skip to content

Commit

Permalink
Add a test for init and fix indent
Browse files Browse the repository at this point in the history
Signed-off-by: Ankita Katiyar <[email protected]>
  • Loading branch information
ankatiyar committed Oct 16, 2024
1 parent 4363f0a commit 029c993
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
3 changes: 3 additions & 0 deletions benchmarks/benchmark_datacatalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ def setup(self):
f"param_{i}": i for i in range(1, 1001)
}

def time_init(self):
"""Benchmark the time to initialize the catalog"""
DataCatalog.from_config(base_catalog)

def time_save(self):
"""Benchmark the time to save datasets"""
Expand Down
12 changes: 6 additions & 6 deletions benchmarks/benchmark_ocl.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ def _generate_globals(start_range, end_range, is_local=False):
return globals_dict

def _create_config_file(conf_source, env, file_name, data):
env_path = conf_source / env
env_path.mkdir(parents=True, exist_ok=True)
file_path = env_path / file_name
env_path = conf_source / env
env_path.mkdir(parents=True, exist_ok=True)
file_path = env_path / file_name

import yaml
with open(file_path, "w") as f:
yaml.dump(data, f)
import yaml
with open(file_path, "w") as f:
yaml.dump(data, f)

base_catalog = _generate_catalog(1, 1000, is_versioned=True)
local_catalog = _generate_catalog(501, 1500, is_local=True)
Expand Down

0 comments on commit 029c993

Please sign in to comment.