Example #1
0
def run_with_base_class():
    client = IncoreClient(pyglobals.INCORE_API_DEV_URL)
    epf_rest = EpfRestoration(client)
    restorationsvc = RestorationService(client)
    mapping_set = MappingSet(
        restorationsvc.get_mapping(
            "61f302e6e3a03e465500b3eb"))  # new format of mapping
    epf_rest.load_remote_input_dataset('epfs', '6189c103d5b02930aa3efc35')
    epf_rest.set_input_dataset('dfr3_mapping_set', mapping_set)
    epf_rest.set_parameter("result_name", "epf_restoration.csv")
    epf_rest.set_parameter("restoration_key", "Restoration ID Code")
    epf_rest.set_parameter("end_time", 100.0)
    epf_rest.set_parameter("time_interval", 1.0)
    epf_rest.set_parameter("pf_interval", 0.01)

    epf_rest.run_analysis()

    # test utility function
    epf_rest_util = EpfRestorationUtil(epf_rest)
    functionality = epf_rest_util.get_percentage_func(
        guid="60748fbd-67c3-4f8d-beb9-26685a53d3c5",
        damage_state="DS_0",
        time=2.0)
    time = epf_rest_util.get_restoration_time(
        guid="60748fbd-67c3-4f8d-beb9-26685a53d3c5",
        damage_state="DS_1",
        pf=0.81)
    print(functionality, time)
def run_with_base_class():
    client = IncoreClient(pyglobals.INCORE_API_DEV_URL)
    client.clear_cache()
    pipeline_restoration = PipelineRestoration(client)

    # shelby county pipelines
    pipeline_restoration.load_remote_input_dataset("pipeline",
                                                   "5a284f28c7d30d13bc081d14")
    pipeline_restoration.load_remote_input_dataset("pipeline_damage",
                                                   "61f36023c53b3620b6b614c6")

    # Load fragility mapping
    restoration_service = RestorationService(client)
    mapping_set = MappingSet(
        restoration_service.get_mapping("61f35f09903e515036cee106"))
    pipeline_restoration.set_input_dataset('dfr3_mapping_set', mapping_set)

    pipeline_restoration.set_parameter("result_name",
                                       "pipeline_restoration_times")

    pipeline_restoration.set_parameter("restoration_key",
                                       "Restoration ID Code")
    pipeline_restoration.set_parameter("num_available_workers", 4)
    pipeline_restoration.set_parameter("num_cpu", 4)

    # Run pipeline restoration analysis
    pipeline_restoration.run_analysis()
Example #3
0
def run_with_base_class():
    client = IncoreClient(pyglobals.INCORE_API_DEV_URL)
    wf_rest = WaterFacilityRestoration(client)

    # Load restoration mapping
    restorationsvc = RestorationService(client)
    mapping_set = MappingSet(
        restorationsvc.get_mapping(
            "61f075ee903e515036cee0a5"))  # new format of mapping
    wf_rest.load_remote_input_dataset(
        "water_facilities", "5a284f2ac7d30d13bc081e52")  # water facility
    wf_rest.set_input_dataset('dfr3_mapping_set', mapping_set)
    wf_rest.set_parameter("result_name", "wf_restoration")
    wf_rest.set_parameter("restoration_key", "Restoration ID Code")
    wf_rest.set_parameter("end_time", 100.0)
    wf_rest.set_parameter("time_interval", 1.0)
    wf_rest.set_parameter("pf_interval", 0.05)

    wf_rest.run_analysis()

    # test utility function
    wf_util = WaterFacilityRestorationUtil(wf_rest)
    functionality = wf_util.get_percentage_func(
        guid="e1bce78d-00a1-4605-95f3-3776ff907f73",
        damage_state="DS_0",
        time=2.0)
    time = wf_util.get_restoration_time(
        guid="e1bce78d-00a1-4605-95f3-3776ff907f73",
        damage_state="DS_1",
        pf=0.81)
    print(functionality, time)
Example #4
0
def run_with_base_class():
    client = IncoreClient(pyglobals.INCORE_API_DEV_URL)
    epf_rest = ElectricPowerFacilityRestoration(client)
    restorationsvc = RestorationService(client)
    mapping_set = MappingSet(
        restorationsvc.get_mapping(
            "61f302e6e3a03e465500b3eb"))  # new format of mapping
    epf_rest.set_input_dataset('dfr3_mapping_set', mapping_set)
    epf_rest.set_parameter("result_name", "epf_restoration.csv")
    epf_rest.set_parameter("restoration_key", "Restoration ID Code")
    epf_rest.set_parameter("end_time", 100.0)
    epf_rest.set_parameter("time_interval", 1.0)
    epf_rest.set_parameter("pf_interval", 0.01)

    epf_rest.run_analysis()
Example #5
0
def run_with_base_class():
    client = IncoreClient(pyglobals.INCORE_API_DEV_URL)
    wf_rest = WaterFacilityRestoration(client)

    # Load restoration mapping
    restorationsvc = RestorationService(client)
    mapping_set = MappingSet(
        restorationsvc.get_mapping(
            "61f075ee903e515036cee0a5"))  # new format of mapping
    wf_rest.set_input_dataset('dfr3_mapping_set', mapping_set)
    wf_rest.set_parameter("result_name", "wf_restoration")
    wf_rest.set_parameter("restoration_key", "Restoration ID Code")
    wf_rest.set_parameter("end_time", 100.0)
    wf_rest.set_parameter("time_interval", 1.0)
    wf_rest.set_parameter("pf_interval", 0.05)

    wf_rest.run_analysis()