API

Modules, methods, classes and attributes are explained here.

Main.py contains the functions to calculate the different quantities of materials in each step of the process. Reffer to the diagram on Package-Overview for the steps considered.

Support functions include Weibull functions for reliability and failure; also, functions to modify baseline values and evaluate sensitivity to the parameters.

Flow Mass Functions

PV_ICE.main.Simulation(name=None, path=None, baselinepath=None)[source]

The ScenarioObj top level class is used to work on Circular Economy scenario objects, keep track of filenames, data for module and materials, operations modifying the baselines, etc.

Parameters:
  • name (text to append to output files) –

  • nowstr (current date/time string) –

  • path (working directory with circular economy results) –

__init__ : initialize the object
_setPath : change the working directory
PV_ICE.main.Scenario(name, massmodulefile=None, energymodulefile=None, file=None)[source]

The ScenarioObj top level class is used to work on Circular Economy scenario objects, keep track of filenames, data for module and materials, operations modifying the baselines, etc.

Parameters:
  • name (text to append to output files) –

  • nowstr (current date/time string) –

  • path (working directory with circular economy results) –

__init__ : initialize the object
_setPath : change the working directory
PV_ICE.main.Material(materialname, massmatfile, energymatfile=None)[source]

Reliability and Failure Functions

PV_ICE.main.weibull_params(keypoints)[source]

Returns shape parameter alpha and scale parameter beta for a Weibull distribution whose CDF passes through the two time: value pairs in keypoints

Parameters:

keypoints (list) – Two lists of t50 and 590 values, where t50 is the year since deployment that the cohort has lost 50% of originally installed modules, and t90 is the year since deployment that the cohort has lost 90% of the originally installed modules. These values are used to calcualte the shape and scale parameters for the weibull distribution.

Returns:

  • alpha (float) – Shape parameter alpha for weibull distribution.

  • beta (float) – Scale parameter beta for weibull distribution. Often exchanged with lifetime like in Irena 2016, beta = 30.

PV_ICE.main.weibull_cdf(alpha, beta)[source]

Return the CDF for a Weibull distribution having: shape parameter alpha scale parameter beta

Parameters:
  • alpha (float) – Shape parameter alpha for weibull distribution.

  • beta (float) – Scale parameter beta for weibull distribution. Often exchanged with lifetime like in Irena 2016, beta = 30.

Modifying Baseline Functions

PV_ICE.main.sens_StageEfficiency(df, stage, target_eff=95.0, start_year=None, goal_year=2030, plotflag=False)[source]

Modifies baseline scenario for evaluating sensitivity to increasing a stage in the lifetime of the module’s efficiency. It either increases or decreases from the start year until the goal year the value to the target efficiency by interpolation.

Parameters:
  • df (dataframe) – dataframe to be modified

  • stage (str) – Stage that wants to be modified. This can be any of the module or material specified efficiencies, for example:’MFG_Material_eff’, ‘mat_MFG_scrap_recycled’, ‘mat_MFG_scrap_Recycled’, ‘mat_MFG_scrap_Recycled_into_HQ’, ‘mat_MFG_scrap_Recycled_into_HQ_Reused4MFG’ ‘mod_EOL_collection_losses’, ‘mod_EOL_collected_recycled’, ‘mat_EOL_Recycling_yield’, ‘mat_EOL_Recycled_into_HQ’, ‘mat_EOL_RecycledHQ_Reused4MFG’, ‘mod_Repair’, ‘mod_MerchantTail’, ‘mod_Reuse’, ‘mod_eff’, etc.

  • start_year (int) – Year to start modifying the value. This specifies the initial efficiency value that is going to be modified. If None is passed, current year is used.

  • target_eff (flat) – target eff value in percentage to be reached. i.e. 95.0 %.

  • goal_year (int) – year by which target efficiency will be reached. i.e. 2030. Must be higher than current year.

Returns:

df (dataframe) – modified dataframe

PV_ICE.main.sens_StageImprovement(df, stage, improvement=1.3, start_year=None)[source]

Modifies baseline scenario for evaluating sensitivity of lifetime parameter. t50 and t90 reliability years get incresed by improvement parameter starting the year_increase year specified.

Parameters:
  • df (dataframe) – dataframe to be modified

  • stage (str) – Stage that wants to be modified. This can be any of the module or material specified values, for example:’MFG_Material_eff’, ‘mat_MFG_scrap_recycled’, ‘mat_MFG_scrap_Recycled’, ‘mat_MFG_scrap_Recycled_into_HQ’, ‘mat_MFG_scrap_Recycled_into_HQ_Reused4MFG’ ‘mod_EOL_collection_losses’, ‘mod_EOL_collected_recycled’, ‘mat_EOL_Recycling_yield’, ‘mat_EOL_Recycled_into_HQ’, ‘mat_EOL_RecycledHQ_Reused4MFG’, ‘mod_Repair’, ‘mod_MerchantTail’, ‘mod_Reuse’, ‘mod_eff’, etc.

  • improvement (decimal) – Percent increase in decimal (i.e. “1.3” for 30% increase in value) or percent decrease (i.e. “0.3”) relative to values in df.

  • start_year – the year at which the improvement occurs

Returns:

df (dataframe) – dataframe of expected module lifetime increased or decreased at specified year

LCA Functions

PV_ICE.main.calculateLCA(PVarea, modified_impacts=None, printflag=False)[source]