-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add components (islands) view with Load Flow results
Signed-off-by: Damien Jeandemange <[email protected]>
- Loading branch information
1 parent
586dac0
commit 9fb446b
Showing
7 changed files
with
101 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# | ||
# Copyright (c) 2024, Damien Jeandemange (https://github.com/jeandemanged) | ||
# This Source Code Form is subject to the terms of the Mozilla Public | ||
# License, v. 2.0. If a copy of the MPL was not distributed with this | ||
# file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
# SPDX-License-Identifier: MPL-2.0 | ||
# | ||
from typing import Any | ||
|
||
import pandas as pd | ||
|
||
from yagat.app_context import AppContext | ||
from yagat.frames.impl.base_list_view import BaseListView, BaseColumnFormat | ||
|
||
|
||
class ComponentsListView(BaseListView): | ||
|
||
def __init__(self, parent, context: AppContext, *args, **kwargs): | ||
BaseListView.__init__(self, parent, context, *args, **kwargs) | ||
|
||
@property | ||
def tab_name(self) -> str: | ||
return 'Components (Islands)' | ||
|
||
@property | ||
def tab_group_name(self) -> str: | ||
return 'Components (Islands)' | ||
|
||
def get_data_frame(self) -> pd.DataFrame: | ||
return self.context.network_structure.components | ||
|
||
def get_column_formats(self) -> dict[str, BaseColumnFormat]: | ||
return super().get_column_formats() | ||
|
||
def on_entry(self, ident: str, column_name: str, new_value: Any): | ||
raise RuntimeError('Components do not support update') | ||
|
||
def filter_data_frame(self, df: pd.DataFrame, voltage_levels: list[str]) -> pd.DataFrame: | ||
return df |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters