|
7 | 7 | import random |
8 | 8 | import ssl |
9 | 9 | import string |
10 | | -from datetime import datetime, timezone, timedelta |
| 10 | +from datetime import datetime |
11 | 11 | from http import HTTPStatus |
12 | 12 | from unittest import mock |
13 | 13 |
|
@@ -769,6 +769,10 @@ def hosting_capacity_run_calibration_with_calibration_time_request_handler(reque |
769 | 769 | 'pFactorForecastPv': None, |
770 | 770 | 'seed': None, |
771 | 771 | 'simplifyNetwork': None, |
| 772 | + 'useSpanLevelThreshold': False, |
| 773 | + 'ratingThreshold': None, |
| 774 | + 'simplifyPLSIThreshold': None, |
| 775 | + 'emergAmpScaling': None, |
772 | 776 | 'splitPhaseDefaultLoadLossPercentage': None, |
773 | 777 | 'splitPhaseLVKV': None, |
774 | 778 | 'swerVoltageToLineVoltage': None, |
@@ -872,6 +876,10 @@ def hosting_capacity_run_calibration_with_generator_config_request_handler(reque |
872 | 876 | 'pFactorForecastPv': None, |
873 | 877 | 'seed': None, |
874 | 878 | 'simplifyNetwork': None, |
| 879 | + 'useSpanLevelThreshold': False, |
| 880 | + 'ratingThreshold': None, |
| 881 | + 'simplifyPLSIThreshold': None, |
| 882 | + 'emergAmpScaling': None, |
875 | 883 | 'splitPhaseDefaultLoadLossPercentage': None, |
876 | 884 | 'splitPhaseLVKV': None, |
877 | 885 | 'swerVoltageToLineVoltage': None, |
@@ -969,6 +977,10 @@ def hosting_capacity_run_calibration_with_partial_model_config_request_handler(r |
969 | 977 | 'pFactorForecastPv': None, |
970 | 978 | 'seed': None, |
971 | 979 | 'simplifyNetwork': None, |
| 980 | + 'useSpanLevelThreshold': False, |
| 981 | + 'ratingThreshold': None, |
| 982 | + 'simplifyPLSIThreshold': None, |
| 983 | + 'emergAmpScaling': None, |
972 | 984 | 'splitPhaseDefaultLoadLossPercentage': None, |
973 | 985 | 'splitPhaseLVKV': None, |
974 | 986 | 'swerVoltageToLineVoltage': None, |
@@ -1023,6 +1035,7 @@ def test_run_hosting_capacity_calibration_with_explicit_transformer_tap_settings |
1023 | 1035 | httpserver.check_assertions() |
1024 | 1036 | assert res == {"result": "success"} |
1025 | 1037 |
|
| 1038 | + |
1026 | 1039 | def get_hosting_capacity_calibration_sets_request_handler(request): |
1027 | 1040 | actual_body = json.loads(request.data.decode()) |
1028 | 1041 | query = " ".join(actual_body['query'].split()) |
@@ -1152,7 +1165,11 @@ def run_opendss_export_request_handler(request): |
1152 | 1165 | "defaultLoadVar": [10.0, 20.0, 30.0], |
1153 | 1166 | "defaultGenVar": [5.0, 15.0, 25.0], |
1154 | 1167 | "transformerTapSettings": "tap-3", |
1155 | | - "ctPrimScalingFactor": 2.0 |
| 1168 | + "ctPrimScalingFactor": 2.0, |
| 1169 | + "useSpanLevelThreshold": True, |
| 1170 | + "ratingThreshold": 20.0, |
| 1171 | + "simplifyPLSIThreshold": 20.0, |
| 1172 | + "emergAmpScaling": 1.8 |
1156 | 1173 | }, |
1157 | 1174 | "solve": { |
1158 | 1175 | "normVMinPu": 0.9, |
@@ -1261,7 +1278,11 @@ def run_opendss_export_request_handler(request): |
1261 | 1278 | default_load_var=[10.0, 20.0, 30.0], |
1262 | 1279 | default_gen_var=[5.0, 15.0, 25.0], |
1263 | 1280 | transformer_tap_settings="tap-3", |
1264 | | - ct_prim_scaling_factor=2.0 |
| 1281 | + ct_prim_scaling_factor=2.0, |
| 1282 | + use_span_level_threshold=True, |
| 1283 | + rating_threshold=20.0, |
| 1284 | + simplify_plsi_threshold=20.0, |
| 1285 | + emerg_amp_scaling= 1.8 |
1265 | 1286 | ), |
1266 | 1287 | SolveConfig( |
1267 | 1288 | norm_vmin_pu=0.9, |
@@ -1333,8 +1354,7 @@ def test_run_opendss_export_valid_certificate_success(ca: trustme.CA, httpserver |
1333 | 1354 | ) |
1334 | 1355 |
|
1335 | 1356 | OPENDSS_CONFIG.load_time = FixedTime(datetime(2022, 4, 1), {"meter1": FixedTimeLoadOverride([1.0], [2.0], [3.0], [4.0])}) |
1336 | | - httpserver.expect_oneshot_request("/api/graphql").respond_with_handler( |
1337 | | - run_opendss_export_request_handler) |
| 1357 | + httpserver.expect_oneshot_request("/api/graphql").respond_with_handler(run_opendss_export_request_handler) |
1338 | 1358 | res = eas_client.run_opendss_export(OPENDSS_CONFIG) |
1339 | 1359 | httpserver.check_assertions() |
1340 | 1360 | assert res == {"result": "success"} |
@@ -1440,6 +1460,10 @@ def test_run_opendss_export_valid_certificate_success(ca: trustme.CA, httpserver |
1440 | 1460 | defaultGenVar |
1441 | 1461 | transformerTapSettings |
1442 | 1462 | ctPrimScalingFactor |
| 1463 | + useSpanLevelThreshold |
| 1464 | + ratingThreshold |
| 1465 | + simplifyPLSIThreshold |
| 1466 | + emergAmpScaling |
1443 | 1467 | } |
1444 | 1468 | solve { |
1445 | 1469 | normVMinPu |
|
0 commit comments