pvrpm.core.modules package

Submodules

pvrpm.core.modules.failure module

class pvrpm.core.modules.failure.Failure(level: str, comp_level_df: DataFrame, case: SamCase, indep_monitoring: IndepMonitor | None = None)[source]

Bases: ABC

This abstract class defines how a failure should be set up

__init__(level: str, comp_level_df: DataFrame, case: SamCase, indep_monitoring: IndepMonitor | None = None)[source]

Initalizes a failure instance

Parameters:
  • level (str) – The component level this failure is apart of

  • comp_level_df (pd.DataFrame) – The component level dataframe containing the simulation data

  • case (SamCase) – The SAM case for this simulation

  • indep_monitoring (IndepMonitoring, Optional) – For updating static monitoring during simulation

abstract initialize_components()[source]

Initalizes failure data for all components to be tracked during simulation for this failure type

Note

Updates the underlying dataframes in place

abstract reinitialize_components(df: DataFrame) DataFrame[source]

Reinitalize components in a dataframe similiar to the inital initalization. Used for when repairs or other things may occur

Parameters:

df (pd.DataFrame) – The dataframe containing the components to reinitalize

Returns:

The reinitalized components

Return type:

pd.DataFrame

abstract update(day: int)[source]

Perform a failure update for one day in the simulation:

Changes state of a component to failed, incrementing failures and checking warranty only for failed components of each failure type

Parameters:

day (int) – Current day in the simulation

Note

Updates the underlying dataframes in place

class pvrpm.core.modules.failure.PartialFailure(level: str, comp_level_df: DataFrame, case: SamCase, mode: str, indep_monitoring: IndepMonitor | None = None)[source]

Bases: Failure

Specifies a decrease in the state of a component via a failure

Unlike total failures, every defined partial failure will have its own object, instead of manaing all of them at once

__init__(level: str, comp_level_df: DataFrame, case: SamCase, mode: str, indep_monitoring: IndepMonitor | None = None)[source]

Initalizes a partial failure instance

Parameters:
  • level (str) – The component level this failure is apart of

  • comp_level_df (pd.DataFrame) – The component level dataframe containing the simulation data

  • case (SamCase) – The SAM case for this simulation

  • mode (str) – The name of the partial failure mode

  • indep_monitoring (IndepMonitoring, Optional) – For updating static monitoring during simulation

initialize_components()[source]

Initalizes failure data for all components to be tracked during simulation for this failure type

Note

Updates the underlying dataframes in place

reinitialize_components(df: DataFrame) DataFrame[source]

Reinitalize components in a dataframe similiar to the inital initalization. Used for when repairs or other things may occur

Parameters:

df (pd.DataFrame) – The dataframe containing the components to reinitalize

Returns:

The reinitalized components

Return type:

pd.DataFrame

update(day: int)[source]

Perform a failure update for one day in the simulation:

Changes state of a component to failed, incrementing failures and checking warranty only for failed components of each failure type

Parameters:

day (int) – Current day in the simulation

Note

Updates the underlying dataframes in place

class pvrpm.core.modules.failure.TotalFailure(level: str, comp_level_df: DataFrame, case: SamCase, indep_monitoring: IndepMonitor | None = None)[source]

Bases: Failure

Describes how a total failure of a component should operate

initialize_components()[source]

Initalizes failure data for all components to be tracked during simulation for this failure type

Note

Updates the underlying dataframes in place

reinitialize_components(df: DataFrame) DataFrame[source]

Reinitalize components in a dataframe similiar to the inital initalization. Used for when repairs or other things may occur

Parameters:

df (pd.DataFrame) – The dataframe containing the components to reinitalize

Returns:

The reinitalized components

Return type:

pd.DataFrame

update(day: int)[source]

Perform a failure update for one day in the simulation:

Changes state of a component to failed, incrementing failures and checking warranty only for failed components of each failure type

Parameters:

day (int) – Current day in the simulation

Note

Updates the underlying dataframes in place

pvrpm.core.modules.monitor module

class pvrpm.core.modules.monitor.CrossLevelMonitor(level: str, comp_level_df: DataFrame, case: SamCase)[source]

Bases: Monitor

Defines monitoring across different levels

__init__(level: str, comp_level_df: DataFrame, case: SamCase)[source]

Initalizes a cross level monitoring instance

