Skip to content

Commit

Permalink
Add instance name to output file names.
Browse files Browse the repository at this point in the history
  • Loading branch information
cubewise-gng authored and MariusWirtz committed Dec 30, 2024
1 parent 27d8ccf commit c8d1f12
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions optimuspy.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
TIME_STAMP = time.strftime("%Y-%m-%d_%H-%M-%S", time.localtime())
LOGFILE = APP_NAME + ".log"
RESULT_PATH = Path("results/")
RESULT_CSV = "{}_{}_{}_{}.csv"
RESULT_XLSX = "{}_{}_{}_{}.xlsx"
RESULT_PNG = "{}_{}_{}_{}.png"
RESULT_CSV = "{}_{}_{}_{}_{}.csv"
RESULT_XLSX = "{}_{}_{}_{}_{}.xlsx"
RESULT_PNG = "{}_{}_{}_{}_{}.png"

LABEL_MAP = {
ExecutionMode.ORIGINAL_ORDER: "Original Order",
Expand Down Expand Up @@ -218,19 +218,19 @@ def main(instance_name: str, cube_name: str, view_name: str, process_name: str,
optimus_result = OptimusResult(cube_name, permutation_results)
optimus_result.to_png(
view_name, process_name,
RESULT_PATH / RESULT_PNG.format(cube_name, view_name, process_name, TIME_STAMP))
RESULT_PATH / RESULT_PNG.format(instance_name, cube_name, view_name, process_name, TIME_STAMP))

if output.upper() == "XLSX":
optimus_result.to_xlsx(
view_name, process_name,
RESULT_PATH / RESULT_XLSX.format(cube_name, view_name, process_name, TIME_STAMP))
RESULT_PATH / RESULT_XLSX.format(instance_name, cube_name, view_name, process_name, TIME_STAMP))

else:
if not output.upper() == "CSV":
logging.warning("Value for -o / --output must be 'CSV' or 'XLSX'. Default is CSV")
optimus_result.to_csv(
view_name, process_name,
RESULT_PATH / RESULT_CSV.format(cube_name, view_name, process_name, TIME_STAMP))
RESULT_PATH / RESULT_CSV.format(instance_name, cube_name, view_name, process_name, TIME_STAMP))

return True

Expand Down

0 comments on commit c8d1f12

Please sign in to comment.