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

add station controller #2228

Merged
merged 40 commits into from
Aug 28, 2024
Merged

Conversation

rbolgaryn
Copy link
Member

No description provided.

Copy link

codecov bot commented Feb 29, 2024

Codecov Report

Attention: Patch coverage is 41.00000% with 236 lines in your changes missing coverage. Please review.

Project coverage is 76.04%. Comparing base (407c6d5) to head (cd9c6a8).
Report is 41 commits behind head on develop.

Files Patch % Lines
...ower/converter/powerfactory/pp_import_functions.py 2.16% 226 Missing ⚠️
pandapower/control/controller/station_control.py 94.04% 10 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #2228      +/-   ##
===========================================
- Coverage    76.41%   76.04%   -0.37%     
===========================================
  Files          280      281       +1     
  Lines        32429    32798     +369     
===========================================
+ Hits         24779    24940     +161     
- Misses        7650     7858     +208     

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

Copy link
Contributor

@vogt31337 vogt31337 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please provide more description, a test and an entry in the changelog. @rbolgaryn

@SteffenMeinecke
Copy link
Member

@rbolgaryn It seems that any documentation is missing.

@rbolgaryn
Copy link
Member Author

this is work in progress still

…lable input/output elements and to overwrite local control settings from powerfactory element.
…lable input/output elements and to overwrite local control settings from powerfactory element.
@pawellytaev
Copy link
Contributor

pawellytaev commented Aug 2, 2024

@rbolgaryn @hilbrich suggestion for BinarySearchControl.control_step()

    def control_step(self, net):
        self._binarysearchcontrol_step(net)

    def _binarysearch_control_step(self, net)
        if not self.in_service:
            return
        if self.output_values_old is None:
            self.output_values_old, self.output_values = self.output_values, self.output_values + 1e-3
        else:
            step_diff = self.diff - self.diff_old
            x = self.output_values - self.diff * (self.output_values - self.output_values_old) / np.where(
                step_diff == 0, 1e-6, step_diff)
            x = x * self.output_values_distribution if isinstance(x, numbers.Number) else sum(
                x) * self.output_values_distribution
            self.output_values_old, self.output_values = self.output_values, x
        write_to_net(net, self.output_element, self.output_element_index, self.output_variable, self.output_values,
                     self.write_flag)

So other controllers can use the Binary Search function when inheriting from BinarySearchController with:

class NewControllerWithBinarySearch(BinarySearchControl):
    def __init__(self, net, in_service, order, level,
                         drop_same_existing_ctrl,
                         matching_params, **kwargs):
        super().__init__(net, in_service=in_service, order=order, level=level,
                         drop_same_existing_ctrl=drop_same_existing_ctrl,
                         matching_params=matching_params, **kwargs)
        # init for NewControllerWithBinarySearch
    def control_step(self, net):
        self._binarysearch_control_step(net)
        
        # use the results from self._binarysearch_control_step

What do you think? This would i.m.o. make the BinarySearchController more usable for other controllers

@vogt31337 vogt31337 marked this pull request as draft August 6, 2024 14:24
@hilbrich hilbrich marked this pull request as ready for review August 9, 2024 07:42
@vogt31337 vogt31337 self-requested a review August 28, 2024 11:11
@vogt31337 vogt31337 merged commit be0f2cf into e2nIEE:develop Aug 28, 2024
14 of 25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants