PyDSS.pyPostprocessor.PostprocessScripts package

Submodules

PyDSS.pyPostprocessor.PostprocessScripts.AutomatedThermalUpgrade module

class PyDSS.pyPostprocessor.PostprocessScripts.AutomatedThermalUpgrade.AutomatedThermalUpgrade(project, scenario, inputs, dssInstance, dssSolver, dssObjects, dssObjectsByClass, simulationSettings, Logger)[source]

Bases: PyDSS.pyPostprocessor.pyPostprocessAbstract.AbstractPostprocess

The class is used to determine thermal upgrades

REQUIRED_INPUT_FIELDS = ('line_loading_limit', 'dt_loading_limit', 'line_safety_margin', 'xfmr_safety_margin', 'nominal_voltage', 'max_iterations', 'create_upgrade_plots', 'tps_to_test', 'create_upgrades_library', 'upgrade_library_path')
check_voltage_violations_multi_tps(upper_limit, lower_limit, raise_exception=True)[source]
correct_line_violations()[source]
correct_node_coords()[source]
correct_xfmr_violations()[source]
create_edge_node_dicts()[source]
create_op_plots()[source]
create_result_comparison(upper_limit=None, lower_limit=None)[source]
determine_available_line_upgrades()[source]
determine_available_xfmr_upgrades()[source]
determine_line_ldgs()[source]
determine_xfmr_ldgs()[source]
determine_xfmr_ldgs_alltps()[source]
determine_xfmr_ldgs_alltps_individual_object()[source]
export_line_DT_parameters()[source]
finalize()[source]

Method used to combine post processing results from all steps.

generate_edges()[source]

All lines, switches, reclosers etc are modeled as lines, so calling lines takes care of all of them. However we also need to loop over transformers as they form the edge between primary and secondary nodes :return:

generate_nodes()[source]
get_line_info()[source]
get_load_mults()[source]
get_load_pv_mults_individual_object()[source]
get_min_max_load_mult()[source]
get_nodal_violations()[source]
get_nodal_violations_individual_object()[source]
linecode_lib_reformat()[source]
plot_feeder()[source]
read_available_upgrades(file)[source]
read_load_files(dss_path)[source]
read_load_files_get_load_pv_mults_individual_object(key_paths, dss_path)[source]
read_pv_files_get_load_pv_mults_individual_object(key_paths, dss_path)[source]
run(step, stepMax, simulation=None)[source]

Method used to run a post processing script.

Parameters
  • step (int) – Current step

  • stepMax (int) – Last step of the simulation

  • simulation (OpenDSS) – PyDSS simulation control class. Provided for access to control algorithms. Subclasses should not hold references to this instance after this method exits.

solve_diff_tps_lines()[source]
solve_diff_tps_lines_individual_object()[source]
time_limit_exception(expire_time, exception_message='Time limit exceeded')[source]
write_dat_file(output_path=None)[source]
write_dss_file(device_command)[source]
write_to_json(dict, file_name)[source]
PyDSS.pyPostprocessor.PostprocessScripts.AutomatedThermalUpgrade.get_transformer_info()[source]

PyDSS.pyPostprocessor.PostprocessScripts.AutomatedThermalUpgrade_helper module

class PyDSS.pyPostprocessor.PostprocessScripts.AutomatedThermalUpgrade_helper.AutomatedThermalUpgrade_helper(dssInstance, dssSolver, dssObjects, dssObjectsByClass, simulationSettings)[source]

Bases: PyDSS.pyPostprocessor.pyPostprocessAbstract.AbstractPostprocess

The class is used to induce faults on bus for dynamic simulation studies. Subclass of the PyDSS.pyControllers.pyControllerAbstract.ControllerAbstract abstract class.

Parameters
  • FaultObj (class:PyDSS.dssElement.dssElement) – A PyDSS.dssElement.dssElement object that wraps around an OpenDSS ‘Fault’ element

  • Settings (dict) – A dictionary that defines the settings for the faul controller.

  • dssInstance (opendssdirect instance) – An opendssdirect instance

  • ElmObjectList (dict) – Dictionary of all dssElement, dssBus and dssCircuit ojects

  • dssSolver (PyDSS.SolveMode) – An instance of one of the classes defined in PyDSS.SolveMode.

