-
Notifications
You must be signed in to change notification settings - Fork 491
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
Feature: allow passing custom runpp-function to pp.diagnostics #2193
Feature: allow passing custom runpp-function to pp.diagnostics #2193
Conversation
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.
Dear @jthurner ,
thank you for this contribution!
I suggest enabling two features: 1) passing the function to be used instead of runpp and 2) passing kwargs to that function - in a way that either one is possible and you do not need to prepare the partial for the diagnostic function.
e.g.
diagnostic(net, init="results")
diagnostic(net, runpp_function=pp.rundcpp)
diagnostic(net, runpp_function=pp.rundcpp, trafo_loading="power")
Also, I suggest renaming the parameter to "run" to be consistent with the pp.run_timeseries where you can pass the runpp function as the "run" parameter.
Dear Roman, |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #2193 +/- ##
========================================
Coverage 79.43% 79.44%
========================================
Files 255 255
Lines 27947 27952 +5
========================================
+ Hits 22201 22206 +5
Misses 5746 5746 ☔ View full report in Codecov by Sentry. |
Dear @jthurner , please update the branch (merge develop) and add a mention of this change to CHANGELOG. |
for some reason I cannot update the branch (usually there is a button "Update branch" but not in this case) |
58f1193
to
2b7b1a0
Compare
Merged develop and updated CHANGELOG.
Because the fork is under an organization account, I can not grant "Allow edits from maintainers" on the PR (see e.g. |
pp.diagnostic
runs power flows during various tests but does not allow passing arguments topp.runpp
.This PR adds an optional argument
runpp_function
topp.diagnostic
which takes a function to be used for running power flows. The argument defaults topp.runpp
, existing code is unaffected.Arguments to
pp.runpp
can then be passed throughpp.diagnostic
by supplying a partial as therunpp_function
.