Parameters:
  • level (str) – The component level this monitoring is apart of

  • comp_level_df (pd.DataFrame) – The component level dataframe containing the simulation data

  • case (SamCase) – The SAM case for this simulation

initialize_components()[source]

Initalizes monitoring data for all components to be tracked during simulation for this monitor type

Note

Updates the underlying dataframes in place

reinitialize_components(df: DataFrame) DataFrame[source]

Reinitalize components in a dataframe similiar to the inital initalization. Used for when repairs or other things may occur

Parameters:

df (pd.DataFrame) – The dataframe containing the components to reinitalize

Returns:

The reinitalized components

Return type:

pd.DataFrame

update(day: int)[source]

Perform a monitoring update for one day in the simulation:

Modifies time to detection for components

Parameters:

day (int) – Current day in the simulation

Note

Updates the underlying dataframes in place

update_bins(df: DataFrame)[source]
class pvrpm.core.modules.monitor.IndepMonitor(case: SamCase, comps: dict, costs: dict, dc_availability: array)[source]

Bases: Monitor

Defines independent monitoring that is component level independent

__init__(case: SamCase, comps: dict, costs: dict, dc_availability: array)[source]

Initalizes an independent monitoring instance

Parameters:
  • case (SamCase) – The SAM case for this simulation

  • comps (dict) – The dataframes for each component level that tracks information during the simulation

  • costs (dict) – The dictionary for costs accrued for each component level

  • dc_availability (np.array) – The dc availability for every day in the simulation

initialize_components()[source]

Initalizes monitoring data for all components to be tracked during simulation for this monitor type

Note

Updates the underlying dataframes in place

reinitialize_components(df: DataFrame) DataFrame[source]

Reinitalize components in a dataframe similiar to the inital initalization. Used for when repairs or other things may occur

Parameters:

df (pd.DataFrame) – The dataframe containing the components to reinitalize

Returns:

The reinitalized components

Return type:

pd.DataFrame

update(day: int)[source]

Perform a monitoring update for one day in the simulation:

Modifies time to detection for components

Parameters:

day (int) – Current day in the simulation

Note

Updates the underlying dataframes in place

update_labor_rate(new: float)[source]

Updates the labor rate for this repair

Parameters:

new (float) – The new labor rate

class pvrpm.core.modules.monitor.LevelMonitor(level: str, comp_level_df: DataFrame, case: SamCase)[source]

Bases: Monitor

Defines monitoring at a component level

initialize_components()[source]

Initalizes monitoring data for all components to be tracked during simulation for this monitor type

Note

Updates the underlying dataframes in place

reinitialize_components(df: DataFrame) DataFrame[source]

Reinitalize components in a dataframe similiar to the inital initalization. Used for when repairs or other things may occur

Parameters:

df (pd.DataFrame) – The dataframe containing the components to reinitalize

Returns:

The reinitalized components

Return type:

pd.DataFrame

update(day: int)[source]

Perform a monitoring update for one day in the simulation:

Modifies time to detection for components

Parameters:

day (int) – Current day in the simulation

Note

Updates the underlying dataframes in place

class pvrpm.core.modules.monitor.Monitor(level: str, comp_level_df: DataFrame, case: SamCase)[source]

Bases: ABC

Abstract class for monitoring types

__init__(level: str, comp_level_df: DataFrame, case: SamCase)[source]

Initalizes a monitoring instance

Parameters:
  • level (str) – The component level this monitoring is apart of

  • comp_level_df (pd.DataFrame) – The component level dataframe containing the simulation data

  • case (SamCase) – The SAM case for this simulation

abstract initialize_components()[source]

Initalizes monitoring data for all components to be tracked during simulation for this monitor type

Note

Updates the underlying dataframes in place

abstract reinitialize_components(df: DataFrame) DataFrame[source]

Reinitalize components in a dataframe similiar to the inital initalization. Used for when repairs or other things may occur

Parameters:

df (pd.DataFrame) – The dataframe containing the components to reinitalize

Returns:

The reinitalized components

Return type:

pd.DataFrame

abstract update(day: int)[source]

Perform a monitoring update for one day in the simulation:

Modifies time to detection for components

Parameters:

day (int) – Current day in the simulation

Note

Updates the underlying dataframes in place

pvrpm.core.modules.repair module