Raises

AssertionError if ‘FaultObj’ is not a wrapped OpenDSS Fault element

run(step, stepMax, simulation=None)[source]

Induces and removes a fault as the simulation runs as per user defined settings.

PyDSS.pyPostprocessor.PostprocessScripts.AutomatedVoltageUpgrade module

class PyDSS.pyPostprocessor.PostprocessScripts.AutomatedVoltageUpgrade.AutomatedVoltageUpgrade(project, scenario, inputs, dssInstance, dssSolver, dssObjects, dssObjectsByClass, simulationSettings, Logger)[source]

Bases: PyDSS.pyPostprocessor.pyPostprocessAbstract.AbstractPostprocess

This class is used to determine Voltage Upgrades

LTC_controls_sweep(upper_limit, lower_limit)[source]
REQUIRED_INPUT_FIELDS = ('target_v', 'initial_voltage_upper_limit', 'initial_voltage_lower_limit', 'final_voltage_upper_limit', 'final_voltage_lower_limit', 'nominal_voltage', 'nominal_pu_voltage', 'tps_to_test', 'create_topology_plots', 'cap_sweep_voltage_gap', 'reg_control_bands', 'reg_v_delta', 'max_regulators', 'use_ltc_placement', 'thermal_scenario_name')
add_new_reg_common_nodes(upper_limit)[source]
add_new_regctrl(node)[source]
add_new_xfmr(node)[source]
add_substation_LTC()[source]
apply_best_LTCsetting(upper_limit)[source]
apply_best_capsetting(upper_limit)[source]
apply_best_regsetting(upper_limit)[source]
apply_orig_LTC_setting()[source]
apply_orig_cap_setting()[source]
apply_orig_reg_setting()[source]
cap_settings_sweep(upper_limit, lower_limit)[source]
check_voltage_violations_multi_tps(upper_limit, lower_limit, raise_exception=True)[source]
check_voltage_violations_multi_tps_individual_object(upper_limit, lower_limit)[source]
cluster_square_array()[source]
compare_objective_function(min_cluster)[source]
correct_cap_bank_settings()[source]
correct_node_coords()[source]
create_final_comparison(project_path=None, thermal_dss_file=None)[source]
create_result_comparison_voltages(comparison_stage='')[source]
disable_added_xfmr(node)[source]
disable_regctrl_current_cluster()[source]
edit_capacitor_settings_for_convergence(control_command)[source]
finalize()[source]

Method used to combine post processing results from all steps.

generate_edges()[source]

All lines, switches, reclosers etc are modeled as lines, so calling lines takes care of all of them. However we also need to loop over transformers as they form the edge between primary and secondary nodes :return:

generate_nodes()[source]
generate_nx_representation()[source]
get_capacitor_state()[source]
get_existing_controller_info()[source]
get_full_distance_dict()[source]
get_load_mults()[source]
get_load_pv_mults_individual_object()[source]
get_min_max_load_mult()[source]
get_shortest_path()[source]
get_viols_with_initial_cap_settings()[source]
identify_correct_reg_node()[source]
plot_created_clusters()[source]
plot_feeder()[source]
plot_heatmap_distmatrix()[source]
plot_violations()[source]
read_load_files(dss_path)[source]
read_load_files_individual_object(key_paths, dss_path)[source]
read_pv_files_individual_object(key_paths, dss_path)[source]
reg_controls_sweep(upper_limit, lower_limit)[source]
run(step, stepMax, simulation=None)[source]

Method used to run a post processing script.

Parameters
  • step (int) – Current step

  • stepMax (int) – Last step of the simulation

  • simulation (OpenDSS) – PyDSS simulation control class. Provided for access to control algorithms. Subclasses should not hold references to this instance after this method exits.

write_dss_file(device_command)[source]
write_to_json(dict, file_name)[source]
write_upgrades_to_file(output_path=None)[source]
PyDSS.pyPostprocessor.PostprocessScripts.AutomatedVoltageUpgrade.get_cap_controls_info()[source]
PyDSS.pyPostprocessor.PostprocessScripts.AutomatedVoltageUpgrade.get_capacitor_info()[source]
PyDSS.pyPostprocessor.PostprocessScripts.AutomatedVoltageUpgrade.get_ckt_info()[source]
PyDSS.pyPostprocessor.PostprocessScripts.AutomatedVoltageUpgrade.get_reg_control_info()[source]

