4
1
mirror of https://github.com/pfloos/quack synced 2024-12-23 04:43:53 +01:00
quack/tests/create_database.py

53 lines
1.3 KiB
Python
Raw Normal View History

2024-08-28 01:06:31 +02:00
2024-08-30 20:15:39 +02:00
import argparse
2024-08-28 01:06:31 +02:00
from molecule import save_molecules_to_json, load_molecules_from_json
2024-08-30 20:15:39 +02:00
from molecule import create_database, add_molecule_to_db, remove_database
2024-08-28 01:06:31 +02:00
2024-08-29 20:48:16 +02:00
from feather_bench import FeatherBench
2024-08-28 01:06:31 +02:00
2024-08-30 20:15:39 +02:00
parser = argparse.ArgumentParser(description="Benchmark Data Sets")
parser.add_argument(
'-s', '--set_type',
choices=['light', 'medium', 'heavy'],
default='light',
help="Specify the type of data set: light (default), medium, or heavy."
)
args = parser.parse_args()
if args.set_type == 'light':
bench = 'FeatherBench'
bench_title = "\n\nSelected Light Benchmark: {}\n\n".format(bench)
elif args.set_type == 'medium':
bench = 'BalanceBench'
bench_title = "\n\nSelected Medium Benchmark: {}\n\n".format(bench)
elif args.set_type == 'heavy':
bench = 'TitanBench'
bench_title = "\n\nSelected Heavy Benchmark: {}\n\n".format(bench)
else:
bench_title = "\n\nSelected Light Benchmark: {}\n\n".format(bench)
db_name = '{}.db'.format(bench)
2024-08-28 01:06:31 +02:00
# Save molecules to JSON
2024-08-30 00:10:19 +02:00
#save_molecules_to_json(FeatherBench, 'FeatherBench.json')
2024-08-28 01:06:31 +02:00
# Load molecules from JSON
2024-08-30 00:10:19 +02:00
#loaded_molecules = load_molecules_from_json('FeatherBench.json')
#print(loaded_molecules)
2024-08-28 01:06:31 +02:00
2024-08-30 20:15:39 +02:00
#remove_database(db_name)
2024-08-28 01:06:31 +02:00
create_database(db_name)
2024-08-29 20:48:16 +02:00
for molecule in FeatherBench:
2024-08-28 01:06:31 +02:00
add_molecule_to_db(db_name, molecule)
2024-08-29 09:45:30 +02:00