From 204d692e73c8ecba21e7f246f4988e8fc797a1f8 Mon Sep 17 00:00:00 2001 From: Congjian Wang Date: Thu, 20 Oct 2022 14:36:03 -0600 Subject: [PATCH] update path for pysp and update libraries in build.sh --- build.sh | 8 ++++---- src/logos_main.py | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/build.sh b/build.sh index aa4d4a7..dbd3838 100755 --- a/build.sh +++ b/build.sh @@ -60,9 +60,9 @@ function install_libraries() if [[ $ECE_VERBOSE == 0 ]]; then echo ... Installing libraries from conda-forge ...; fi if [[ "$OSOPTION" = "--windows" ]]; then - local COMMAND=`echo conda install -c conda-forge pyomo ipopt glpk` + local COMMAND=`echo conda install -c conda-forge pyomo ipopt glpk pyutilib numpy-financial` else - local COMMAND=`echo conda install -c conda-forge pyomo ipopt coincbc glpk` + local COMMAND=`echo conda install -c conda-forge pyomo ipopt coincbc glpk pyutilib numpy-financial` fi if [[ $ECE_VERBOSE == 0 ]]; then echo ... conda-forge command: ${COMMAND}; fi ${COMMAND} @@ -79,9 +79,9 @@ function create_libraries() if [[ $ECE_VERBOSE == 0 ]]; then echo ... Installing libraries from conda-forge ...; fi if [[ "$OSOPTION" = "--windows" ]]; then - local COMMAND=`echo conda install -n ${LOGOS_LIBS_NAME} -c conda-forge pyomo ipopt glpk` + local COMMAND=`echo conda install -n ${LOGOS_LIBS_NAME} -c conda-forge pyomo ipopt glpk pyutilib numpy-financial` else - local COMMAND=`echo conda install -n ${LOGOS_LIBS_NAME} -c conda-forge pyomo ipopt coincbc glpk` + local COMMAND=`echo conda install -n ${LOGOS_LIBS_NAME} -c conda-forge pyomo ipopt coincbc glpk pyutilib numpy-financial` fi if [[ $ECE_VERBOSE == 0 ]]; then echo ... conda-forge command: ${COMMAND}; fi ${COMMAND} diff --git a/src/logos_main.py b/src/logos_main.py index 20a7371..5956d40 100644 --- a/src/logos_main.py +++ b/src/logos_main.py @@ -15,12 +15,12 @@ #Internal Modules------------------------------------------------------------------------------------ # Add contrib to the sys path -from _utils import getPluginLoc -pluginLoc = getPluginLoc(plugin='LOGOS') -if any(os.path.normcase(sp) == os.path.join(pluginLoc, 'src', 'contrib') for sp in sys.path): - print(f'WARNING: "{os.path.join(pluginLoc, "src", "contrib")}" already in system path. Skipping setup') +pyspLoc = os.path.abspath(os.path.join(os.path.dirname(__file__), 'contrib')) +if any(os.path.normcase(sp) == pyspLoc for sp in sys.path): + print(f'WARNING: "{pyspLoc}" already in system path. Skipping setup') else: - sys.path.append(os.path.join(pluginLoc, 'src', 'contrib')) + sys.path.append(pyspLoc) + #import PyomoModels from CapitalInvestments import PyomoModels from CapitalInvestments.investment_utils import inputReader