|
| 1 | +# Copyright 2025 Zeppelin Bend Pty Ltd |
| 2 | +# |
| 3 | +# This Source Code Form is subject to the terms of the Mozilla Public |
| 4 | +# License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 | +# file, You can obtain one at https://mozilla.org/MPL/2.0/. |
| 6 | +import asyncio |
| 7 | +import sys |
| 8 | + |
| 9 | +from zepben.eas.client.feeder_load_analysis_input import FeederLoadAnalysisInput |
| 10 | +from zepben.eas.client.fla_forecast_config import FlaForecastConfig |
| 11 | + |
| 12 | +from zepben.examples.utils import get_config_dir, get_client |
| 13 | + |
| 14 | + |
| 15 | +async def main(argv): |
| 16 | + # See connecting_to_grpc_service.py for examples of each connect function |
| 17 | + config_dir = get_config_dir(argv) |
| 18 | + print("Connecting to EAS..") |
| 19 | + eas_client = get_client(config_dir) |
| 20 | + print("Connection established..") |
| 21 | + # Fire off a feeder load analysis study |
| 22 | + feeder_load_analysis_token = await eas_client.async_run_feeder_load_analysis_report( |
| 23 | + FeederLoadAnalysisInput( |
| 24 | + feeders=["feeder1", "feeder2"], |
| 25 | + start_date="2022-04-01", |
| 26 | + end_date="2022-12-31", |
| 27 | + fetch_lv_network=True, |
| 28 | + process_feeder_loads=True, |
| 29 | + process_coincident_loads=True, |
| 30 | + aggregate_at_feeder_level=False, |
| 31 | + output="Test", |
| 32 | + fla_forecast_config=FlaForecastConfig( |
| 33 | + scenario_id='1', |
| 34 | + year=2029, |
| 35 | + pv_upgrade_threshold=6500, ##Premise with existing PV will gain additional PV until the threshold wattage is reached. |
| 36 | + bess_upgrade_threshold=6500, ##Premise with existing battery will gain additional battery until the threshold wattage is reached. |
| 37 | + seed=12345 ##Seed can be set to keep modification of forecast network consistent between studies. |
| 38 | + ) |
| 39 | + ) |
| 40 | + ) |
| 41 | + |
| 42 | + print(f"Feeder Load Analysis study: {feeder_load_analysis_token['data']['runFeederLoadAnalysis']}") |
| 43 | + |
| 44 | + # Feeder Load Analysis Study results can be retrieved from back end storage set up with EAS. |
| 45 | + |
| 46 | + await eas_client.aclose() |
| 47 | + |
| 48 | + |
| 49 | +if __name__ == "__main__": |
| 50 | + loop = asyncio.get_event_loop() |
| 51 | + loop.run_until_complete(main(sys.argv)) |
0 commit comments