From 04a8809c19f9f1e6a15ee157eae4a242ab878dbb Mon Sep 17 00:00:00 2001 From: asifhaider <1805112@ugrad.cse.buet.ac.bd> Date: Sun, 3 Dec 2023 06:08:28 +0600 Subject: [PATCH] Fixed Inappropriate Logical Expressions --- pyomo/neos/plugins/NEOS.py | 2 +- pyomo/opt/base/convert.py | 2 +- pyomo/opt/solver/shellcmd.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pyomo/neos/plugins/NEOS.py b/pyomo/neos/plugins/NEOS.py index 2d5929fa9a1..85fad42d4b2 100644 --- a/pyomo/neos/plugins/NEOS.py +++ b/pyomo/neos/plugins/NEOS.py @@ -50,7 +50,7 @@ def create_command_line(self, executable, problem_files): logger.info("Solver log file: '%s'" % (self._log_file,)) if self._soln_file is not None: logger.info("Solver solution file: '%s'" % (self._soln_file,)) - if self._problem_files is not []: + if self._problem_files != []: logger.info("Solver problem files: %s" % (self._problem_files,)) return Bunch(cmd="", log_file=self._log_file, env="") diff --git a/pyomo/opt/base/convert.py b/pyomo/opt/base/convert.py index 972239a65cd..8d8bd78e2ee 100644 --- a/pyomo/opt/base/convert.py +++ b/pyomo/opt/base/convert.py @@ -55,7 +55,7 @@ def convert_problem( if os.sep in fname: # pragma:nocover fname = tmp.split(os.sep)[-1] source_ptype = [guess_format(fname)] - if source_ptype is [None]: + if source_ptype == [None]: raise ConverterError("Unknown suffix type: " + tmp) else: source_ptype = args[0].valid_problem_types() diff --git a/pyomo/opt/solver/shellcmd.py b/pyomo/opt/solver/shellcmd.py index aad4298729a..20892000066 100644 --- a/pyomo/opt/solver/shellcmd.py +++ b/pyomo/opt/solver/shellcmd.py @@ -260,7 +260,7 @@ def _apply_solver(self): print("Solver log file: '%s'" % self._log_file) if self._soln_file is not None: print("Solver solution file: '%s'" % self._soln_file) - if self._problem_files is not []: + if self._problem_files != []: print("Solver problem files: %s" % str(self._problem_files)) sys.stdout.flush()