-
Notifications
You must be signed in to change notification settings - Fork 87
Chore/architecture #820
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
SimonRubenDrauz
wants to merge
44
commits into
e2nIEE:develop
Choose a base branch
from
retoflow:chore/architecture
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Chore/architecture #820
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
6127af6
check for pandapower 3.4.1
SimonRubenDrauz 25545e2
Merge branch 'develop' into chore/pp-3.4.1
SimonRubenDrauz b194bec
adapt pandapipes version to match format version
dlohmeier 4d04467
bugfix
SimonRubenDrauz ef66e3d
bugfix
SimonRubenDrauz 6eef2d6
release for pp 3.3.3
SimonRubenDrauz 2594d0c
Merge branch 'develop' into chore/pp-3.3.3
SimonRubenDrauz ee2e3ff
add water components
SimonRubenDrauz 58e8631
small bugfix
SimonRubenDrauz 2b2a85c
increase version number
SimonRubenDrauz 5c370fe
Merge branch 'develop' into develop
SimonRubenDrauz a8349f6
Merge branch 'e2nIEE:develop' into develop
jthurner a1d7509
Merge remote-tracking branch 'origin/develop' into chore/architecture
SimonRubenDrauz c882109
implementation of new architecture not requiring build_system_matrix.py
SimonRubenDrauz bcf027e
restructuring
SimonRubenDrauz 755a9c9
remove area and scale jacobi matrix
SimonRubenDrauz 28322ee
variable fix
SimonRubenDrauz a8c6530
better convergence
SimonRubenDrauz 1ba3c14
create pipeflow calculation class and introduce idx-class
SimonRubenDrauz 5d6ab63
refactoring
SimonRubenDrauz 548dcce
bugfixes
SimonRubenDrauz 6442381
sign bugfix and its consequence
SimonRubenDrauz 89b7c02
fix colebrook bug
SimonRubenDrauz 7e3254e
further cleanup and bugfix in ext_grid/circ_pump
SimonRubenDrauz fc69339
add tutorial
SimonRubenDrauz c8deed0
remove unnecessary entries
SimonRubenDrauz ccc63c8
remove unnecessary entries
SimonRubenDrauz 692aa95
cleanup colebrook
SimonRubenDrauz e671e9e
cleanup colebrook
SimonRubenDrauz a556e6f
bugfix
SimonRubenDrauz cbe8056
bugfix
SimonRubenDrauz 520a0a8
der_lambda-Tests
SimonRubenDrauz aed8b25
pruning component list (check if each component can handle its own bu…
SimonRubenDrauz 78a1f63
fix sphinx failure
SimonRubenDrauz a71b4eb
fix sphinx failure
SimonRubenDrauz 97a5ece
- reduce duplicated code
SimonRubenDrauz 010d8ad
style bugfixes
SimonRubenDrauz 5fbb6e7
ignore D213
SimonRubenDrauz dc51a54
style adaptions
SimonRubenDrauz 03bfc50
further style fixes
SimonRubenDrauz 9a3c81f
further required adaptions due to style
SimonRubenDrauz c868d9b
further style adaptions
SimonRubenDrauz 864f6e6
further style adaptions
SimonRubenDrauz d3d820d
remove not required create_lookups call
SimonRubenDrauz File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,22 @@ | ||
| pydocstyle: | ||
| disable: | ||
| - D213 | ||
|
|
||
| pylint: | ||
| options: | ||
| # This codebase assembles Jacobian/PIT entries in single functions that naturally handle many | ||
| # physical quantities (pressures, densities, derivatives, ...) as separate local variables and | ||
| # parameters - pylint's stock thresholds (15 locals / 5 args) are far below what that pattern | ||
| # needs. Bundling them into dicts/dataclasses purely to satisfy this metric would obscure the | ||
| # actual math rather than clarify it, so the limits are raised to comfortably cover the | ||
| # largest legitimate cases already in the codebase (39 locals, 13 positional args) instead. | ||
| max-locals: 45 | ||
| max-args: 15 | ||
| max-positional-arguments: 15 | ||
| disable: | ||
| # `if not len(x):` shows up throughout as `x` is almost always a numpy array or pandas | ||
| # DataFrame, not a plain sequence - `if not x:` raises `ValueError: The truth value of an | ||
| # array/DataFrame with more than one element is ambiguous` for anything but a 0/1-length | ||
| # array. Pylint's suggested rewrite is only valid for plain Python sequences, so applying it | ||
| # here would introduce a real crash rather than fix a style nit. | ||
| - use-implicit-booleaness-not-len |
This file contains hidden or 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 hidden or 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 hidden or 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 |
|---|---|---|
|
|
@@ -18,99 +18,19 @@ class Component: | |
| def table_name(cls): | ||
| raise NotImplementedError() | ||
|
|
||
| @classmethod | ||
| def init_results(cls, net): | ||
| """ | ||
| Function that intializes the result table for the component. | ||
|
|
||
| :param net: The pandapipes network | ||
| :type net: pandapipesNet | ||
| :return: No Output. | ||
| """ | ||
| output, all_float = cls.get_result_table(net) | ||
| init_results_element(net, cls.table_name(), output, all_float) | ||
| res_table = net["res_" + cls.table_name()] | ||
| return res_table | ||
|
|
||
| @classmethod | ||
| def extract_results(cls, net, options, branch_results, mode): | ||
| """ | ||
| Function that extracts certain results. | ||
|
|
||
| :param net: The pandapipes network | ||
| :type net: pandapipesNet | ||
| :param options: | ||
| :type options: | ||
| :param branch_results: | ||
| :type branch_results: | ||
| :param mode: | ||
| :type mode: | ||
| :return: No Output. | ||
| """ | ||
| raise NotImplementedError | ||
|
|
||
| @classmethod | ||
| def get_component_input(cls): | ||
| """ | ||
|
|
||
| :return: | ||
| :rtype: | ||
| """ | ||
| raise NotImplementedError | ||
| """Get component input. | ||
|
|
||
| @classmethod | ||
| def get_result_table(cls, net): | ||
| """ | ||
| Get result table. | ||
|
|
||
| :param net: a pandapipes net | ||
| :type net: pandapipes.pandapipesNet | ||
| :return: | ||
| :rtype: | ||
| """ | ||
| raise NotImplementedError | ||
|
|
||
| @classmethod | ||
| def adaption_before_derivatives_hydraulic(cls, net, | ||
| branch_pit, node_pit, | ||
| branch_pit_old, node_pit_old, | ||
| idx_lookups, options): | ||
| pass | ||
|
|
||
| @classmethod | ||
| def adaption_after_derivatives_hydraulic(cls, net, | ||
| branch_pit, node_pit, | ||
| branch_pit_old, node_pit_old, | ||
| idx_lookups, options): | ||
| pass | ||
|
|
||
| @classmethod | ||
| def adaption_before_derivatives_thermal(cls, net, | ||
| branch_pit, node_pit, | ||
| branch_pit_old, node_pit_old, | ||
| idx_lookups, options): | ||
| pass | ||
|
|
||
| @classmethod | ||
| def adaption_after_derivatives_thermal(cls, net, | ||
| branch_pit, node_pit, | ||
| branch_pit_old, node_pit_old, | ||
| idx_lookups, options): | ||
| pass | ||
|
|
||
| @classmethod | ||
| def rerun_hydraulics(cls, net, branch_pit, node_pit, idx_lookups, options): | ||
| return False | ||
|
|
||
| @classmethod | ||
| def rerun_thermal(cls, net, branch_pit, node_pit, idx_lookups, options): | ||
| return False | ||
|
|
||
| @classmethod | ||
| def create_node_lookups(cls, net, ft_lookups, table_lookup, idx_lookups, current_start, | ||
| current_table, internals): | ||
| """ | ||
| Function which creates node lookups. | ||
| """Function which creates node lookups. | ||
|
|
||
| :param net: The pandapipes network | ||
| :type net: pandapipesNet | ||
|
|
@@ -134,8 +54,7 @@ def create_node_lookups(cls, net, ft_lookups, table_lookup, idx_lookups, current | |
| @classmethod | ||
| def create_branch_lookups(cls, net, ft_lookups, table_lookup, idx_lookups, current_start, | ||
| current_table, internals): | ||
| """ | ||
| Function which creates branch lookups. | ||
| """Function which creates branch lookups. | ||
|
|
||
| :param net: The pandapipes network | ||
| :type net: pandapipesNet | ||
|
|
@@ -156,11 +75,19 @@ def create_branch_lookups(cls, net, ft_lookups, table_lookup, idx_lookups, curre | |
| """ | ||
| return current_start, current_table | ||
|
|
||
| @classmethod | ||
| def register_pit_node_entries(cls, net, node_pit, registry) -> None: | ||
| pass | ||
|
|
||
| @classmethod | ||
| def register_pit_branch_entries(cls, net, branch_pit, node_pit, registry) -> None: | ||
| pass | ||
|
|
||
| @classmethod | ||
| def create_component_array(cls, net, component_pits): | ||
| """ | ||
| Function which creates an internal array of the component in analogy to the pit, but with | ||
| component specific entries, that are not needed in the pit. | ||
| """Create an internal array of the component in analogy to the pit. | ||
|
|
||
| Holds component-specific entries that are not needed in the pit. | ||
|
|
||
| :param net: The pandapipes network | ||
| :type net: pandapipesNet | ||
|
|
@@ -172,28 +99,57 @@ def create_component_array(cls, net, component_pits): | |
| pass | ||
|
|
||
| @classmethod | ||
| def create_pit_node_entries(cls, net, node_pit): | ||
| """ | ||
| Function which creates pit branch entries. | ||
| def register_hydraulic_equations(cls, net, branch_pit, node_pit, sys_idx, registry): | ||
| pass | ||
|
|
||
| @classmethod | ||
| def register_thermal_equations(cls, net, branch_pit, node_pit, sys_idx, registry): | ||
| pass | ||
|
|
||
| @classmethod | ||
| def rerun_hydraulics(cls, net, branch_pit, node_pit, idx_lookups, options): # pylint: disable=unused-argument | ||
| return False | ||
|
|
||
| @classmethod | ||
| def rerun_thermal(cls, net, branch_pit, node_pit, idx_lookups, options): # pylint: disable=unused-argument | ||
| return False | ||
|
|
||
| @classmethod | ||
| def init_results(cls, net): | ||
| """Function that intializes the result table for the component. | ||
|
|
||
| :param net: The pandapipes network | ||
| :type net: pandapipesNet | ||
| :param node_pit: | ||
| :type node_pit: | ||
| :return: No Output. | ||
| """ | ||
| pass | ||
| output, all_float = cls.get_result_table(net) | ||
| init_results_element(net, cls.table_name(), output, all_float) | ||
| res_table = net["res_" + cls.table_name()] | ||
| return res_table | ||
|
|
||
| @classmethod | ||
| def create_pit_branch_entries(cls, net, branch_pit): | ||
| def get_result_table(cls, net): | ||
| """Get result table. | ||
|
|
||
| :param net: a pandapipes net | ||
| :type net: pandapipes.pandapipesNet | ||
| :return: | ||
| :rtype: | ||
| """ | ||
| Function which creates pit branch entries. | ||
| raise NotImplementedError | ||
|
|
||
| @classmethod | ||
| def extract_results(cls, net, options, branch_results, mode): | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As mentioned in my above comment, calculation modes would make sense, here we already implemented this approach. We could adapt it once a concept is found for the above methods. |
||
| """Function that extracts certain results. | ||
|
|
||
| :param net: The pandapipes network | ||
| :type net: pandapipesNet | ||
| :param branch_pit: | ||
| :type branch_pit: | ||
| :param options: | ||
| :type options: | ||
| :param branch_results: | ||
| :type branch_results: | ||
| :param mode: | ||
| :type mode: | ||
| :return: No Output. | ||
| """ | ||
| pass | ||
|
|
||
| raise NotImplementedError | ||
This file contains hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am wondering if we could make this approach a little broader and ask the component to register the required equations (or rerun the simulation, see below) with a keyword desceibing the current simulation mode. Then implement the allowed simulation modes for each component. This way it would be possible to add simulation modes
The mode could be based on a string or a Literal.