Update requirements

This commit is contained in:
2024-03-12 14:24:03 +01:00
parent 94cb2a0617
commit 152c59dbbb
4 changed files with 18 additions and 13 deletions

View File

@@ -28,7 +28,7 @@ def index():
benchmarks = [current_user.benchmark] benchmarks = [current_user.benchmark]
for benchmark in benchmarks: for benchmark in benchmarks:
os.chdir(benchmark.folder) os.chdir(benchmark.folder)
benchmark.num_files = len(Files.get_all_results(hidden=False)) benchmark.num_files = len(Files().get_all_results(hidden=False))
os.chdir(current_user.benchmark.folder) os.chdir(current_user.benchmark.folder)
else: else:
benchmarks = [] benchmarks = []

View File

@@ -46,7 +46,7 @@ def select():
# Get a list of files in a directory # Get a list of files in a directory
files = {} files = {}
os.chdir(current_user.benchmark.folder) os.chdir(current_user.benchmark.folder)
names = Files.get_all_results(hidden=False) names = Files().get_all_results(hidden=False)
for name in names: for name in names:
report = StubReport(os.path.join(Folders.results, name)) report = StubReport(os.path.join(Folders.results, name))
report.report() report.report()
@@ -139,9 +139,7 @@ def report(file_name):
def process_data(file_name, compare, data): def process_data(file_name, compare, data):
report = StubReport( report = StubReport(os.path.join(Folders.results, file_name))
os.path.join(Folders.results, file_name), compare=compare
)
new_list = [] new_list = []
for result in data["results"]: for result in data["results"]:
symbol = report._compute_status(result["dataset"], result["score"]) symbol = report._compute_status(result["dataset"], result["score"])
@@ -216,7 +214,7 @@ def dataset_report(dataset):
app_config = dotenv_values(".env") app_config = dotenv_values(".env")
dt = Datasets() dt = Datasets()
data = dt.get_attributes(dataset) data = dt.get_attributes(dataset)
names = Files.get_all_results(hidden=False) names = Files().get_all_results(hidden=False)
results = {} results = {}
for name in names: for name in names:
try: try:

View File

@@ -1,27 +1,27 @@
from beflask.models import Benchmark, db, User from beflask.models import Benchmark, db, User
from beflask import app from beflask import app
_, app = app.create_app() app = app.create_app()
with app.app_context(): with app.app_context():
db.drop_all() db.drop_all()
db.create_all() db.create_all()
b = Benchmark( b = Benchmark(
name="discretizbench", name="discretizbench",
folder="/Users/rmontanana/Code/discretizbench", folder="/home/rmontanana/Code/discretizbench",
description="Experiments with local discretization and Bayesian " description="Experiments with local discretization and Bayesian "
"classifiers", "classifiers",
) )
db.session.add(b) db.session.add(b)
b = Benchmark( b = Benchmark(
name="odtebench", name="odtebench",
folder="/Users/rmontanana/Code/odtebench", folder="/home/rmontanana/Code/odtebench",
description="Experiments with STree and Ensemble classifiers", description="Experiments with STree and Ensemble classifiers",
) )
db.session.add(b) db.session.add(b)
b = Benchmark( b = Benchmark(
name="covbench", name="covbench",
folder="/Users/rmontanana/Code/covbench", folder="/home/rmontanana/Code/covbench",
description="Experiments with COVID-19 dataset", description="Experiments with COVID-19 dataset",
) )
db.session.add(b) db.session.add(b)

View File

@@ -1,4 +1,5 @@
import pytest import pytest
from sys import platform
from beflask import app as application from beflask import app as application
from flask_login import FlaskLoginClient from flask_login import FlaskLoginClient
from beflask.models import Benchmark, User, db from beflask.models import Benchmark, User, db
@@ -76,22 +77,28 @@ def guest_password():
def db_seed(db, admin_user, admin_password): def db_seed(db, admin_user, admin_password):
db.drop_all() db.drop_all()
db.create_all() db.create_all()
if platform == "linux" or platform == "linux2":
prefix = "/home"
elif platform == "darwin":
prefix = "/Users"
else:
prefix = "/home"
b = Benchmark( b = Benchmark(
name="discretizbench", name="discretizbench",
folder="/Users/rmontanana/Code/discretizbench", folder=f"{prefix}/rmontanana/Code/discretizbench",
description="Experiments with local discretization and Bayesian" description="Experiments with local discretization and Bayesian"
"classifiers", "classifiers",
) )
db.session.add(b) db.session.add(b)
b = Benchmark( b = Benchmark(
name="odtebench", name="odtebench",
folder="/Users/rmontanana/Code/odtebench", folder=f"{prefix}/rmontanana/Code/odtebench",
description="Experiments with STree and Ensemble classifiers", description="Experiments with STree and Ensemble classifiers",
) )
db.session.add(b) db.session.add(b)
b = Benchmark( b = Benchmark(
name="covbench", name="covbench",
folder="/Users/rmontanana/Code/covbench", folder=f"{prefix}/rmontanana/Code/covbench",
description="Experiments with COVID-19 dataset", description="Experiments with COVID-19 dataset",
) )
db.session.add(b) db.session.add(b)