diff --git a/parsers/ERP_PGCB.py b/parsers/ERP_PGCB.py index 4e44a8315e..70a3709dc5 100644 --- a/parsers/ERP_PGCB.py +++ b/parsers/ERP_PGCB.py @@ -42,6 +42,7 @@ "Wind", "Bheramara HVDC", "Tripura", + "Adani", "Remarks", ] PARSER = "ERP_PGCB.py" @@ -99,7 +100,8 @@ def parse_table_body(table_body: Tag) -> list[dict]: "wind": table_entry_to_float(row_items[10]), "bd_import_bheramara": table_entry_to_float(row_items[11]), "bd_import_tripura": table_entry_to_float(row_items[12]), - "remarks": row_items[13], + "bd_import_adani": table_entry_to_float(row_items[13]), + "remarks": row_items[14], } ) @@ -197,13 +199,12 @@ def fetch_production( session = session or Session() row_data = query(session, target_datetime, logger) - production_data_list = ProductionBreakdownList(logger) for row in row_data: # Create data with empty production production = ProductionMix() - # And add sources if they are present in the table + # And add sources if they are present in the table z known_sources_sum_mw = 0.0 for source_type in ["coal", "gas", "hydro", "oil", "solar", "wind"]: if row[source_type] is not None: @@ -214,12 +215,18 @@ def fetch_production( # infer 'unknown' if row["total_generation"] is not None: # Total generation includes all sources, including imports so we need to subtract them to get the unknown source + # Before this date Adani import in NoneType + unknown_source_mw = ( row["total_generation"] - known_sources_sum_mw - row["bd_import_bheramara"] - row["bd_import_tripura"] ) + # Adani import was added after this date + if target_datetime is None or target_datetime > datetime(2024, 8, 27): + unknown_source_mw -= row["bd_import_adani"] + production.add_value( "unknown", unknown_source_mw, correct_negative_with_zero=True ) @@ -291,8 +298,12 @@ def fetch_exchange( # Export to India NorthEast via Tripura bd_import = row["bd_import_tripura"] elif zone_key2 == "IN-EA": - # Export to India East via Bheramara + # Export to India East via Bheramara and Adani (Jharkhand plant) bd_import = row["bd_import_bheramara"] + + if target_datetime is None or target_datetime > datetime(2024, 8, 27): + bd_import += row["bd_import_adani"] + else: raise ParserException( parser=PARSER, diff --git a/parsers/test/mocks/ERP_PGCB/latest.html b/parsers/test/mocks/ERP_PGCB/latest.html index 5479afebb5..ae9be5f124 100644 --- a/parsers/test/mocks/ERP_PGCB/latest.html +++ b/parsers/test/mocks/ERP_PGCB/latest.html @@ -8,16 +8,43 @@ - + + + + + + + + + + + + PGCB Website + + + + + + + + + + + + + + + + @@ -163,975 +190,1027 @@

Wind Bheramara HVDC Tripura + Adani Remarks - + - 19-12-2023 - 21:00:00 - 9373 - 9373 - - 0 - 4670 - 715 - 2871 - 107 - 0 - 4 - 912 - 94 + 06-09-2024 + 10:00:00 + 11023 + 11080 + + 54 + 4915 + 561 + 3042 + 93 + 469 + 0 + 885 + 43 + 1015 - + - 19-12-2023 - 20:00:00 - 9758 - 9758 - - 0 - 4538 - 1289 - 2899 - 107 - 0 - 3 - 816 - 106 + 06-09-2024 + 09:00:00 + 10638 + 10850 + + 202 + 4679 + 771 + 2802 + 92 + 362 + 1 + 885 + 38 + 1008 - + - 19-12-2023 - 19:30:00 - 9936 - 9936 - - 0 - 4572 - 1610 - 2910 - 107 - 0 - 2 - 629 - 106 + 06-09-2024 + 08:00:00 + 10798 + 11050 + + 241 + 4546 + 1044 + 2879 + 172 + 208 + 8 + 885 + 42 + 1014 - + - 19-12-2023 - 19:00:00 - 10016 - 10016 - - 0 - 4534 - 1682 - 2976 - 92 - 0 - 1 - 629 - 102 + 06-09-2024 + 07:00:00 + 10815 + 11100 + + 272 + 4439 + 1056 + 3104 + 171 + 90 + 14 + 886 + 36 + 1019 - + - 19-12-2023 - 18:00:00 - 10180 - 10180 - - 0 - 4502 - 1916 - 2906 - 92 - 0 - 3 - 655 - 106 - Evening Peak + 06-09-2024 + 06:00:00 + 11272 + 11650 + + 361 + 4676 + 1016 + 3422 + 210 + 5 + 12 + 884 + 20 + 1027 + - + - 19-12-2023 - 17:00:00 - 8769 - 8769 - - 0 - 3780 - 1290 - 2639 - 92 - 8 + 06-09-2024 + 05:00:00 + 12186 + 12650 + + 443 + 4840 + 1795 + 3400 + 210 0 - 862 - 92 + 6 + 885 + 36 + 1014 - + - 19-12-2023 - 16:00:00 - 8346 - 8346 - + 06-09-2024 + 04:00:00 + 12358 + 12850 + + 470 + 4839 + 1937 + 3401 + 210 0 - 4076 - 587 - 2551 - 92 - 79 3 - 862 - 96 + 885 + 62 + 1021 - + - 19-12-2023 - 15:00:00 - 8498 - 8498 - - 0 - 4083 - 482 - 2692 - 70 - 209 - 0 - 862 - 100 + 06-09-2024 + 03:00:00 + 12655 + 13800 + + 1093 + 4955 + 2102 + 3402 + 210 + 0 + 0 + 885 + 66 + 1035 - + - 19-12-2023 - 14:00:00 - 8812 - 8812 - + 06-09-2024 + 02:00:00 + 12779 + 14200 + + 1357 + 5003 + 2199 + 3399 + 212 0 - 4192 - 588 - 2673 - 92 - 302 0 - 863 - 102 + 884 + 68 + 1014 - + - 19-12-2023 - 13:00:00 - 9165 - 9165 - + 06-09-2024 + 01:00:00 + 12984 + 14650 + + 1591 + 5021 + 2385 + 3398 + 212 0 - 4625 - 466 - 2666 - 92 - 349 0 - 863 - 104 + 884 + 68 + 1016 - + - 19-12-2023 - 12:00:00 - 8790 - 8790 - + 05-09-2024 + 24:00:00 + 13196 + 15150 + + 1866 + 5013 + 2739 + 3442 + 212 0 - 4459 - 336 - 2567 - 92 - 366 - 2 - 866 - 102 - Day Peak - - - - - 19-12-2023 - 11:00:00 - 8459 - 8459 - 0 - 4118 - 291 - 2654 - 92 - 335 - 6 - 865 - 98 + 693 + 70 + 1027 - + - 19-12-2023 - 10:00:00 - 8272 - 8272 - + 05-09-2024 + 23:00:00 + 13424 + 15200 + + 1696 + 5035 + 2994 + 3405 + 212 0 - 4224 - 279 - 2679 - 92 - 277 - 1 - 630 - 90 + 0 + 693 + 72 + 1013 - + - 19-12-2023 - 09:00:00 - 8347 - 8347 - + 05-09-2024 + 22:00:00 + 13833 + 15250 + + 1353 + 5020 + 3377 + 3451 + 212 0 - 4445 - 236 - 2667 - 92 - 190 0 - 629 - 88 + 692 + 68 + 1013 - + - 19-12-2023 - 08:00:00 - 8013 - 8013 - + 05-09-2024 + 21:00:00 + 13976 + 15350 + + 1312 + 5023 + 3545 + 3425 + 214 0 - 4400 - 83 - 2623 - 92 - 85 - 4 - 642 - 84 - + 2 + 693 + 64 + 1010 + Evening Peak - + - 19-12-2023 - 07:00:00 - 7267 - 7267 - + 05-09-2024 + 20:00:00 + 13966 + 15300 + + 1274 + 4954 + 3595 + 3421 + 213 0 - 4149 0 - 2348 - 92 - 9 - 4 - 583 - 82 + 694 + 68 + 1021 - + - 19-12-2023 - 06:00:00 - 6765 - 6765 - - 0 - 3750 - 0 - 2256 - 92 - 0 - 8 - 583 - 76 + 05-09-2024 + 19:30:00 + 13868 + 15200 + + 1272 + 4771 + 3560 + 3350 + 213 + 0 + 0 + 884 + 66 + 1024 - + - 19-12-2023 - 05:00:00 - 6353 - 6353 - - 0 - 3359 + 05-09-2024 + 19:00:00 + 13303 + 15000 + + 1621 + 4741 + 3105 + 3277 + 213 0 - 2257 - 70 0 - 8 - 583 - 76 + 884 + 68 + 1015 - + - 19-12-2023 - 04:00:00 - 6367 - 6367 - - 0 - 3378 - 0 - 2254 - 70 - 0 + 05-09-2024 + 18:00:00 + 12554 + 13300 + + 712 + 4948 + 2196 + 3227 + 212 4 - 583 - 78 + 0 + 884 + 62 + 1021 - + - 19-12-2023 - 03:00:00 - 6624 - 6624 - - 0 - 3617 - 0 - 2269 - 70 - 0 - 7 - 583 - 78 + 05-09-2024 + 17:00:00 + 12536 + 13600 + + 1016 + 4921 + 2020 + 3345 + 212 + 75 + 3 + 885 + 64 + 1011 - + - 19-12-2023 - 02:00:00 - 6887 - 6887 - - 0 - 3870 - 0 - 2255 - 92 - 0 - 11 - 583 - 76 + 05-09-2024 + 16:00:00 + 12599 + 13800 + + 1147 + 4921 + 1895 + 3453 + 212 + 147 + 6 + 884 + 66 + 1015 - + - 19-12-2023 - 01:00:00 - 7267 - 7267 - - 0 - 4157 - 0 - 2327 - 92 - 0 - 6 - 605 - 80 + 05-09-2024 + 15:00:00 + 12526 + 13990 + + 1398 + 4958 + 1745 + 3421 + 212 + 216 + 0 + 884 + 62 + 1028 - + - 18-12-2023 - 24:00:00 - 7755 - 7755 - - 0 - 4307 - 0 - 2432 - 92 - 0 - 5 - 827 - 92 + 05-09-2024 + 14:00:00 + 12390 + 13800 + + 1347 + 4948 + 1731 + 3218 + 214 + 287 + 18 + 885 + 66 + 1023 - + - 18-12-2023 - 23:00:00 - 8232 - 8232 - - 0 - 4398 - 68 - 2663 - 92 - 0 - 3 - 912 - 96 + 05-09-2024 + 13:00:00 + 12247 + 13600 + + 1292 + 4941 + 1598 + 3155 + 214 + 299 + 12 + 885 + 64 + 1079 + + + 05-09-2024 + 12:00:00 + 12252 + 13300 + + 1001 + 4885 + 1419 + 3119 + 214 + 258 + 0 + 884 + 60 + 1413 + Day Peak + + - 18-12-2023 - 22:00:00 - 8825 - 8825 - - 0 - 4544 - 388 - 2783 - 92 - 0 - 3 - 911 - 104 + 05-09-2024 + 11:00:00 + 12219 + 13100 + + 841 + 4848 + 1466 + 3022 + 214 + 303 + 10 + 886 + 56 + 1414 - + - 18-12-2023 - 21:00:00 - 9346 - 9346 - - 0 - 4636 - 814 - 2792 - 92 - 0 - 0 - 912 - 100 + 05-09-2024 + 10:00:00 + 11987 + 12750 + + 729 + 4843 + 1434 + 2986 + 214 + 232 + 0 + 885 + 56 + 1337 - + - 18-12-2023 - 20:00:00 - 9616 - 9616 - - 0 - 4653 - 1139 - 2812 - 92 - 0 - 0 - 818 - 102 + 05-09-2024 + 09:00:00 + 11873 + 12450 + + 551 + 4781 + 1417 + 3067 + 214 + 141 + 0 + 885 + 58 + 1310 - + - 18-12-2023 - 19:30:00 - 9639 - 9639 - - 0 - 4715 - 1257 - 2847 - 92 - 0 - 0 - 628 - 100 + 05-09-2024 + 08:00:00 + 11990 + 12450 + + 439 + 4596 + 1731 + 3048 + 214 + 129 + 0 + 884 + 58 + 1330 - + - 18-12-2023 - 19:00:00 - 9874 - 9874 - - 0 - 4581 - 1567 - 2916 - 92 - 0 - 0 - 628 - 90 + 05-09-2024 + 07:00:00 + 12196 + 12700 + + 481 + 4796 + 1741 + 3081 + 213 + 87 + 2 + 885 + 64 + 1327 - + - 18-12-2023 - 18:00:00 - 10111 - 10111 - - 0 - 4583 - 1559 - 3009 - 92 - 0 - 0 - 776 - 92 - Evening Peak + 05-09-2024 + 06:00:00 + 12146 + 12650 + + 481 + 4852 + 1773 + 3037 + 212 + 10 + 1 + 885 + 62 + 1314 + - + - 18-12-2023 - 17:00:00 - 8570 - 8570 - - 0 - 3858 - 1079 - 2574 - 92 - 7 + 05-09-2024 + 05:00:00 + 12492 + 13200 + + 676 + 4806 + 2059 + 3132 + 212 0 - 864 - 96 + 4 + 884 + 68 + 1327 - + - 18-12-2023 - 16:00:00 - 8318 - 8318 - - 0 - 4081 - 867 - 2255 - 92 - 60 + 05-09-2024 + 04:00:00 + 12679 + 13800 + + 1071 + 4873 + 2180 + 3134 + 211 0 - 865 - 98 + 2 + 883 + 68 + 1328 - + - 18-12-2023 - 15:00:00 - 8432 - 8432 - + 05-09-2024 + 03:00:00 + 12759 + 14100 + + 1281 + 4862 + 2197 + 3121 + 211 0 - 3866 - 945 - 2390 - 92 - 184 0 - 865 - 90 + 884 + 68 + 1416 - + - 18-12-2023 - 14:00:00 - 8895 - 8895 - + 05-09-2024 + 02:00:00 + 12822 + 14400 + + 1507 + 4950 + 2204 + 3261 + 212 0 - 4297 - 1144 - 2175 - 92 - 230 0 - 865 - 92 + 695 + 70 + 1430 - + - 18-12-2023 - 13:00:00 - 9200 - 9200 - + 05-09-2024 + 01:00:00 + 12889 + 14600 + + 1634 + 4969 + 2255 + 3259 + 213 0 - 4348 - 1077 - 2414 - 92 - 309 0 - 864 - 96 + 694 + 74 + 1425 - + - 18-12-2023 - 12:00:00 - 8756 - 8756 - + 04-09-2024 + 24:00:00 + 13448 + 15000 + + 1482 + 4872 + 2702 + 3412 + 216 0 - 4328 - 744 - 2261 - 92 - 364 0 - 865 - 102 - Day Peak + 694 + 74 + 1478 + - + - 18-12-2023 - 11:00:00 - 8550 - 8550 - + 04-09-2024 + 23:00:00 + 13676 + 15100 + + 1360 + 4672 + 3094 + 3417 + 216 0 - 4270 - 374 - 2512 - 92 - 341 0 - 865 - 96 + 694 + 68 + 1515 - + - 18-12-2023 - 10:00:00 - 8059 - 8059 - - 0 - 4046 - 292 - 2420 - 92 - 286 - 0 - 829 - 94 + 04-09-2024 + 22:00:00 + 13720 + 15100 + + 1318 + 4556 + 3270 + 3408 + 216 + 0 + 0 + 694 + 64 + 1512 - + - 18-12-2023 - 09:00:00 - 8176 - 8176 - + 04-09-2024 + 21:00:00 + 14107 + 15350 + + 1187 + 4595 + 3629 + 3390 + 214 0 - 4476 - 137 - 2561 - 92 - 191 0 - 629 - 90 - + 694 + 70 + 1515 + Evening Peak - + - 18-12-2023 - 08:00:00 - 8756 - 8756 - - 0 - 4495 - 61 - 2330 - 92 - 80 - 1 - 769 - 80 + 04-09-2024 + 20:00:00 + 13887 + 15100 + + 1158 + 4463 + 3615 + 3315 + 214 + 0 + 0 + 694 + 64 + 1522 - + - 18-12-2023 - 07:00:00 - 7092 - 7092 - - 0 - 4345 - 3 - 2083 - 92 - 9 - 4 - 488 - 68 + 04-09-2024 + 19:30:00 + 13699 + 14900 + + 1147 + 4259 + 3527 + 3327 + 214 + 0 + 0 + 805 + 62 + 1505 - + - 18-12-2023 - 06:00:00 - 6509 - 6509 - - 0 - 3887 - 0 - 1881 - 92 - 0 - 6 - 573 - 70 + 04-09-2024 + 19:00:00 + 13587 + 14700 + + 1063 + 4423 + 3164 + 3319 + 214 + 0 + 0 + 888 + 64 + 1515 - + - 18-12-2023 - 05:00:00 - 6274 - 6274 - - 0 - 3654 - 0 - 1875 - 92 + 04-09-2024 + 18:00:00 + 12574 + 13100 + + 502 + 4484 + 2312 + 3087 + 214 + 7 0 - 6 - 573 - 74 + 887 + 66 + 1517 - + - 18-12-2023 - 04:00:00 - 6339 - 6339 - - 0 - 3656 - 0 - 1932 - 92 + 04-09-2024 + 17:00:00 + 12631 + 13350 + + 687 + 4645 + 2003 + 3222 + 214 + 78 0 - 10 - 573 - 76 + 887 + 70 + 1512 - + - 18-12-2023 - 03:00:00 - 6490 - 6490 - - 0 - 3729 - 0 - 2001 - 92 - 0 - 14 - 582 - 72 + 04-09-2024 + 16:00:00 + 12741 + 13750 + + 964 + 4758 + 1809 + 3317 + 215 + 181 + 3 + 887 + 56 + 1515 - + - 18-12-2023 - 02:00:00 - 6752 - 6752 - - 0 - 4018 - 0 - 1971 - 92 - 0 - 13 - 582 - 76 + 04-09-2024 + 15:00:00 + 12735 + 13870 + + 1084 + 4838 + 1642 + 3308 + 215 + 280 + 9 + 888 + 64 + 1491 - + - 18-12-2023 - 01:00:00 - 7159 - 7159 - - 0 - 4319 - 0 - 2073 - 92 - 0 - 15 - 582 - 78 + 04-09-2024 + 14:00:00 + 12933 + 13800 + + 828 + 4981 + 1599 + 3338 + 216 + 409 + 23 + 885 + 66 + 1416 - + - 17-12-2023 - 24:00:00 - 7683 - 7683 - - 0 - 4640 - 0 - 2139 - 92 - 0 - 5 - 725 - 82 + 04-09-2024 + 13:00:00 + 12978 + 13900 + + 881 + 5145 + 1484 + 3306 + 216 + 444 + 15 + 888 + 66 + 1414 - + - 17-12-2023 - 23:00:00 - 8190 - 8190 - - 0 - 4777 - 98 - 2219 - 92 - 0 - 3 - 911 - 90 - + 04-09-2024 + 12:00:00 + 12911 + 13800 + + 849 + 5122 + 1344 + 3244 + 210 + 520 + 10 + 887 + 60 + 1514 + Day Peak - + - 17-12-2023 - 22:00:00 - 8736 - 8736 - - 0 - 4681 - 448 - 2508 - 92 - 0 - 6 - 911 - 90 + 04-09-2024 + 11:00:00 + 12575 + 13200 + + 597 + 4873 + 1272 + 3233 + 216 + 511 + 2 + 888 + 58 + 1522 - + - 17-12-2023 - 21:00:00 - 9116 - 9116 - - 0 - 4757 - 696 - 2464 - 92 - 0 - 1 - 910 - 96 + 04-09-2024 + 10:00:00 + 12301 + 12850 + + 524 + 5010 + 1080 + 3280 + 214 + 410 + 0 + 888 + 54 + 1365 @@ -1151,7 +1230,7 @@

d="M15 6l-6 6l6 6"/> - +
  • 1
  • 2
  • 3
  • @@ -1163,8 +1242,8 @@

  • 9
  • 10
  • ...
  • -
  • 1549
  • -
  • 1550
  • +
  • 1677
  • +
  • 1678