From 76fdaebc300414897f99339f8635341390c9386a Mon Sep 17 00:00:00 2001 From: JOSHUA Robert Boverhof Date: Fri, 4 Oct 2024 12:33:33 -0700 Subject: [PATCH] pylint fixes --- foqus_lib/core.py | 10 +++++----- foqus_lib/foqus.py | 2 ++ foqus_lib/service/flowsheet.py | 3 +-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/foqus_lib/core.py b/foqus_lib/core.py index 132c4959c..8681d9f6a 100644 --- a/foqus_lib/core.py +++ b/foqus_lib/core.py @@ -38,7 +38,7 @@ class ModuleDependencyTracker: python_modules_available = {} python_modules_unavailable = {} - module = None + python_module_name = None @classmethod def available(cls): @@ -59,7 +59,7 @@ def load(cls): except ModuleNotFoundError: cls.python_modules_unavailable[instance.python_module_name] = instance raise - self._module = eval(instance.python_module_name) + instance._module = eval(instance.python_module_name) cls.python_modules_available[instance.python_module_name] = instance return instance @@ -108,9 +108,9 @@ def load(cls): if instance is not None: return instance instance = cls() - if not os.path.isdir(instance.path()): + if not os.path.isfile(instance.path()): raise RuntimeError("%r: Failed to Load Dependency" % (instance)) - if not os.access(filename, os.X_OK): + if not os.access(instance.path(), os.X_OK): raise RuntimeError( "%r: Dependency Path is not Executable: %s" % (instance.path()) ) @@ -138,7 +138,7 @@ class RScriptDependencyTracker(ExecutableDependencyTracker): default_path = "C:\\Program Files\\R\\R-3.1.2\\bin\\x64\\Rscript.exe" @classmethod - def path(self): + def path(cls): return shutil.which(cls.executable_name) or cls.default_path diff --git a/foqus_lib/foqus.py b/foqus_lib/foqus.py index cb56c0656..76efe032b 100644 --- a/foqus_lib/foqus.py +++ b/foqus_lib/foqus.py @@ -29,6 +29,8 @@ import sys import time import uuid +import traceback +import turbine # FOQUS imports import foqus_lib.version.version as ver # foqus version and other info diff --git a/foqus_lib/service/flowsheet.py b/foqus_lib/service/flowsheet.py index 8e8e43c9e..17c1e4ea8 100644 --- a/foqus_lib/service/flowsheet.py +++ b/foqus_lib/service/flowsheet.py @@ -20,7 +20,6 @@ """ import errno import json -import yaml import logging import logging.config import optparse @@ -36,11 +35,11 @@ import urllib.request import uuid from os.path import expanduser - import boto3 import botocore.exceptions import watchtower import functools +import yaml from turbine.commands import turbine_simulation_script from foqus_lib.framework.foqusException.foqusException import *