Skip to content

Commit

Permalink
cim converter: Avoid huge logging output when ignore_erros = True
Browse files Browse the repository at this point in the history
  • Loading branch information
mrifraunhofer committed Apr 18, 2024
1 parent 2e73838 commit c557e23
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 18 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Change Log
- [CHANGED] updated upload_release.py to install the uploadad package and print the version
- [CHANGED] updated MANIFEST.in to exclude the ci files from the wheel distribution
- [CHANGED] cim data structure method in cim converter changed to blueprint approach
- [CHANGED] cim converter: Avoid huge logging output when ignore_erros = True
- [FIXED] massive performance drag in large grids due to initializing Ybus for FACTS with np.zeros instead of using sparse matrix initialization
- [FIXED] further futurewarnings and deprecation warnings

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,10 +211,8 @@ def _prepare_connectivity_nodes_cim16(self) -> Tuple[pd.DataFrame, pd.DataFrame]
if 'TopologicalNode_2' in connectivity_nodes.columns:
connectivity_nodes['TopologicalNode'].fillna(connectivity_nodes['TopologicalNode_2'], inplace=True)
connectivity_nodes = connectivity_nodes.drop(columns=['TopologicalNode_2'])
if connectivity_nodes.index.size != connectivity_nodes_size:
connectivity_nodes.drop(columns=['TopologicalNode_2'], inplace=True)
if connectivity_nodes.index.size != connectivity_nodes_size and not self.cimConverter.kwargs.get(
'ignore_errors', False):
'ignore_errors', True):
self.logger.warning("There is a problem at the busses!")
self.cimConverter.report_container.add_log(Report(
level=LogLevel.WARNING, code=ReportCode.WARNING_CONVERTING,
Expand All @@ -237,19 +235,8 @@ def _prepare_connectivity_nodes_cim16(self) -> Tuple[pd.DataFrame, pd.DataFrame]
bb = bb.drop_duplicates(subset=['rdfId'], keep='first')
connectivity_nodes = pd.merge(connectivity_nodes, bb, how='left', on='rdfId')

connectivity_nodes = connectivity_nodes.rename(columns={'rdfId': sc['o_id'], 'TopologicalNode': sc['ct'], 'nominalVoltage': 'vn_kv',
'name_substation': 'zone'})
connectivity_nodes.drop_duplicates(subset=['rdfId'], keep='first', inplace=True)
# add the busbars
bb = self.cimConverter.cim['eq']['BusbarSection'][['rdfId', 'name']]
bb.rename(columns={'rdfId': 'busbar_id', 'name': 'busbar_name'}, inplace=True)
bb = pd.merge(bb, self.cimConverter.cim['eq']['Terminal'][['ConnectivityNode', 'ConductingEquipment']].rename(
columns={'ConnectivityNode': 'rdfId', 'ConductingEquipment': 'busbar_id'}), how='left', on='busbar_id')
bb.drop_duplicates(subset=['rdfId'], keep='first', inplace=True)
connectivity_nodes = pd.merge(connectivity_nodes, bb, how='left', on='rdfId')

connectivity_nodes.rename(columns={'rdfId': sc['o_id'], 'TopologicalNode': sc['ct'], 'nominalVoltage': 'vn_kv',
'name_substation': 'zone'}, inplace=True)
connectivity_nodes = connectivity_nodes.rename(columns={'rdfId': sc['o_id'], 'TopologicalNode': sc['ct'],
'nominalVoltage': 'vn_kv', 'name_substation': 'zone'})
connectivity_nodes['in_service'] = True
connectivity_nodes['type'] = 'b'
return connectivity_nodes, eqssh_terminals
4 changes: 2 additions & 2 deletions pandapower/converter/cim/cim_tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ def extend_pp_net_cim(net: pandapowerNet, override: bool = True) -> pandapowerNe
fill_dict['gen'][np_float_type] = \
['min_p_mw', 'max_p_mw', 'min_q_mvar', 'max_q_mvar', 'vn_kv', 'rdss_ohm', 'xdss_pu', 'cos_phi', 'pg_percent']
fill_dict['sgen'] = dict()
fill_dict['sgen'][np_str_type] = [sc['t'], 'description']
fill_dict['sgen'][np_float_type] = ['k', 'rx', 'vn_kv', 'rdss_ohm', 'xdss_pu', 'lrc_pu', 'generator_type']
fill_dict['sgen'][np_str_type] = [sc['t'], 'description', 'generator_type']
fill_dict['sgen'][np_float_type] = ['k', 'rx', 'vn_kv', 'rdss_ohm', 'xdss_pu', 'lrc_pu']
fill_dict['motor'] = dict()
fill_dict['motor'][np_str_type] = [sc['t'], 'description']
fill_dict['storage'] = dict()
Expand Down

0 comments on commit c557e23

Please sign in to comment.