Skip to content

Commit

Permalink
Use rsplit, so last FORCE is found, instead of first.
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-cogliati-inl committed Apr 29, 2024
1 parent 86f1d47 commit ff9f4b4
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import argparse

# import from the vertical_inegration/src
sys.path.insert(1, os.path.dirname(__file__).split("FORCE")[:-1][0]+"FORCE/src")
sys.path.insert(1, os.path.dirname(__file__).rsplit("FORCE",maxsplit=1)[:-1][0]+"FORCE/src")
import convert_utils as xm
from hysys import extract_all_hysys_components
from apea import extract_all_apea_components
Expand Down Expand Up @@ -75,4 +75,4 @@
print((xm.prettify(new_HERON_tree )), file=out)

print (f" \n The new HERON file is updated/created at: '{output_file}' ")
print("\n",'\033[95m',"Step4 (Component Sets are loaded to the HERON input XMl file) is complete", '\033[0m', "\n")
print("\n",'\033[95m',"Step4 (Component Sets are loaded to the HERON input XMl file) is complete", '\033[0m', "\n")
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import argparse

# import from the vertical_inegration/src
sys.path.append(os.path.dirname(__file__).split("FORCE")[:-1][0]+"/FORCE/src")
sys.path.append(os.path.dirname(__file__).rsplit("FORCE",maxsplit=1)[:-1][0]+"/FORCE/src")
from heron import create_componentsets_in_HERON
import convert_utils as xm

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import sys
import os
import argparse
sys.path.append(os.path.dirname(__file__).split("FORCE")[:-1][0]+"FORCE/src")
sys.path.append(os.path.dirname(__file__).rsplit("FORCE",maxsplit=1)[:-1][0]+"FORCE/src")
from apea import extract_all_apea_components

# # Specifying terminal command arguments
Expand All @@ -25,4 +25,4 @@
parser.add_argument("apea_xlsx_outputs_folder_path", help="apea_xlsx_outputs_folder_path")
args = parser.parse_args()

extract_all_apea_components(args.apea_xlsx_outputs_folder_path)
extract_all_apea_components(args.apea_xlsx_outputs_folder_path)
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import argparse

# import from the vertical_inegration/src
sys.path.insert(1, os.path.dirname(__file__).split("FORCE")[:-1][0]+"FORCE/src")
sys.path.insert(1, os.path.dirname(__file__).rsplit("FORCE",maxsplit=2)[:-1][0]+"FORCE/src")
from hysys import extract_all_hysys_components
from apea import extract_all_apea_components
from force import create_all_force_components_from_hysys_apea, extract_all_force_componentsets
Expand Down Expand Up @@ -52,4 +52,4 @@

print("\n",'\033[95m', "Step3 (creating FORCE components Sets) begins", '\033[0m', "\n")
extract_all_force_componentsets(args.componentSets_folder, FORCE_comps_list)
print("\n",'\033[95m', "Step3 (creating FORCE componentsSets) is complete", '\033[0m', "\n")
print("\n",'\033[95m', "Step3 (creating FORCE componentsSets) is complete", '\033[0m', "\n")
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
import argparse

# import from the vertical_inegration/src
sys.path.insert(1, os.path.dirname(__file__).split("FORCE")[:-1][0]+"FORCE/src")
sys.path.insert(1, os.path.dirname(__file__).rsplit("FORCE",maxsplit=2)[:-1][0]+"FORCE/src")
from hysys import extract_all_hysys_components
from apea import extract_all_apea_components
from force import create_all_force_components_from_hysys_apea
Expand All @@ -42,4 +42,4 @@

print("\n",'\033[95m', "Step2 (creating HYSES and APEA FORCE components) begins", '\033[0m', "\n")
FORCE_comps_list = create_all_force_components_from_hysys_apea( [hysys_comps_list, apea_comps_list ], args.hyses_xlsx_outputs_folder_path)[0]
print("\n",'\033[95m', "Step2 (creating HYSES and APEA FORCE components) is complete", '\033[0m', "\n")
print("\n",'\033[95m', "Step2 (creating HYSES and APEA FORCE components) is complete", '\033[0m', "\n")
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
import argparse

# import from the vertical_inegration/src
sys.path.append(os.path.dirname(__file__).split("FORCE")[:-1][0]+"FORCE/src")
sys.path.append(os.path.dirname(__file__).rsplit("FORCE",maxsplit=1)[:-1][0]+"FORCE/src")
from hysys import extract_all_hysys_components


Expand All @@ -28,4 +28,4 @@
parser.add_argument("hyses_xlsx_outputs_folder_path", help="hyses_xlsx_outputs_folder_path")
args = parser.parse_args()

extract_all_hysys_components(args.hyses_xlsx_outputs_folder_path)
extract_all_hysys_components(args.hyses_xlsx_outputs_folder_path)

0 comments on commit ff9f4b4

Please sign in to comment.