PyDSS.pyPostprocessor.PostprocessScripts.DERMSOptimizer module

class PyDSS.pyPostprocessor.PostprocessScripts.DERMSOptimizer.DERMSOptimizer(project, scenario, inputs, dssInstance, dssSolver, dssObjects, dssObjectsByClass, simulationSettings, Logger)[source]

Bases: PyDSS.pyPostprocessor.pyPostprocessAbstract.AbstractPostprocess

ExtractImpednceMatrix()[source]
IMPLEMENTATION_MODES = ['Continuous', 'Voltage triggered', 'Time triggered', 'Off']
REQUIRED_INPUT_FIELDS_AND_DEFAULTS = {'Distributions': {'Imes': ['norm', [0.0, 0.01]], 'Vmes': ['norm', [0.0, 0.01]]}, 'Vlower': 0.955, 'Vupper': 1.038, 'coeff_p': 0.0005, 'coeff_q': 1e-06, 'control_all_flag': True, 'control_flag': True, 'implementation_mode': 'Voltage triggered', 'max_iterations': 50, 'measurements_noises_flag': True, 'num_DERMS': 1, 'opf_iteration': 60, 'stepsize_mu': 10, 'stepsize_xp': 1, 'stepsize_xq': 5, 'time_trigger_sec': 900}
buses(pv)[source]
calc_node_PQ()[source]
construct_Yprime()[source]
convert_3phasePV_to_1phasePV(PVSystems)[source]
getBranchInfo()[source]
getContolBuses(classNames)[source]
getDERdata()[source]
getPreoptimizationResults()[source]
get_PQ_by_class(className)[source]
get_elem_data(ElementClass, Properties)[source]
get_incidence_matrix()[source]
get_voltage_Yorder()[source]
initialize_optimizer()[source]
run(step, stepMax, simulation=None)[source]

Induces and removes a fault as the simulation runs as per user defined settings.

to_complex(values)[source]

PyDSS.pyPostprocessor.PostprocessScripts.EdLiFoControl module

class PyDSS.pyPostprocessor.PostprocessScripts.EdLiFoControl.EdLiFoControl(project, scenario, inputs, dssInstance, dssSolver, dssObjects, dssObjectsByClass, simulationSettings, Logger)[source]

Bases: PyDSS.pyPostprocessor.pyPostprocessAbstract.AbstractPostprocess

Electric distance last-in First-out curtailment based PV output control

REQUIRED_INPUT_FIELDS = ['curtailment_size', 'electrical_distance_file_path', 'zone_option', 'zone_threshold', 'fixed_pv_path', 'lifo_pv_path', 'lifo_min_pv_size', 'user_lifo_pv_list']
finalize()[source]

Method used to combine post processing results from all steps.

get_curtailment_candidates()[source]

Finds PV units that can be be candidates for curtailment

get_lifo_ordered_list()[source]

Get the last-in first-in ordered PV list

poa_curtail()[source]

Executes curtailment decisions

record_curtailment(pv_sys)[source]

Records PV curtailments

run(step, stepMax, simulation=None)[source]

Runs edLiFo

solve_overloads()[source]

Uses the LiFo logic to solve line and transformer overloads

PyDSS.pyPostprocessor.PostprocessScripts.EdLiFoControl.check_line_overloads(monitored_lines)[source]

Checks line overloads

PyDSS.pyPostprocessor.PostprocessScripts.EdLiFoControl.choose_zone_radius(dismat_df)[source]

Selects a zone radius value that makes sense

PyDSS.pyPostprocessor.PostprocessScripts.EdLiFoControl.compute_electric_distance(bus_phases=None)[source]

This method computes electric distance matrix

PyDSS.pyPostprocessor.PostprocessScripts.EdLiFoControl.form_pvzones(affected_buses, dismat_df, zone_thr)[source]

Builds PV zones

PyDSS.pyPostprocessor.PostprocessScripts.EdLiFoControl.get_g(r_value)[source]

Get conductance values from resistance values

PyDSS.pyPostprocessor.PostprocessScripts.EdLiFoControl.get_monitored_line_dataframe(phase_info=3)[source]

