mirror of
https://github.com/Doctorado-ML/benchmark.git
synced 2025-08-17 00:15:55 +00:00
Add excel report in benchmark
This commit is contained in:
22
src/Utils.py
22
src/Utils.py
@@ -1,11 +1,13 @@
|
||||
import os
|
||||
import subprocess
|
||||
|
||||
|
||||
class Folders:
|
||||
data = "data"
|
||||
results = "results"
|
||||
src = "src"
|
||||
report = os.path.join("exreport", "exreport_output")
|
||||
exreport = "exreport"
|
||||
report = os.path.join(exreport, "exreport_output")
|
||||
|
||||
|
||||
class Files:
|
||||
@@ -13,7 +15,9 @@ class Files:
|
||||
exreport = "exreport.csv"
|
||||
exreport_output = "exreport.txt"
|
||||
exreport_err = "exreport_err.txt"
|
||||
cmd_open = "/usr/bin/open"
|
||||
exreport_excel = "exreport.xlsx"
|
||||
cmd_open_macos = "/usr/bin/open"
|
||||
cmd_open_linux = "/usr/bin/xdg-open"
|
||||
exreport_pdf = "Rplots.pdf"
|
||||
|
||||
@staticmethod
|
||||
@@ -35,6 +39,20 @@ class Files:
|
||||
def dataset(name):
|
||||
return f"{name}_R.dat"
|
||||
|
||||
@staticmethod
|
||||
def is_exe(fpath):
|
||||
return os.path.isfile(fpath) and os.access(fpath, os.X_OK)
|
||||
|
||||
@staticmethod
|
||||
def open(name):
|
||||
if os.path.isfile(name):
|
||||
command = (
|
||||
Files.cmd_open_macos
|
||||
if Files.is_exe(Files.cmd_open_macos)
|
||||
else Files.cmd_open_linux
|
||||
)
|
||||
subprocess.run([command, name])
|
||||
|
||||
|
||||
class Symbols:
|
||||
check_mark = "\N{heavy check mark}"
|
||||
|
Reference in New Issue
Block a user