class pvrpm.core.modules.repair.PartialRepair(level: str, comp_level_df: DataFrame, case: SamCase, costs: array, fails: object, fail_mode: str, repair_mode: str, indep_monitoring: IndepMonitor | None = None)[source]

Bases: Repair

Defines a normal and partial repair of failed components for a specific partial failure mode

__init__(level: str, comp_level_df: DataFrame, case: SamCase, costs: array, fails: object, fail_mode: str, repair_mode: str, indep_monitoring: IndepMonitor | None = None)[source]

Initalizes a repair instance

Parameters:
  • level (str) – The component level this repair is apart of

  • comp_level_df (pd.DataFrame) – The component level dataframe containing the simulation data

  • case (SamCase) – The SAM case for this simulation

  • costs (np.array) – The costs per day of the realization

  • fails (PartialFailure) – The partial failure this repair corresponds to for this component level

  • fail_mode (str) – The name of the partial failure this repair maps to

  • repair_mode (str) – The name of the partial repair

  • indep_monitoring (IndepMonitoring, Optional) – For updating static monitoring during simulation

initialize_components()[source]

Initalizes repair data for all components to be tracked during simulation for this repair type

Note

Updates the underlying dataframes in place

reinitialize_components(df: DataFrame) DataFrame[source]

Reinitalize components in a dataframe similiar to the inital initalization. Used for when repairs or other things may occur

Parameters:

df (pd.DataFrame) – The dataframe containing the components to reinitalize

Returns:

The reinitalized components

Return type:

pd.DataFrame

update(day: int)[source]

Changes the state of a component to operational once repairs are complete, only for components where the time to repair is zero for this failure / repair mode

class pvrpm.core.modules.repair.Repair(level: str, comp_level_df: DataFrame, case: SamCase, costs: array, fails: List, repairs: List, monitors: List, indep_monitoring: IndepMonitor | None = None)[source]

Bases: ABC

Abstract class defining how repairs work

__init__(level: str, comp_level_df: DataFrame, case: SamCase, costs: array, fails: List, repairs: List, monitors: List, indep_monitoring: IndepMonitor | None = None)[source]

Initalizes a repair instance

Parameters:
  • level (str) – The component level this repair is apart of

  • comp_level_df (pd.DataFrame) – The component level dataframe containing the simulation data

  • case (SamCase) – The SAM case for this simulation

  • costs (np.array) – The costs per day of the realization

  • fails (list(Failure)) – The list of failures for this component level

  • repairs (list(Repair)) – The list of repairs for this component level

  • monitors (list(Monitors)) – The list of monitors for this component level

  • indep_monitoring (IndepMonitoring, Optional) – For updating static monitoring during simulation

abstract initialize_components()[source]

Initalizes repair data for all components to be tracked during simulation for this repair type

Note

Updates the underlying dataframes in place

abstract reinitialize_components(df: DataFrame) DataFrame[source]

Reinitalize components in a dataframe similiar to the inital initalization. Used for when repairs or other things may occur

Parameters:

df (pd.DataFrame) – The dataframe containing the components to reinitalize

Returns:

The reinitalized components

Return type:

pd.DataFrame

abstract update(day: int)[source]

Perform a repair update for one day in the simulation

Parameters:

day (int) – Current day in the simulation

Note

Updates the underlying dataframes in place

update_labor_rate(new: float)[source]

Updates the labor rate for this repair

Parameters:

new (float) – The new labor rate

class pvrpm.core.modules.repair.TotalRepair(level: str, comp_level_df: DataFrame, case: SamCase, costs: array, fails: List, repairs: List, monitors: List, indep_monitoring: IndepMonitor | None = None)[source]

Bases: Repair

Defines a normal and complete repair of failed components

initialize_components()[source]

Initalizes repair data for all components to be tracked during simulation for this repair type

Note

Updates the underlying dataframes in place

reinitialize_components(df: DataFrame) DataFrame[source]

Reinitalize components in a dataframe similiar to the inital initalization. Used for when repairs or other things may occur

Parameters:

df (pd.DataFrame) – The dataframe containing the components to reinitalize

Returns:

The reinitalized components

Return type:

pd.DataFrame

update(day: int)[source]

Changes the state of a component to operational once repairs are complete, only for components where the time to repair is zero

Module contents