Sample syntax: monitored_lines = get_monitored_line_dataframe()

PyDSS.pyPostprocessor.PostprocessScripts.EdLiFoControl.get_transformer_info()[source]

Gather transformer information

PyDSS.pyPostprocessor.PostprocessScripts.EdLiFoControl.parse_pv_scenario(file_path, min_lifo_pv_size)[source]

Extracts from a PV deployment scenario, parameter information into a dataframe. Sample syntax: PV_dict, PV_dataframe = parse_pv_scenario(deployment_path + deployment_name)

PyDSS.pyPostprocessor.PostprocessScripts.EdLiFoControl.string_attribute_parser(att, line)[source]

Parses attribute value from a line string

PyDSS.pyPostprocessor.PostprocessScripts.Utilidata_Interface module

class PyDSS.pyPostprocessor.PostprocessScripts.Utilidata_Interface.NOAAData(token)[source]

Bases: object

data_categories(**kwargs)[source]
data_types(**kwargs)[source]
dataset_spec(set_code, **kwargs)[source]
datasets(**kwargs)[source]
fetch_data(**kwargs)[source]
location_categories(**kwargs)[source]
locations(**kwargs)[source]
poll_api(req_type, payload)[source]
stations(h, p, **kwargs)[source]
class PyDSS.pyPostprocessor.PostprocessScripts.Utilidata_Interface.Utilidata_Interface(project, scenario, inputs, dssInstance, dssSolver, dssObjects, dssObjectsByClass, simulationSettings, Logger)[source]

Bases: PyDSS.pyPostprocessor.pyPostprocessAbstract.AbstractPostprocess

IMPLEMENTATION_MODES = []
REQUIRED_INPUT_FIELDS_AND_DEFAULTS = {}
create_optimization_model()[source]
define_constraints()[source]
define_metadata()[source]
disable_control_elements()[source]
find_filenames(path_to_dir, suffix='.csv')[source]
get_constraint(elm_name, isControllable)[source]
get_feeder(elm_name)[source]
get_measurement(obj, ppty)[source]
get_measurement_assets(asset_info)[source]
get_measurements()[source]
run(step, stepMax)[source]

Method used to run a post processing script.

Parameters
  • step (int) – Current step

  • stepMax (int) – Last step of the simulation

  • simulation (OpenDSS) – PyDSS simulation control class. Provided for access to control algorithms. Subclasses should not hold references to this instance after this method exits.

submit_operation_payload()[source]
update_system_states(new_settings)[source]
update_training_payload()[source]

PyDSS.pyPostprocessor.PostprocessScripts.postprocess_thermal_upgrades module

class PyDSS.pyPostprocessor.PostprocessScripts.postprocess_thermal_upgrades.postprocess_thermal_upgrades(Settings, dss, logger)[source]

Bases: object

correct_node_coords()[source]
create_edge_node_dicts()[source]
create_op_plots()[source]
generate_edges()[source]

All lines, switches, reclosers etc are modeled as lines, so calling lines takes care of all of them. However we also need to loop over transformers as they form the edge between primary and secondary nodes :return:

generate_nodes()[source]
get_all_parallel()[source]

processed_upgrade_file is the name of the json file written out from Akshay’s thermal upgrades code

get_line_upgrade_params(new_line)[source]
get_orig_line_DT_params()[source]
get_xfmr_upgrade_params(new_line)[source]
parallel_upgrades(equipment_type)[source]

upgrade_df is a dataframe version of the processed_thermal_upgrades.json file produced by Akshay’s upgrade codeself. equipment_type is a string equal to either “Transformer” or “Line”

plot_feeder()[source]
process_thermal_upgrades()[source]
write_to_json(dict, file_name)[source]

PyDSS.pyPostprocessor.PostprocessScripts.postprocess_voltage_upgrades module

PyDSS.pyPostprocessor.PostprocessScripts.postprocess_voltage_upgrades.compare_dict(old, new)[source]
class PyDSS.pyPostprocessor.PostprocessScripts.postprocess_voltage_upgrades.postprocess_voltage_upgrades(Settings, logger)[source]

Bases: object

check_substation_LTC()[source]
get_capacitor_upgrades()[source]
get_regulator_upgrades()[source]
write_to_json(dict, file_name)[source]

Module contents