powfacpy.PFPlotInterface
- class powfacpy.PFPlotInterface(app)
- __init__(app)
Methods
__init__
(app)activate_study_case
(path)Activate study case under path.
add_results_variable
(obj, variables[, ...])Adds variables of the object to the PowerFactory results object (ElmRes) obj: PowerFactory object or its path
autoscale
()clear_curves
()Clear all curves from active plot.
clear_curves_from_all_plots
()Clear curves from all plots of the active study case.
clear_plot_pages
()Deletes all graphics (plot) pages from the graphics board of the active study case.
copy_graphics_board_content
(...[, ...])Copy the graphics board content of a study case to another study cases. Arguments: source_study_case: Source case (path or object) target_study_cases: Target case(s) (path(s) or object(s)) obj_to_copy: name of objects to be copied from graphics board (e.g. "*.GrpPage" to copy only the plot pages) clear_target_graphics_board: If true, the graphics boards of the target cases are cleared before pasting the content .
copy_graphics_board_content_to_all_study_cases
(...)Copy the content of the graphics board to all study cases. Arguments: source_study_case: Source case (path or object) target_parent_folder: Parent folder of target cases. By default, the study case folder of the project is used. Any folder inside the study case folder of the project can be specified. obj_to_copy: name of objects to be copied from graphics board (e.g. "*.GrpPage" to copy only the plot pages) clear_target_graphics_board: If true, the graphics boards of the target cases are cleared before pasting the content.
copy_obj
(obj_or_path, target_folder[, ...])Copies object(s) by using 'get_obj' in first step and the copying the returned objects to 'target_folder'.
copy_single_obj
(obj_or_path, target_folder)Copies single object by using 'get_single_obj' in first step and the copying the returned objects to 'target_folder'.
create_by_path
(path[, overwrite])Create an object by specifying its path including its class and return the object. If overwrite is true, objects with the same name will be overwritten. Example: pfbi.create_by_path(r"LibraryDynamic Modelsdummy.BlkDef") .
create_directory
(directory[, parent_folder])Create a directory of folders ('IntFolder') if the directory does not yet exist. Arguments: path: path of folders parent_folder: If not specified, the active project folder is used.
create_in_folder
(folder, obj[, overwrite])Creates an obj inside a folder and returns the object. If overwrite is true, objects with the same name will be overwritten. Example: pfbi.create_in_folder("LibraryDynamic Models","dummy2.BlkDef").
delete_obj
(obj_or_path[, condition, ...])Delete object(s).
get_active_project
()Returns the currently active project and throws an error if no prject has been activated.
get_active_user_folder
()Return the folder of the active user.
get_attr
(obj, attr[, parent_folder])Get the value of an attribute of an object.
get_attr_by_path
(path_with_attr)get_by_condition
(objects, condition)From a list of objects, get those for whom the 'condition' (which is a function) returns 'True'. Example: pfbi.get_by_condition(list_of_objects,lambda x : getattr(x,"uknom")==110).
get_data_series_of_active_plot
()Get the dataseries of the currently active plot.
get_first_level_folder
(folder)Returns folder on first level of PF database.
get_multiple_obj_from_similar_sub_directories
(...)Returns multiple objects that are in a similar subdirectory relativ to their parent folders. Arguments: parents: Parent folders (string path,list of objects/string paths) sub_path: Path within the parent folders (string). Must be unique (don't use placeholders '*').
get_obj
(path[, condition, parent_folder, ...])Returns the PowerFactory object(s) under 'path'. 'path' can contain wildcards ("*") after the last "". A condition may be specified as a function, for example to check certain attributes with lambda function: (eg. "condition = lambda x : getattr(x,"uknom")==110)". By default, the 'path' is relative to the folder of the active project. Only if 'parent_folder' is specified, it is relative to that folder. The parent_folder can be a PF container object or a string: parent_folder = "user" means 'path' is relative to the active user instead of the active project. An error is raised if no object is found, unless 'error_if_non_existent=False'.
get_or_create_graphics_board
()Get the graphics board of the currently active study case or create a new graphics board if it does not exist within the study case yet.
get_parameter_value_string
(parameters[, ...])get_path_of_object
(obj)get_single_obj
(path[, parent_folder, ...])Use this method if you want to access one single unique object.
handle_condition_of_obj_not_met
(path, obj, ...)Handles the attempted access to an object with a certain condition that does not exist.
handle_inclusion_of_subfolders
(path, ...)If subfolders are included, 'GetChildren' must be used instead of 'GetContents'.
handle_non_existing_obj
(path, parent_folder, ...)Handles the attempted access to a non existent object.
handle_pf_object_or_path_input
(obj_or_path)Handles the input argument when a method accepts either
handle_single_pf_object_or_path_input
(obj[, ...])Handles the input argument when a method accepts either
is_container
(obj)Checks whether a PF object is a container.
path_exists
(path[, parent, return_info])Check if the path exists.
plot
(obj, variables[, graphics_page, plot])Plots the variables of 'obj' to the currently active plot. Includes adding the variables to the results (ElmRes) object. The active plot can be set with the optional arguments. Arguemnts: variables: string or list of variable names graphics_page: name of graphics page plot: name of plot kwargs: results_obj: result object used (object or path) linestyle: int linewidth: double color: int label: str.
plot_from_csv
(csv_path, variables[, offset, ...])Plot results from csv file using pyplot. Arguments: csv_path: path of csv file variables: path of variables to be plotted offset: time offset.
plot_monitored_variables
(obj, variables[, ...])Plot varibales that were already added to the monitored variables. Arguments: obj: PowerFactory object or its path variables: string or list of variable names graphics_page: name of graphics page plot: name of plot kwargs: result_obj: result object used (object or path) linestyle: int linewidth: double color: int label: str.
set_active_graphics_page
(page)Sets the active graphics page. Arguments: page:graphics page name.
set_active_plot
(name[, graphics_page])Set the currently active plot. Arguments: name: name of plot (string) graphics_page: name of grphics page (string). If specified, this sets the currently active page.
set_attr
(obj, params[, parent_folder])Set the attribute(s) of an object.
set_attr_by_path
(path_with_attr, value)path_with_attr: path of object plus the attribute name Example: pfbi.set_attr_by_path(self, "LibraryDynamic ModelsLinear_interpolationdesc",["description"]) Here 'desc' is the name of the attribute. .
set_curve_attributes
(data_series, **kwargs)Set curve attributes. Arguments: data_series: data series of plot. kwargs: results_obj: result object used (object or path) linestyle: int linewidth: double color: int label: str.
Attributes
language