Skip to content

Commit ff9f4b4

Browse files
Use rsplit, so last FORCE is found, instead of first.
1 parent 86f1d47 commit ff9f4b4

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

tests/integration_tests/Aspen_HERON_FullTest/aspen_to_heron.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
import argparse
2525

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

7777
print (f" \n The new HERON file is updated/created at: '{output_file}' ")
78-
print("\n",'\033[95m',"Step4 (Component Sets are loaded to the HERON input XMl file) is complete", '\033[0m', "\n")
78+
print("\n",'\033[95m',"Step4 (Component Sets are loaded to the HERON input XMl file) is complete", '\033[0m', "\n")

tests/integration_tests/HERON_update_withCompSets/force_component_sets_to_heron.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
import argparse
1818

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

tests/integration_tests/create_APEA_Comps/create_apea_components.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import sys
1414
import os
1515
import argparse
16-
sys.path.append(os.path.dirname(__file__).split("FORCE")[:-1][0]+"FORCE/src")
16+
sys.path.append(os.path.dirname(__file__).rsplit("FORCE",maxsplit=1)[:-1][0]+"FORCE/src")
1717
from apea import extract_all_apea_components
1818

1919
# # Specifying terminal command arguments
@@ -25,4 +25,4 @@
2525
parser.add_argument("apea_xlsx_outputs_folder_path", help="apea_xlsx_outputs_folder_path")
2626
args = parser.parse_args()
2727

28-
extract_all_apea_components(args.apea_xlsx_outputs_folder_path)
28+
extract_all_apea_components(args.apea_xlsx_outputs_folder_path)

tests/integration_tests/create_FORCE_CompSets/create_force_componentSets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
import argparse
2323

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

5353
print("\n",'\033[95m', "Step3 (creating FORCE components Sets) begins", '\033[0m', "\n")
5454
extract_all_force_componentsets(args.componentSets_folder, FORCE_comps_list)
55-
print("\n",'\033[95m', "Step3 (creating FORCE componentsSets) is complete", '\033[0m', "\n")
55+
print("\n",'\033[95m', "Step3 (creating FORCE componentsSets) is complete", '\033[0m', "\n")

tests/integration_tests/create_FORCE_Comps/create_force_components.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import argparse
2020

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

4343
print("\n",'\033[95m', "Step2 (creating HYSES and APEA FORCE components) begins", '\033[0m', "\n")
4444
FORCE_comps_list = create_all_force_components_from_hysys_apea( [hysys_comps_list, apea_comps_list ], args.hyses_xlsx_outputs_folder_path)[0]
45-
print("\n",'\033[95m', "Step2 (creating HYSES and APEA FORCE components) is complete", '\033[0m', "\n")
45+
print("\n",'\033[95m', "Step2 (creating HYSES and APEA FORCE components) is complete", '\033[0m', "\n")

tests/integration_tests/create_HYSYS_Comps/create_hysys_components.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import argparse
1616

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

2121

@@ -28,4 +28,4 @@
2828
parser.add_argument("hyses_xlsx_outputs_folder_path", help="hyses_xlsx_outputs_folder_path")
2929
args = parser.parse_args()
3030

31-
extract_all_hysys_components(args.hyses_xlsx_outputs_folder_path)
31+
extract_all_hysys_components(args.hyses_xlsx_outputs_folder_path)

0 commit comments

Comments
 (0)