Skip to content

Commit

Permalink
change ignore errors default to true because of unhelpfull error message
Browse files Browse the repository at this point in the history
  • Loading branch information
heckstrahler committed Nov 2, 2023
1 parent b5985cf commit 024239c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions pandapower/converter/cim/cim2pp/build_pp_net.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ def convert_to_pp(self, convert_line_to_switch: bool = False, line_r_limit: floa
level=LogLevel.ERROR, code=ReportCode.ERROR, message="Failed running a powerflow."))
self.report_container.add_log(Report(level=LogLevel.EXCEPTION, code=ReportCode.EXCEPTION,
message=traceback.format_exc()))
if not kwargs.get('ignore_errors', False):
if not kwargs.get('ignore_errors', True):
raise e
else:
self.logger.info("Power flow solved normal.")
Expand Down Expand Up @@ -209,9 +209,10 @@ def convert_to_pp(self, convert_line_to_switch: bool = False, line_r_limit: floa
level=LogLevel.EXCEPTION, code=ReportCode.EXCEPTION_CONVERTING,
message=traceback.format_exc()))
self.net.measurement = self.net.measurement[0:0]
if not kwargs.get('ignore_errors', False):
if not kwargs.get('ignore_errors', True):
raise e
try:
# TODO: think on whether to remove whole function
if kwargs.get('update_assets_from_sv', False):
CreateMeasurements(self.net, self.cim).update_assets_from_sv()
except Exception as e:
Expand All @@ -223,7 +224,7 @@ def convert_to_pp(self, convert_line_to_switch: bool = False, line_r_limit: floa
self.report_container.add_log(Report(
level=LogLevel.EXCEPTION, code=ReportCode.EXCEPTION_CONVERTING,
message=traceback.format_exc()))
if not kwargs.get('ignore_errors', False):
if not kwargs.get('ignore_errors', True):
raise e
# a special fix for BB and NB mixed networks:
# fuse boundary ConnectivityNodes with their TopologicalNodes
Expand Down
2 changes: 1 addition & 1 deletion pandapower/converter/cim/cim2pp/from_cim.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ def from_cim(file_list: List[str] = None, encoding: str = 'utf-8', convert_line_
- run_powerflow (bool): Option to run to powerflow inside the converter to create res tables directly.
Default: False.
- ignore_errors (bool): Option to disable raising of internal errors. Useful if you need to get a network not matter
if there are errors in the conversion. Default: False.
if there are errors in the conversion. Default: True.
:param file_list: The path to the CGMES files as a list.
:param encoding: The encoding from the files. Optional, default: utf-8
Expand Down

0 comments on commit 024239c

Please sign in to comment.