Skip to content
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

custom components #658

Draft
wants to merge 12 commits into
base: develop
Choose a base branch
from
Draft

Conversation

mfranz13
Copy link
Contributor

@mfranz13 mfranz13 commented Nov 6, 2024

Draft to inlcude custom components in pandapipes.

  • conversion from class methods like table_name to attributes
  • enforce attributes in child classes with metaclass
  • change from classes only as namespaces to classes that get instantiated
  • create central component registry with all component instances
  • adjust component function calls
  • change components in converter
  • restructure helper functions like get_lookup to decouple the modules component_models and pf
  • raise warning if circ pump mass and flow control are in the same net
  • save and load grids with custom components
  • tests
  • docstrings
  • tutorial
  • changelog

@mfranz13 mfranz13 added the enhancement New feature or request label Nov 6, 2024
@mfranz13 mfranz13 self-assigned this Nov 6, 2024
@mfranz13 mfranz13 marked this pull request as draft November 6, 2024 12:58
mfranz13 and others added 9 commits November 7, 2024 17:31
- converted methods that should be attributes to properties
- converted classmethods to normal methods
- components are now intened to be instantiated (still work in progress)
- streamlined the class structure (still work in progress)
- optimized imports
…the instances of the components

- starting to restructure some low level helper functions for better capsulation of modules
- shifted low level functions from the component or pf files to the new folder "utils"
- shifted the file pf.result_extraction to utils
- pf setup, extraction and implementation adjustement to component_registry
- ComponentRegistry calls in ComponentModel definitions are lazy and ComponentRegistry + all Components now get initialized in comp_init (after all Component Models are created)
- shifted ValvePipe to component_models
- from_json loads components with their table_name in net.component_list
- fix codacy issues
Copy link

codecov bot commented Nov 12, 2024

Codecov Report

Attention: Patch coverage is 90.40075% with 103 lines in your changes missing coverage. Please review.

Project coverage is 85.86%. Comparing base (464fb63) to head (f22f3a4).

Files with missing lines Patch % Lines
src/pandapipes/utils/internals.py 77.01% 40 Missing ⚠️
src/pandapipes/utils/result_extraction.py 76.92% 36 Missing ⚠️
src/pandapipes/component_models/pipe_component.py 92.80% 9 Missing ⚠️
...andapipes/component_models/valve_pipe_component.py 66.66% 5 Missing ⚠️
src/pandapipes/component_models/_base_component.py 83.33% 4 Missing ⚠️
...andapipes/component_models/_node_element_models.py 90.47% 2 Missing ⚠️
src/pandapipes/component_models/_node_models.py 75.00% 2 Missing ⚠️
.../pandapipes/component_models/junction_component.py 92.85% 2 Missing ⚠️
src/pandapipes/component_models/_branch_models.py 96.87% 1 Missing ⚠️
src/pandapipes/pandapipes_net.py 96.15% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #658      +/-   ##
===========================================
+ Coverage    84.77%   85.86%   +1.09%     
===========================================
  Files           91       91              
  Lines         6737     6206     -531     
===========================================
- Hits          5711     5329     -382     
+ Misses        1026      877     -149     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

- fixed soem more codacy issues
- saving and loading grids with custom components
- test component registry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant