From 57be80bcd4aac45764ebc27ca669d01022803cd3 Mon Sep 17 00:00:00 2001 From: Youcef AOUAD <youcef.aouad@inrae.fr> Date: Fri, 12 Jul 2024 11:26:28 +0200 Subject: [PATCH] cancel merge with master and update --- .gitignore | 2 ++ src/Solver/AdisTS.py | 8 ++++++++ src/Solver/CommandLine.py | 15 --------------- src/View/MainWindow.py | 5 +++-- src/View/RunSolver/Window.py | 4 +++- 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/.gitignore b/.gitignore index 1f1b00e7..9ea9f7f5 100644 --- a/.gitignore +++ b/.gitignore @@ -9,6 +9,8 @@ *.class tmp +mage8 +adists *.tar *.tar.* diff --git a/src/Solver/AdisTS.py b/src/Solver/AdisTS.py index 1a69cdbd..5219c851 100644 --- a/src/Solver/AdisTS.py +++ b/src/Solver/AdisTS.py @@ -20,6 +20,8 @@ import os import logging import numpy as np +import shutil + from tools import ( trace, timer, logger_exception, timestamp_to_old_pamhyr_date, @@ -131,6 +133,12 @@ class AdisTS(CommandLineSolver): self._export_REP_additional_lines(study, f) + path_mage_net = os.path.join(os.path.abspath(os.path.join(repertory, os.pardir)), f"default-mage/net") + path_adists_net = os.path.join(repertory, "net") + + if os.path.exists(path_mage_net): + shutil.copytree(path_mage_net, path_adists_net, dirs_exist_ok=True) + @timer def export(self, study, repertory, qlog=None): self._study = study diff --git a/src/Solver/CommandLine.py b/src/Solver/CommandLine.py index 5a2343a7..5f706d1a 100644 --- a/src/Solver/CommandLine.py +++ b/src/Solver/CommandLine.py @@ -196,17 +196,11 @@ class CommandLineSolver(AbstractSolver): The executable and list of arguments """ cmd = cmd.replace("@install_dir", self._install_dir()) - print("format command installDir :", self._install_dir()) cmd = cmd.replace("@path", "\"" + path + "\"") - print("format command path :", path) cmd = cmd.replace("@input", self.input_param().replace(" ", "_")) - print("format command input :", self.input_param().replace(" ", "_")) cmd = cmd.replace("@output", self.output_param()) - print("format command output :", self.output_param()) cmd = cmd.replace("@dir", self._process.workingDirectory()) - print("format command dir :", self._process.workingDirectory()) cmd = cmd.replace("@args", " ".join(self.cmd_args(study))) - print("format command args :", " ".join(self.cmd_args(study))) logger.debug(f"! {cmd}") @@ -243,11 +237,7 @@ class CommandLineSolver(AbstractSolver): return True cmd = self._cmd_solver - print("run solver commandline cmd : ", cmd) - print("path solver : ", self._path_solver) exe, args = self._format_command(study, cmd, self._path_solver) - print("parsed cmd solver exe : ", exe) - print("parsed cmd solver args : ", args) if not os.path.exists(exe): error = f"[ERROR] Path {exe} do not exists" @@ -318,11 +308,6 @@ class CommandLineSolver(AbstractSolver): self._output.put(res) def run(self, study, process=None, output_queue=None): - print("Run debug") - print("---------") - print("cmd input : ", self._cmd_input) - print("cmd solver : ", self._cmd_solver) - print("cmd output : ", self._cmd_output) self._study = study # Replace old values if needed diff --git a/src/View/MainWindow.py b/src/View/MainWindow.py index 558131cb..d36f5e59 100644 --- a/src/View/MainWindow.py +++ b/src/View/MainWindow.py @@ -1261,8 +1261,9 @@ class ApplicationWindow(QMainWindow, ListedSubWindow, WindowToolKit): if self._study is None: return - #solver = next(filter(lambda x: x._type == "adistslc", self.conf.solvers)) - solver = next(filter(lambda x: x.name == "AdisTS-LC", self.conf.solvers)) + solver = next(filter(lambda x: x._type == "adistslc", self.conf.solvers)) + #solver = next(filter(lambda x: x.name == "AdisTS-LC", self.conf.solvers)) + print(solver._type) self.run_solver(solver) def run_solver(self, solver): diff --git a/src/View/RunSolver/Window.py b/src/View/RunSolver/Window.py index 6f9bf5e6..270d565f 100644 --- a/src/View/RunSolver/Window.py +++ b/src/View/RunSolver/Window.py @@ -79,7 +79,9 @@ class SelectSolverWindow(PamhyrDialog): self.select_last_solver() def setup_combobox(self): - solvers = self._config.solvers + #solvers = self._config.solvers + #solvers mage + solvers = list(filter(lambda x: "adists" not in x._type, self._config.solvers)) solvers_name = list( map( self._format_solver_name, -- GitLab