Skip to content

Commit

Permalink
fix tests, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
kondratyevd committed Mar 28, 2024
1 parent 3514020 commit 67fe8f8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
12 changes: 1 addition & 11 deletions scenarios/generator_2p1.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import os, sys
import copy
import yaml
import glob

from scenarios.presets import column_presets
from scenarios.utils import recreate_dir


default_config = {
Expand All @@ -23,15 +22,6 @@
}
}

def recreate_dir(save_dir):
if not os.path.exists(save_dir):
os.makedirs(save_dir)
print(f"Directory {save_dir} created.")
else:
print(f"Directory {save_dir} already exists, will clean all YAML files from it.")
yaml_files = glob.glob(f"{save_dir}/*yaml")+glob.glob(f"{save_dir}/*yml")
for file in yaml_files:
os.remove(file)

def generate_configs(save_dir="./"):
recreate_dir(save_dir)
Expand Down
12 changes: 12 additions & 0 deletions scenarios/utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import os
import glob

def recreate_dir(save_dir):
if not os.path.exists(save_dir):
os.makedirs(save_dir)
print(f"Directory {save_dir} created.")
else:
print(f"Directory {save_dir} already exists, will clean all YAML files from it.")
yaml_files = glob.glob(f"{save_dir}/*yaml")+glob.glob(f"{save_dir}/*yml")
for file in yaml_files:
os.remove(file)
2 changes: 1 addition & 1 deletion tests/utils.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os, sys
sys.path.append(os.getcwd())
import copy
from benchmark import Benchmark
from src.benchmark import Benchmark

def run_tests(config, functions):
b = Benchmark(config)
Expand Down

0 comments on commit 67fe8f8

Please sign in to comment.